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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//=============================================================================
#ifndef ITEMTEST_CONTROLS_H
#define ITEMTEST_CONTROLS_H
#ifdef _WIN32
#pragma once
#endif
// Valve includes
#include "itemtest/itemtest.h"
#include "tier1/utlstring.h"
#include "vgui_controls/Label.h"
#include "vgui_controls/WizardPanel.h"
#include "vgui_controls/WizardSubPanel.h"
#include "vgui_controls/FileOpenStateMachine.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class vgui::CheckButton;
class vgui::PanelListPanel;
class vgui::TextEntry;
class vgui::ComboBox;
class vgui::TextEntry;
class CDualPanelList;
class CVmtEntry;
//=============================================================================
//
//=============================================================================
class CStatusLabel : public vgui::Label
{
DECLARE_CLASS_SIMPLE( CStatusLabel, vgui::Label );
public:
CStatusLabel( vgui::Panel *pPanel, const char *pszName, bool bValid = false );
// From vgui::Label
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
// New functions
virtual void SetValid( bool bValid );
virtual bool GetValid() const;
protected:
bool m_bValid;
Color m_cValid;
Color m_cInvalid;
void UpdateColors();
};
//=============================================================================
//
//=============================================================================
class CItemUploadSubPanel : public vgui::WizardSubPanel
{
DECLARE_CLASS_SIMPLE( CItemUploadSubPanel, vgui::WizardSubPanel );
public:
CItemUploadSubPanel( vgui::Panel *pParent, const char *pszName, const char *pszNextName );
// From vgui::Panel
virtual void PerformLayout();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
// From vgui::WizardSubPanel
virtual void OnDisplay();
virtual vgui::WizardSubPanel *GetNextSubPanel();
// Sucks data from the asset into the GUI
virtual void UpdateGUI()
{
AssertMsg1( 0, "Implement UpdateGUI in base class: %s", GetPanelClassName() );
}
// Sets the status labels
virtual bool UpdateStatus();
protected:
CUtlString m_sNextName; // The name of the next wizard sub panel
vgui::Label *m_pLabel; // Label at the top of the wizard sub panel
vgui::PanelListPanel *m_pPanelListPanel; // Standard list of widgets to set parameters
CStatusLabel *m_pStatusLabel; // Whether the overall panel is valid or not
vgui::Label *m_pStatusText; // The text for the overall status
// New functions
void AddStatusPanels( const char *pszPrefix );
void SetStatus( bool bValid, const char *pszPrefix, const char *pszMessage = NULL, bool bHide = false );
};
//=============================================================================
//
//=============================================================================
class CGlobalSubPanel : public CItemUploadSubPanel
{
DECLARE_CLASS_SIMPLE( CGlobalSubPanel, CItemUploadSubPanel );
public:
CGlobalSubPanel( vgui::Panel *pParent, const char *pszName, const char *pszNextName );
// From CItemUploadSubPanel
virtual void UpdateGUI();
virtual bool UpdateStatus();
MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel );
MESSAGE_FUNC_PTR( OnCheckButtonChecked, "CheckButtonChecked", panel );
protected:
vgui::TextEntry *m_pNameTextEntry;
vgui::ComboBox *m_pClassComboBox;
vgui::TextEntry *m_pSteamTextEntry;
vgui::CheckButton *m_pAutoSkinCheckButton;
};
//=============================================================================
//
//=============================================================================
class CGeometrySubPanel : public CItemUploadSubPanel, public vgui::IFileOpenStateMachineClient
{
DECLARE_CLASS_SIMPLE( CGeometrySubPanel, CItemUploadSubPanel );
public:
CGeometrySubPanel( vgui::Panel *pParent, const char *pszName, const char *pszNextName );
// From CItemUploadSubpanel
virtual void UpdateGUI();
virtual bool UpdateStatus();
// From IFileOpenStateMachineClient
virtual void SetupFileOpenDialog( vgui::FileOpenDialog *pDialog, bool bOpenFile, const char *pszFileFormat, KeyValues *pContextKeyValues );
virtual bool OnReadFileFromDisk( const char *pszFileName, const char *pszFileFormat, KeyValues *pContextKeyValues );
virtual bool OnWriteFileToDisk( const char *pszFileName, const char *pszFileFormat, KeyValues *pContextKeyValues );
MESSAGE_FUNC_INT( OnOpen, "Open", nLodIndex );
MESSAGE_FUNC_INT( OnDelete, "Delete", nLodIndex );
protected:
vgui::FileOpenStateMachine *m_pFileOpenStateMachine;
void AddGeometry();
};
//=============================================================================
//
//=============================================================================
class CMaterialSubPanel : public CItemUploadSubPanel, public vgui::IFileOpenStateMachineClient
{
DECLARE_CLASS_SIMPLE( CMaterialSubPanel, CItemUploadSubPanel );
public:
CMaterialSubPanel( vgui::Panel *pParent, const char *pszName, const char *pszNextName );
// From CItemUploadSubpanel
virtual void InvalidateLayout();
virtual void UpdateGUI();
virtual bool UpdateStatus();
// From IFileOpenStateMachineClient
virtual void SetupFileOpenDialog( vgui::FileOpenDialog *pDialog, bool bOpenFile, const char *pszFileFormat, KeyValues *pContextKeyValues );
virtual bool OnReadFileFromDisk( const char *pszFileName, const char *pszFileFormat, KeyValues *pContextKeyValues );
virtual bool OnWriteFileToDisk( const char *pszFileName, const char *pszFileFormat, KeyValues *pContextKeyValues );
enum Browse_t
{
kCommon,
kRed,
kBlue,
kNormal
};
void Browse( CVmtEntry *pVmtEntry, Browse_t nBrowseType );
CTargetVMT *GetTargetVMT( int nTargetVMTIndex );
protected:
vgui::FileOpenStateMachine *m_pFileOpenStateMachine;
void AddMaterial();
};
//=============================================================================
//
//=============================================================================
class CFinalSubPanel : public CItemUploadSubPanel
{
DECLARE_CLASS_SIMPLE( CFinalSubPanel, CItemUploadSubPanel );
public:
CFinalSubPanel( vgui::Panel *pParent, const char *pszName, const char *pszNextName );
// From CItemUploadSubPanel
virtual void UpdateGUI();
virtual bool UpdateStatus();
virtual void OnCommand( const char *command );
virtual void PerformLayout();
MESSAGE_FUNC( OnQuitApp, "QuitApp" );
void OnZip();
protected:
void OnGather();
void OnStudioMDL();
void OnHlmv();
void OnExplore( bool bMaterial, bool bContent);
bool GetHlmvCmd( CFmtStrMax &sHlmvCmd );
vgui::Button *m_pHLMVButton;
vgui::Label *m_pHLMVLabel;
vgui::Button *m_pExploreMaterialContentButton;
vgui::Label *m_pExploreMaterialContentLabel;
vgui::Button *m_pExploreModelContentButton;
vgui::Label *m_pExploreModelContentLabel;
vgui::Button *m_pExploreMaterialGameButton;
vgui::Label *m_pExploreMaterialGameLabel;
vgui::Button *m_pExploreModelGameButton;
vgui::Label *m_pExploreModelGameLabel;
};
//=============================================================================
//
//=============================================================================
class CItemUploadWizard : public vgui::WizardPanel
{
DECLARE_CLASS_SIMPLE( CItemUploadWizard, vgui::WizardPanel );
public:
CItemUploadWizard( vgui::Panel *pParent, const char *pszName );
virtual ~CItemUploadWizard();
void Run();
void UpdateGUI();
// This should be templatized but this is taking too long to write already...
CAssetTF &Asset() { return m_asset; }
virtual void OnFinishButton();
CItemUploadSubPanel *GetCurrentItemUploadSubPanel()
{
return dynamic_cast< CItemUploadSubPanel * >( GetCurrentSubPanel() );
}
protected:
friend class CItemUploadSubPanel;
CUtlVector< vgui::DHANDLE< vgui::WizardSubPanel > > m_hSubPanelList;
CAssetTF m_asset;
CFinalSubPanel *m_pFinalSubPanel;
};
//=============================================================================
//
//=============================================================================
class CItemUploadDialog : public vgui::Frame
{
DECLARE_CLASS_SIMPLE( CItemUploadDialog, vgui::Frame );
public:
CItemUploadDialog( vgui::Panel *pParent, const char *pszName );
~CItemUploadDialog();
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
extern CItemUploadDialog *g_pItemUploadDialog;
#endif // ITEMTEST_CONTROLS_H
|