Advanced Strategic Command
gameoptions.h
Go to the documentation of this file.
1 /***************************************************************************
2  gameoptions.h - description
3  -------------------
4  begin : Thu Jun 29 2000
5  copyright : (C) 2000 by frank landgraf
6  email :
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #ifndef GAMEOPTIONS_H
18 #define GAMEOPTIONS_H
19 
20 #include <string>
21 #include "password.h"
22 
23 #include "textfileparser.h"
24 #include "textfile_evaluation.h"
25 
26 
28 {
29  public:
31  static CGameOptions* Instance();
32 
33  CGameOptions();
34  void setDefaults();
35  void setDefaultDirectories();
36 /* CGameOptions( const CGameOptions& cgo );
37 
38  void copy ( const CGameOptions& cgo );
39  */
40 
41  void runTextIO ( PropertyContainer& pc );
42 
43 
44  bool isChanged();
45  void setChanged(bool flag = true);
46 
47  void load( const ASCString& filename );
48  void save( const ASCString& filename );
49 
50 
51  int getSearchPathNum();
52 
53  void setSearchPath ( int i, const ASCString& path );
54  void addSearchPath ( const ASCString& path );
55  ASCString getSearchPath( int i);
56 
57  int version;
58 
60  bool fastmove;
61 
63  int movespeed;
64 
67 
70 
73 
75  int mapzoom;
76 
79 
81  // int dontMarkFieldsNotAccessible_movement;
82 
85 
88 
91 
94 
97 
100 
103 
106 
109 
112 
115 
118 
120 
123 
125  struct Mouse
126  {
127  // int scrollbutton;
128 
131 
133  // int smallguibutton;
134 
136  // int largeguibutton;
137 
143  // int smalliconundermouse;
144 
147 
150 
152  // int unitweaponinfo;
153 
155  // int singleClickAction;
156 
159 
162 
163  static ASCString getButtonName( int button );
164  }
165  mouse;
166 
167 
169  {
172 
174  bool muteMusic;
175 
177  bool off;
178 
180 
182  }
183  sound;
184 
185  struct {
187  bool fillAmmo;
188  } unitProduction;
189 
192 
193  // int onlinehelptime;
194  // int smallguiiconopenaftermove;
195 
197  // int showUnitOwner;
198 
200 
202 
205 
206  vector<ASCString> visibleMapLayer;
207 
210 
211  struct PanelData {
212  int x;
213  int y;
214  bool visible;
215  };
216 
217  typedef map<ASCString, PanelData> PanelDataContainer;
219 
220  bool getPanelData( const ASCString& name, PanelData& data );
221  void updatePanelData( const ASCString& name, PanelData data );
222 
224 
225  struct {
227  int port;
229  } pbemServer;
230 
232 
234 
240 
241  struct {
244  int quality;
245  } video;
246 
247  static const int maxSearchPathNum;
250 
251  typedef map<ASCString,int> DialogAnswers;
253 
255 
258 
260 
261  private:
262  bool _changed;
263 };
264 
265 inline
267 {
268  return _changed;
269 }
270 
271 inline
272 void CGameOptions::setChanged(bool flag )
273 {
274  _changed = flag;
275 }
276 
277 
278 #endif //#ifndef GAMEOPTIONS_H
int aircraftCrashWarningTime
the number of turns after which a unit will crash until the player is warned
Definition: gameoptions.h:209
int movespeed
1/100 sec for a unit to move from one field to the next
Definition: gameoptions.h:63
ASCString searchPath[30]
Definition: gameoptions.h:249
bool forceWindowedMode
force ASC to run in windowed mode (and not fullscreen, which is default)
Definition: gameoptions.h:93
void addSearchPath(const ASCString &path)
int centerbutton
the button to select a field and open the menu there
Definition: gameoptions.h:146
bool units_gray_after_move
are units that cannot move but shoot displayed in gray ?
Definition: gameoptions.h:72
void setDefaultDirectories()
Password getDefaultSupervisorPassword()
bool recordCampaignMaps
Definition: gameoptions.h:204
ASCString defaultPassword
Definition: gameoptions.h:236
int mapeditor_xresolution
the horizontal resolution the mapeditor uses
Definition: gameoptions.h:114
A class for holding, encoding and comparing passwords.
map< ASCString, PanelData > PanelDataContainer
Definition: gameoptions.h:217
int fieldmarkbutton
the button to select a field without opening the menu
Definition: gameoptions.h:130
void load(const ASCString &filename)
Definition: gameoptions.cpp:71
bool fillResources
Definition: gameoptions.h:186
static const int maxSearchPathNum
Definition: gameoptions.h:247
Functions to evaluate the parsed *.asctxt files.
bool muteMusic
muted soud can be reactivated during the game
Definition: gameoptions.h:174
bool hardwareSurface
use screen buffer on the graphics card instead of main memory
Definition: gameoptions.h:96
int yresolution
the vertical resolution ASC uses
Definition: gameoptions.h:111
void runTextIO(PropertyContainer &pc)
Definition: gameoptions.cpp:92
bool endturnquestion
question "do you want to end your turn"
Definition: gameoptions.h:69
void updatePanelData(const ASCString &name, PanelData data)
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
bool fastmove
the number of steps to perform a move: 0 -> 3 step; != 0 -> 2 steps
Definition: gameoptions.h:60
bool debugReplay
enables the option to review your own replay to find replay bugs
Definition: gameoptions.h:102
PanelDataContainer panelData
Definition: gameoptions.h:218
bool saveEventMessagesExternal
will save all Immediate Game Event messages into a seperate file for doing translations ...
Definition: gameoptions.h:257
bool autoproduceammunition
produce required ammo upon refuelling
Definition: gameoptions.h:191
int mapzoomeditor
the zoom of the map display in the map editor
Definition: gameoptions.h:78
ASCString defaultSuperVisorPassword
Definition: gameoptions.h:237
bool automaticTraining
are units automatically trained in training centers
Definition: gameoptions.h:122
int ascframeratelimit
Definition: gameoptions.h:243
bool mapeditWindowedMode
force the mapeditor to run in fullscreen mode (and not windowed, which is default) ...
Definition: gameoptions.h:105
struct CGameOptions::@9 unitProduction
ASCString BI3directory
Definition: gameoptions.h:223
bool getPanelData(const ASCString &name, PanelData &data)
void setChanged(bool flag=true)
Definition: gameoptions.h:272
bool replayMovieMode
Definition: gameoptions.h:203
map< ASCString, int > DialogAnswers
Definition: gameoptions.h:251
Password getDefaultPassword()
ASCString hostname
Definition: gameoptions.h:226
int dragndropbutton
used in the container dialog
Definition: gameoptions.h:149
bool hideMouseOnScreenUpdates
hides the mouse cursor when screen updates are performed
Definition: gameoptions.h:99
struct CGameOptions::SoundSettings sound
the mouse configuration. Mouse button are: bit 0 = left button ; bit 1 = right button ; bit 2 = cente...
Definition: gameoptions.h:125
DialogAnswers dialogAnswers
Definition: gameoptions.h:252
bool muteEffects
muted soud can be reactivated during the game
Definition: gameoptions.h:171
int getSearchPathNum()
int attackspeed1
are fields marked that a unit could move to if there was no other unit standing
Definition: gameoptions.h:84
bool isChanged()
Definition: gameoptions.h:266
int mapeditor_yresolution
the vertical resolution the mapeditor uses
Definition: gameoptions.h:117
bool singleClickAction
marks a field and opens the small gui buttons with a single click (default: first click mark...
Definition: gameoptions.h:161
static CGameOptions * Instance()
returns the only Instance
Definition: gameoptions.cpp:38
struct CGameOptions::@10 pbemServer
struct CGameOptions::Mouse mouse
ASCString username
Definition: gameoptions.h:228
bool maped_modalSelectionWindow
Definition: gameoptions.h:119
int mapzoom
the zoom of the map display in ASC
Definition: gameoptions.h:75
int attackspeed3
second delay in attack display
Definition: gameoptions.h:90
ASCString graphicsDriver
Definition: gameoptions.h:233
void setSearchPath(int i, const ASCString &path)
static ASCString getButtonName(int button)
void setDefaults()
ASCString getSearchPath(int i)
struct CGameOptions::@11 video
bool logKillsToConsole
Definition: gameoptions.h:259
int attackspeed2
speed of moving bars in attack display
Definition: gameoptions.h:87
int zoomoutbutton
the button to display the vehicle information
Definition: gameoptions.h:157
ASCString languageOverride
Definition: gameoptions.h:254
bool off
if the sound is off, it can only be reactivated by restarting asc, but doesn't lock the sound device ...
Definition: gameoptions.h:177
int replayMoveSpeedFactor
how much faster are unit going to move in replays (percent)
Definition: gameoptions.h:66
ASCString mailProgram
Definition: gameoptions.h:231
void save(const ASCString &filename)
Definition: gameoptions.cpp:83
ASCString startupMap
Definition: gameoptions.h:235
Functions to parse the *.asctxt files.
int xresolution
the horizontal resolution ASC uses
Definition: gameoptions.h:108
vector< ASCString > visibleMapLayer
Definition: gameoptions.h:206
bool cacheASCGUI
Definition: gameoptions.h:201