00001 /*************************************************************************** 00002 gameoptions.h - description 00003 ------------------- 00004 begin : Thu Jun 29 2000 00005 copyright : (C) 2000 by frank landgraf 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 #ifndef GAMEOPTIONS_H 00018 #define GAMEOPTIONS_H 00019 00020 #include <string> 00021 #include "password.h" 00022 00023 #include "textfileparser.h" 00024 #include "textfile_evaluation.h" 00025 00026 00027 class CGameOptions 00028 { 00029 public: 00031 static CGameOptions* Instance(); 00032 00033 CGameOptions(); 00034 void setDefaults(); 00035 void setDefaultDirectories(); 00036 /* CGameOptions( const CGameOptions& cgo ); 00037 00038 void copy ( const CGameOptions& cgo ); 00039 */ 00040 00041 void runTextIO ( PropertyContainer& pc ); 00042 00043 00044 bool isChanged(); 00045 void setChanged(bool flag = true); 00046 00047 void load( const ASCString& filename ); 00048 void save( const ASCString& filename ); 00049 00050 00051 int getSearchPathNum(); 00052 00053 void setSearchPath ( int i, const ASCString& path ); 00054 void addSearchPath ( const ASCString& path ); 00055 ASCString getSearchPath( int i); 00056 00057 int version; 00058 00060 bool fastmove; 00061 00063 int movespeed; 00064 00066 bool endturnquestion; 00067 00069 bool units_gray_after_move; 00070 00072 int mapzoom; 00073 00075 int mapzoomeditor; 00076 00078 // int dontMarkFieldsNotAccessible_movement; 00079 00081 int attackspeed1; 00082 00084 int attackspeed2; 00085 00087 int attackspeed3; 00088 00090 bool forceWindowedMode; 00091 00093 bool hardwareSurface; 00094 00096 bool hideMouseOnScreenUpdates; 00097 00099 bool debugReplay; 00100 00102 bool mapeditWindowedMode; 00103 00105 int xresolution; 00106 00108 int yresolution; 00109 00111 int mapeditor_xresolution; 00112 00114 int mapeditor_yresolution; 00115 00116 bool maped_modalSelectionWindow; 00117 00119 bool automaticTraining; 00120 00122 struct Mouse 00123 { 00124 // int scrollbutton; 00125 00127 int fieldmarkbutton; 00128 00130 // int smallguibutton; 00131 00133 // int largeguibutton; 00134 00140 // int smalliconundermouse; 00141 00143 int centerbutton; 00144 00146 int dragndropbutton; 00147 00149 // int unitweaponinfo; 00150 00152 // int singleClickAction; 00153 00154 int zoomoutbutton; 00155 int zoominbutton; 00156 00158 bool singleClickAction; 00159 00160 static ASCString getButtonName( int button ); 00161 } 00162 mouse; 00163 00164 00165 struct SoundSettings 00166 { 00168 bool muteEffects; 00169 00171 bool muteMusic; 00172 00174 bool off; 00175 00176 int soundVolume; 00177 00178 int musicVolume; 00179 } 00180 sound; 00181 00182 struct { 00183 bool fillResources; 00184 bool fillAmmo; 00185 } unitProduction; 00186 00188 bool autoproduceammunition; 00189 00190 // int onlinehelptime; 00191 // int smallguiiconopenaftermove; 00192 00193 int replayspeed; 00194 // int showUnitOwner; 00195 00196 int panelColumns; 00197 00198 bool cacheASCGUI; 00199 00200 bool replayMovieMode; 00201 00202 vector<ASCString> visibleMapLayer; 00203 00204 00205 struct PanelData { 00206 int x; 00207 int y; 00208 bool visible; 00209 }; 00210 00211 typedef map<ASCString, PanelData> PanelDataContainer; 00212 PanelDataContainer panelData; 00213 00214 bool getPanelData( const ASCString& name, PanelData& data ); 00215 void updatePanelData( const ASCString& name, PanelData data ); 00216 00217 ASCString BI3directory; 00218 00219 struct { 00220 ASCString hostname; 00221 int port; 00222 ASCString username; 00223 } pbemServer; 00224 00225 ASCString mailProgram; 00226 00227 ASCString graphicsDriver; 00228 00229 ASCString startupMap; 00230 ASCString defaultPassword; 00231 ASCString defaultSuperVisorPassword; 00232 Password getDefaultPassword ( ); 00233 Password getDefaultSupervisorPassword ( ); 00234 00235 struct { 00236 int framerate; 00237 int quality; 00238 } video; 00239 00240 static const int maxSearchPathNum; 00241 int searchPathNum; 00242 ASCString searchPath[30]; 00243 00244 private: 00245 bool _changed; 00246 }; 00247 00248 inline 00249 bool CGameOptions::isChanged() 00250 { 00251 return _changed; 00252 } 00253 00254 inline 00255 void CGameOptions::setChanged(bool flag ) 00256 { 00257 _changed = flag; 00258 } 00259 00260 00261 #endif //#ifndef GAMEOPTIONS_H
1.4.2