1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef OBJECTPROPERTIES_H
#define OBJECTPROPERTIES_H
#pragma once
#include "MapClass.h"
#include "EditGameClass.h"
#include "ObjectPage.h"
#include "OP_Groups.h"
#include "AnchorMgr.h"
class COP_Entity;
class COP_Flags;
class COP_Output;
class COP_Input;
class COP_Model;
enum LayoutType_t;
//
// Wrap map classes in CObject so we can use runtime identification
// to pass edit data to the object pages.
//
class editCMapClass : public CObject, public CMapClass
{
DECLARE_DYNAMIC(editCMapClass)
public:
// kludge:
MAPCLASSTYPE GetType() { return NULL; }
BOOL IsMapClass(MAPCLASSTYPE Type) { return FALSE; }
};
class editCEditGameClass : public CObject, public CEditGameClass
{
DECLARE_DYNAMIC(editCEditGameClass)
};
class CObjectProperties : public CPropertySheet
{
DECLARE_DYNAMIC(CObjectProperties)
public:
CObjectProperties(void);
virtual ~CObjectProperties(void);
CObjectProperties(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CObjectProperties(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
inline void UpdateGrouplist(void);
PVOID GetEditObject(CRuntimeClass *pType);
PVOID GetEditObjectFromMapObject(CMapClass *pobj, CRuntimeClass *pType);
void CopyDataToEditObjects(CMapClass *pobj);
void SetPageToOutput(CEntityConnection *pConnection);
void SetPageToInput(CEntityConnection *pConnection);
BOOL SetupPages(void);
void CreatePages(void);
void SaveData(void);
void LoadDataForPages(int iPage = -1);
void SetObjectList(const CMapObjectList *pObjectList);
void MarkDataDirty();
void SetOutputButtonState(int nState);
void SetInputButtonState(int nState);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CObjectProperties)
virtual BOOL OnInitDialog();
//}}AFX_VIRTUAL
protected:
void AddObjectExpandGroups(CMapClass *pObject);
void ReloadData();
LayoutType_t GetLayout(void);
void GetTabsForLayout(LayoutType_t eLayoutType, bool &bEntity, bool &bGroups, bool &bFlags, bool &bModel);
void CreateButtons(void);
void UpdateOutputButton(void);
void UpdateInputButton(void);
void SaveActivePage(void);
void RestoreActivePage(void);
void UpdateAnchors( CWnd *pPage );
CAnchorMgr m_AnchorMgr;
//
// Pages.
//
COP_Entity *m_pEntity;
COP_Groups *m_pGroups;
COP_Flags *m_pFlags;
COP_Output *m_pOutput;
COP_Input *m_pInput;
COP_Model *m_pModel;
//
// instance button
//
CButton *m_pInstanceButton;
//
// Input/output connection buttons
//
CButton *m_pInputButton;
CButton *m_pOutputButton;
HICON m_hIconOutputGood;
HICON m_hIconOutputBad;
HICON m_hIconInputGood;
HICON m_hIconInputBad;
CPropertyPage *m_pDummy; //
bool m_bDummy; //
CMapObjectList m_DstObjects; // list of objects we work on
const CMapObjectList *m_pOrgObjects; // list of input object we will work on
CObjectPage **m_ppPages; // Pointers to the pages that are currently in use
int m_nPages; // Number of pages currently in use
CObjectPage *m_pLastActivePage; // Used for restoring the last active page when changing selection.
bool m_bDataDirty; // true if selected object somehow changed etc
bool m_bCanEdit; // true if the object can be edited
//{{AFX_MSG(CObjectProperties)
afx_msg void OnOK(void);
afx_msg void OnApply(void);
afx_msg void OnCancel(void);
afx_msg void OnInputs(void);
afx_msg void OnOutputs(void);
afx_msg void OnEditInstance(void);
afx_msg void OnClose();
afx_msg void OnPaint();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnSize( UINT nType, int cx, int cy );
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
friend CObjectPage;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
inline void CObjectProperties::UpdateGrouplist(void)
{
if (m_pGroups != NULL)
{
m_pGroups->UpdateGroupList();
}
}
#endif // OBJECTPROPERTIES_H
|