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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef OP_OUTPUT_H
#define OP_OUTPUT_H
#pragma once
#include "ObjectPage.h"
#include "Resource.h"
#include "TargetNameCombo.h"
#include "MapEntity.h"
#include "ToolPickEntity.h"
#include "AutoSelCombo.h"
#include "AnchorMgr.h"
#define OUTPUT_LIST_NUM_COLUMNS 6
class COP_Output;
enum SortDirection_t;
//-----------------------------------------------------------------------------
// Purpose: A little glue object that connects the entity picker tool to our dialog.
//-----------------------------------------------------------------------------
class COP_OutputPickEntityTarget : public IPickEntityTarget
{
public:
void AttachEntityDlg(COP_Output *pDlg) { m_pDlg = pDlg; }
void OnNotifyPickEntity(CToolPickEntity *pTool);
void AttachDlgItem( int nItem ) { m_nDlgItem = nItem; }
private:
int m_nDlgItem;
COP_Output *m_pDlg;
};
//-----------------------------------------------------------------------------
// Purpose: A list of connections and entites that send them.
//-----------------------------------------------------------------------------
class COutputConnection
{
public:
CEntityConnectionList* m_pConnList;
CMapEntityList* m_pEntityList;
bool m_bIsValid;
bool m_bOwnedByAll; // Connection used by all selected entities
};
class COP_Output : public CObjectPage, public CFilteredComboBox::ICallbacks
{
public:
static CImageList *m_pImageList;
static CEntityConnectionList* m_pConnectionBuffer; // Stores connections for copy/pasting
static void EmptyCopyBuffer(void);
public:
DECLARE_DYNCREATE(COP_Output)
// Construction
COP_Output(void);
~COP_Output(void);
virtual void UpdateData( int Mode, PVOID pData, bool bCanEdit );
void SetSelectedConnection(CEntityConnection *pConnection);
bool ShouldShowHiddenTargets();
protected:
virtual void OnTextChanged( const char *pText );
void AddEntityConnections(CMapEntity *pEntity, bool bFirst);
void AddConnection(CEntityConnection *pConnection);
void RemoveAllEntityConnections(void);
void UpdateConnectionList(void);
void ResizeColumns(void);
void SetSelectedItem(int nItem);
void SetSelectedConnections(CEntityConnectionList &List);
// Validation functions
bool ValidateConnections(COutputConnection *pOutputConn, bool bVisibilityCheck);
void UpdateValidityButton(void);
// Edit controls
void UpdateEditControls(void);
void EnableEditControls(bool bValue = true);
void UpdateItemValidity(int nItem);
void EnableTarget(bool bEnable);
void EnableParam(bool bEnable);
bool bSkipEditControlRefresh;
// Functions for updating edited connections
void UpdateEditedInputs(void);
void UpdateEditedOutputs(void);
void UpdateEditedTargets(void);
void UpdateEditedDelays(void);
void UpdateEditedFireOnce(void);
void UpdateEditedParams(void);
// Fuctions for reacting to combo box changes
void OutputChanged(void);
void InputChanged(void);
void SortListByColumn(int nColumn, SortDirection_t eDirection);
void SetSortColumn(int nColumn, SortDirection_t eDirection);
void UpdateColumnHeaderText(int nColumn, bool bIsSortColumn, SortDirection_t eDirection);
CMapEntityList m_EntityList; // Filtered m_pObjectList that only includes map entities
const CMapEntityList* m_pMapEntityList; // List of all entities in the map.
CEntityConnectionList m_EditList; // List of selected connections being edited
void UpdateEntityList(); // Generates m_EntityList from m_pObjectList
protected:
CAnchorMgr m_AnchorMgr;
CEditGameClass *m_pEditGameClass;
CMapEntity *m_pEntity;
bool m_bNoParamEdit;
//
// Cached data for sorting the list view.
//
int m_nSortColumn; // Current column used for sorting.
SortDirection_t m_eSortDirection[OUTPUT_LIST_NUM_COLUMNS]; // Last sort direction per column.
bool m_bPickingEntities;
// ########################################
// Message editing
// ########################################
void SetConnection(CEntityConnectionList *pConnectionList);
void SetMapEntityList(const CMapEntityList *pMapEntityList);
void AddEntityOutputs(CMapEntity *pEntity);
void FillInputList(void);
void FillOutputList(void);
void FillTargetList(void);
void FilterInputList(void);
void FilterOutputList(void);
void FilterTargetList(void);
void FilterEntityOutputs(CMapEntity *pEntity);
void StopPicking(void);
CClassInput* GetInput(char *szInput, int nSize);
CClassOutput* GetOutput(char *szOutput, int nSize);
CMapEntityList* GetTarget(char *szTarget, int nSize);
void UpdateCombosForSelectedInput(CClassInput *pInput);
void UpdateCombosForSelectedOutput(CClassOutput *pOutput);
// #########################################
//{{AFX_DATA(COP_Output)
enum { IDD = IDD_OBJPAGE_OUTPUT };
CListCtrl m_ListCtrl;
CAutoSelComboBox m_ComboOutput;
CTargetNameComboBox m_ComboTarget;
CAutoSelComboBox m_ComboInput;
CButton m_CheckBoxFireOnce;
CButton m_ctlShowHiddenTargetsAsBroken;
CButton m_AddControl;
CButton m_PasteControl;
CButton m_DeleteControl;
CString m_strOutput;
CString m_strTarget;
CString m_strInput;
CString m_strParam;
float m_fDelay;
BOOL m_bFireOnce;
//}}AFX_DATA
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(COP_Output)
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult);
virtual BOOL OnInitDialog(void);
virtual void OnDestroy(void);
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(COP_Output)
afx_msg void OnAdd(void);
afx_msg void OnCopy(void);
afx_msg void OnPaste(void);
afx_msg void OnSize( UINT nType, int cx, int cy );
afx_msg void OnDelete(void);
afx_msg void OnMark(void);
afx_msg void OnPickEntity(void);
afx_msg void OnPickEntityParam(void);
afx_msg void OnSelChangeInput(void);
afx_msg void OnEditUpdateInput(void);
afx_msg void OnSelChangeOutput(void);
afx_msg void OnEditUpdateOutput(void);
afx_msg void OnSelChangeParam(void);
afx_msg void OnEditUpdateParam(void);
afx_msg void OnEditDelay(void);
afx_msg void OnFireOnce(void);
afx_msg void OnShowHiddenTargetsAsBroken();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool m_bEntityParamTarget;
COP_OutputPickEntityTarget m_PickEntityTarget;
CString m_strLastParam;
bool m_bIgnoreTextChanged;
friend class COP_OutputPickEntityTarget;
public:
};
#endif // OP_OUTPUT_H
|