forked from perilouswithadollarsign/cstrike15_src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.h
251 lines (199 loc) · 6.68 KB
/
options.h
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
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Defines options that are written to the registry.
//
//=============================================================================//
#ifndef OPTIONS_H
#define OPTIONS_H
#pragma once
#pragma warning(push, 1)
#pragma warning(disable:4701 4702 4530)
#include <fstream>
#pragma warning(pop)
#include <afxtempl.h>
class CGameConfig;
class KeyValues;
enum TextureAlignment_t;
class COptionsGeneral
{
public:
int nMaxCameras;
int iUndoLevels;
BOOL bLockingTextures;
BOOL bScaleLockingTextures;
TextureAlignment_t eTextureAlignment;
BOOL bLoadwinpos;
BOOL bIndependentwin;
BOOL bEnablePerforceIntegration;
BOOL bGroupWhileIgnore;
BOOL bStretchArches;
BOOL bShowHelpers;
BOOL bCheckVisibleMapErrors;
int iTimeBetweenSaves;
int iMaxAutosaveSpace;
int iMaxAutosavesPerMap;
BOOL bClosedCorrectly;
char szAutosaveDir[MAX_PATH];
BOOL bShowCollisionModels;
BOOL bShowDetailObjects;
BOOL bShowNoDrawBrushes;
BOOL bEnableAutosave;
BOOL bShowHiddenTargetsAsBroken;
BOOL bRadiusCulling;
};
class COptionsTextures
{
public:
CStringArray TextureFiles;
int nTextureFiles;
float fBrightness;
};
class COptionsColors
{
public:
bool bUseCustom; // Whether to use the custom colors or not.
bool bScaleAxisColor; // Whether to use the intensity slider to scale the axis color in the 2D view.
bool bScaleGridColor; // Whether to use the intensity slider to scale the grid color in the 2D view.
bool bScaleGridDotColor; // Whether to use the intensity slider to scale the dotted grid color in the 2D view.
bool bScaleGrid10Color; // Whether to use the intensity slider to scale the 10 grid color in the 2D view.
bool bScaleGrid1024Color; // Whether to use the intensity slider to scale the 1024 grid color in the 2D view.
COLORREF clrAxis; // The 2D view axis color.
COLORREF clrGrid; // The 2D view grid color.
COLORREF clrGridDot; // The 2D view dotted grid color.
COLORREF clrGrid10; // The 2D view grid color for every 10th line.
COLORREF clrGrid1024; // The 2D view grid color for every 1024 units line.
COLORREF clrBackground; // The 2D view background color.
COLORREF clrBrush; // The color of brushes.
COLORREF clrEntity; // The default color of point entities & brush entities, can be overridden by the FGD.
COLORREF clrSelection; // The color of selected objects.
COLORREF clrVertex; // The color of vertices.
COLORREF clrToolHandle; // The color of tool handles.
COLORREF clrToolBlock; // The color of the block tool.
COLORREF clrToolSelection; // The color of the selection tool.
COLORREF clrToolMorph; // The color of the morph tool.
COLORREF clrToolPath; // The color of the path tool.
COLORREF clrToolDrag; // The color of tool bounds while it is being dragged.
COLORREF clrModelCollisionWireframe; // The color of a model's collision wireframe
COLORREF clrModelCollisionWireframeDisabled; // The color of a model's collision wireframe when set to "Not Solid" via the entity properties
};
class COptionsView2D
{
public:
BOOL bCrosshairs;
BOOL bGroupCarve;
BOOL bScrollbars;
BOOL bRotateConstrain;
BOOL bDrawVertices;
BOOL bDrawModels;
BOOL bWhiteOnBlack;
BOOL bGridHigh1024;
BOOL bGridHigh10;
BOOL bHideSmallGrid;
BOOL bNudge;
BOOL bOrientPrimitives;
BOOL bAutoSelect;
BOOL bSelectbyhandles;
BOOL bKeepclonegroup;
BOOL bGridHigh64;
BOOL bCenteroncamera;
BOOL bUsegroupcolors;
BOOL bGridDots;
int iDefaultGrid;
int iGridIntensity;
int iGridHighSpec;
};
class COptionsView3D
{
public:
BOOL bHardware; // Whether to use hardware acceleration (disabled for OpenGL).
BOOL bReverseY; // Wether to reverse the mouse's Y axis when mouse looking.
BOOL bUseMouseLook; // Whether to use the engine's default movement controls.
int iBackPlane; // Distance to far clipping plane in world units.
int nModelDistance; // Distance in world units within which studio models render.
int nDetailDistance; // Distance in world units within which detail props render.
BOOL bAnimateModels; // Whether to animate studio models.
int nForwardSpeedMax; // Max forward speed in world units per second.
int nTimeToMaxSpeed; // Time to max forward speed in milliseconds.
BOOL bFilterTextures; // Whether to filter textures.
BOOL bReverseSelection; // Whether to animate studio models.
bool bPreviewModelFade; // Whether to preview model fade in the 3D view.
int nFadeMode; // Fade - Low, Med, High
float fFOV; // FOV of 3D Camera
int iViewInstancesMode; // View Instances mode, none, tinted, normal
};
class COptionsConfigs
{
public:
COptionsConfigs(void);
virtual ~COptionsConfigs(void);
CGameConfig *AddConfig(void);
int LoadGameConfigs();
void SaveGameConfigs();
bool ResetGameConfigs( bool bOverwrite );
inline int GetGameConfigCount();
inline CGameConfig *GetGameConfig(int nIndex);
// find a game config based on ID:
CGameConfig *FindConfig(DWORD dwID, int *piIndex = NULL);
CGameConfig *FindConfigForGame(const char *szGame);
int nConfigs;
CTypedPtrArray<CPtrArray, CGameConfig*> Configs;
CString m_strConfigDir;
private:
int LoadGameConfigsBlock( KeyValues *pBlock );
int ImportOldGameConfigs(const char *pszFileName);
};
//-----------------------------------------------------------------------------
// Purpose: Functions for iterating the game configs.
//-----------------------------------------------------------------------------
int COptionsConfigs::GetGameConfigCount()
{
return nConfigs;
}
CGameConfig *COptionsConfigs::GetGameConfig(int nIndex)
{
return Configs.GetAt(nIndex);
}
class COptions
{
public:
COptions();
bool Init();
bool Read();
void SetDefaults();
void Write( BOOL fOverwrite, BOOL fSaveConfigs );
void SetClosedCorrectly(BOOL bClosed);
// This happens if it can't initialize the file system, or if they're missing gameinfo.txt.
// It forces them to choose or create a config that works.
bool RunConfigurationDialog();
void PerformChanges(DWORD = 0xffffffff);
// Accessors:
TextureAlignment_t GetTextureAlignment(void);
TextureAlignment_t SetTextureAlignment(TextureAlignment_t eTextureAlignment);
bool GetShowHelpers(void);
void SetShowHelpers(bool bShow);
BOOL SetLockingTextures(BOOL b);
BOOL IsLockingTextures(void);
BOOL SetScaleLockingTextures(BOOL b);
BOOL IsScaleLockingTextures(void);
// Attributes:
UINT uDaysSinceInstalled;
// Flags for PerformChanges:
enum
{
secTextures = 0x01,
secGeneral = 0x02,
secView2D = 0x04,
secView3D = 0x08,
secConfigs = 0x10
};
COptionsGeneral general;
COptionsView2D view2d;
COptionsView3D view3d;
COptionsTextures textures;
COptionsConfigs configs;
COptionsColors colors;
private:
void ReadColorSettings(void);
};
extern COptions Options;
#endif // OPTIONS_H