18 #include "MissionGoalsDlg.h"
19 #include "Management.h"
20 #include "OperatorArgTypeSelect.h"
22 #define ID_ADD_SHIPS 9000
23 #define ID_REPLACE_SHIPS 11000
24 #define ID_ADD_WINGS 13000
25 #define ID_REPLACE_WINGS 15000
29 static char THIS_FILE[] = __FILE__;
64 CDialog::OnInitDialog();
75 Goal_editor_dlg =
this;
88 CDialog::DoDataExchange(pDX);
108 ON_NOTIFY(NM_RCLICK, IDC_GOALS_TREE, OnRclickGoalsTree)
109 ON_NOTIFY(TVN_ENDLABELEDIT, IDC_GOALS_TREE, OnEndlabeleditGoalsTree)
110 ON_NOTIFY(TVN_BEGINLABELEDIT, IDC_GOALS_TREE, OnBeginlabeleditGoalsTree)
116 ON_BN_CLICKED(
ID_OK, OnOk)
133 m_goals_tree.select_sexp_node = select_sexp_node;
134 select_sexp_node = -1;
136 m_goals_tree.clear_tree();
141 if (!(*m_goals[i].
name))
142 strcpy_s(m_goals[i].name,
"<unnamed>");
144 m_goals[
i].formula = m_goals_tree.load_sub_tree(
Mission_goals[i].formula,
true,
"true");
147 m_goals_tree.post_load();
185 NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
188 h = pNMTreeView->itemNew.hItem;
273 TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
286 TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
419 if (
m_goals[goal].formula == node){
424 Assert(goal < m_num_goals);
425 while (goal < m_num_goals - 1) {
541 if (
m_goals[i].formula == old){
579 if (
m_goals[index1].formula == node1){
584 Assert(index1 < m_num_goals);
586 if (
m_goals[index2].formula == node2){
591 Assert(index2 < m_num_goals);
594 while (index1 < index2) {
600 while (index1 > index2 + 1) {
void record_window_data(window_data *wndd, CWnd *wnd)
int handler(int code, int goal)
#define IDC_GOAL_TYPE_DROP
GLfloat GLfloat GLfloat GLfloat h
void add_sub_tree(int node, HTREEITEM root)
afx_msg void OnButtonNewGoal()
afx_msg void OnGoalInvalid()
void insert_handler(int old, int node)
int init_window(window_data *wndd, CWnd *wnd, int adjust=0, int pre=0)
afx_msg void OnSelchangeDisplayGoalTypesDrop()
void link_modified(int *ptr)
void update_sexp_references(const char *old_name, const char *new_name, int format, int node)
void setup(CEdit *ptr=NULL)
int edit_label(HTREEITEM h)
GLenum GLuint GLenum GLsizei const GLchar * message
GLenum GLuint GLenum GLsizei const GLchar * buf
virtual void DoDataExchange(CDataExchange *pDX)
mission_goal Mission_goals[MAX_GOALS]
void right_clicked(int mode=0)
window_data Messages_wnd_data
window_data Mission_goals_wnd_data
void update_help(HTREEITEM h)
int end_label_edit(TVITEMA &item)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
afx_msg void OnBeginlabeleditGoalsTree(NMHDR *pNMHDR, LRESULT *pResult)
mission_goal m_goals[MAX_GOALS]
goal_sexp_tree m_goals_tree
afx_msg void OnEndlabeleditGoalsTree(NMHDR *pNMHDR, LRESULT *pResult)
HTREEITEM insert(LPCTSTR lpszItem, int image=BITMAP_ROOT, int sel_image=BITMAP_ROOT, HTREEITEM hParent=TVI_ROOT, HTREEITEM hInsertAfter=TVI_LAST)
void string_copy(char *dest, const CString &src, int max_len, int modify)
#define IDC_DISPLAY_GOAL_TYPES_DROP
void set_modified(BOOL arg)
GLuint const GLchar * name
afx_msg void OnSelchangeGoalTypeDrop()
#define IDC_BUTTON_NEW_GOAL
CMissionGoalsDlg * Goal_editor_dlg
afx_msg void OnChangeGoalDesc()
void swap_handler(int node1, int node2)
void add_operator(const char *op, HTREEITEM h=TVI_ROOT)
afx_msg void OnChangeGoalName()
int save_tree(int node=-1)
CMissionGoalsDlg(CWnd *pParent=NULL)
int MessageBox(HWND h, const char *s1, const char *s2, int i)
afx_msg void OnChangeGoalRating()
afx_msg void OnRclickGoalsTree(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnSelchangeTeam()
void hilite_item(int node)
#define SEXP_HELP_BOX_SIZE
afx_msg void OnChangeGoalScore()
afx_msg void OnSelchangedGoalsTree(NMHDR *pNMHDR, LRESULT *pResult)
#define MISSION_TYPE_MULTI_TEAMS