File: gameoptions.h

package info (click to toggle)
asc 2.1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 59,052 kB
  • ctags: 25,676
  • sloc: cpp: 145,189; sh: 8,705; ansic: 5,564; makefile: 551; perl: 150
file content (259 lines) | stat: -rw-r--r-- 7,217 bytes parent folder | download
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
/***************************************************************************
                          gameoptions.h  -  description
                             -------------------
    begin                : Thu Jun 29 2000
    copyright            : (C) 2000 by frank landgraf
    email                : 
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef GAMEOPTIONS_H
#define GAMEOPTIONS_H

#include <string>
#include "password.h"

#include "textfileparser.h"
#include "textfile_evaluation.h"


class CGameOptions
{
   public:
      /** returns the only Instance */
      static CGameOptions* Instance();

      CGameOptions();
      void setDefaults();
      void setDefaultDirectories();
/*      CGameOptions( const CGameOptions& cgo );

      void copy ( const CGameOptions& cgo );
      */

      void runTextIO ( PropertyContainer& pc );
      
      
      bool isChanged();
      void setChanged(bool flag = true);
      
      void load( const ASCString& filename );
      void save( const ASCString& filename );
      

      int getSearchPathNum();

      void setSearchPath ( int i, const ASCString& path );
      void addSearchPath ( const ASCString& path );
      ASCString getSearchPath( int i);

      int version;

      //! the number of steps to perform a move: 0 -> 3 step; != 0 -> 2 steps
      bool fastmove;

      //! 1/100 sec for a unit to move from one field to the next
      int movespeed;

      //! question "do you want to end your turn"
      bool endturnquestion;

      //! are units that cannot move but shoot displayed in gray ?
      bool  units_gray_after_move;

      //! the zoom of the map display in ASC
      int mapzoom;

      //! the zoom of the map display in the map editor
      int mapzoomeditor;

      //! are fields marked that a unit could move to if there was no other unit standing
      // int dontMarkFieldsNotAccessible_movement;

      //! first delay of attack display
      int attackspeed1;

      //! speed of moving bars in attack display
      int attackspeed2;

      //! second delay in attack display
      int attackspeed3;

      //! force ASC to run in windowed mode (and not fullscreen, which is default)
      bool forceWindowedMode;

      //! use screen buffer on the graphics card instead of main memory
      bool hardwareSurface;

      //! hides the mouse cursor when screen updates are performed
      bool hideMouseOnScreenUpdates;

      //! enables the option to review your own replay to find replay bugs
      bool debugReplay;

      //! force the mapeditor to run in fullscreen mode (and not windowed, which is default)
      bool mapeditWindowedMode;

      //! the horizontal resolution ASC uses
      int xresolution;

      //! the vertical resolution ASC uses
      int yresolution;

      //! the horizontal resolution the mapeditor uses
      int mapeditor_xresolution;

      //! the vertical resolution the mapeditor uses
      int mapeditor_yresolution;

      bool maped_modalSelectionWindow;
      
      //! are units automatically trained in training centers
      bool automaticTraining;

      //! the mouse configuration. Mouse button are: bit 0 = left button ; bit 1 = right button ; bit 2 = center button
      struct Mouse
      {
         // int scrollbutton;
         
         //! the button to select a field without opening the menu
         int fieldmarkbutton;
         
         //! the button to select a field and open the menu there
         // int smallguibutton;

         //! the button to use the big icons on the right side
         // int largeguibutton;

         /** specifies the occasions when the small icons are positioned directly under the mouse pointer (instead of some pixel upwards)
             0 = never
             1 = always
             2 = only if there is a building or a unit on the field or if the field is a destination for the current unit action (default)
         */
         // int smalliconundermouse;

         //! the button to center the map around the selected field
         int centerbutton;
         
         //! used in the container dialog
         int dragndropbutton;

         //! the button to display the vehicle information
         // int unitweaponinfo;

         //! if != 0, a single click will mark a field AND open the small gui menu
         // int singleClickAction;

         int zoomoutbutton;
         int zoominbutton;

         //! marks a field and opens the small gui buttons with a single click (default: first click mark, second click: execute)
         bool singleClickAction;

         static ASCString getButtonName( int button );
      }
      mouse;


      struct SoundSettings
      {
         //! muted soud can be reactivated during the game
         bool muteEffects;

         //! muted soud can be reactivated during the game
         bool muteMusic;

         //! if the sound is off, it can only be reactivated by restarting asc, but doesn't lock the sound device
         bool off;

         int soundVolume;

         int musicVolume;
      }
      sound;

      struct {
         bool fillResources;
         bool fillAmmo;
      } unitProduction;

      //! produce required ammo upon refuelling
      bool autoproduceammunition;

      // int onlinehelptime;
      // int smallguiiconopenaftermove;

      int replayspeed;
      // int showUnitOwner;

      int panelColumns;

      bool cacheASCGUI;

      bool replayMovieMode;

      vector<ASCString> visibleMapLayer;


      struct PanelData {
         int x;
         int y;
         bool visible;
      };

      typedef map<ASCString, PanelData> PanelDataContainer;
      PanelDataContainer panelData;

      bool getPanelData( const ASCString& name, PanelData& data );
      void updatePanelData( const ASCString& name, PanelData data );
      
      ASCString BI3directory;

      struct {
         ASCString hostname;
         int port;
         ASCString username;
      } pbemServer;

      ASCString graphicsDriver;

      ASCString startupMap;
      ASCString defaultPassword;
      ASCString defaultSuperVisorPassword;
      Password getDefaultPassword ( );
      Password getDefaultSupervisorPassword ( );

      struct {
         int framerate;
         int quality;
      } video;

      static const int maxSearchPathNum;
      int searchPathNum;
      ASCString searchPath[30];

   private:
      bool _changed;
};

inline
bool CGameOptions::isChanged()
{
   return _changed;
}

inline
void CGameOptions::setChanged(bool flag )
{
   _changed = flag;
}


#endif //#ifndef GAMEOPTIONS_H