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 int replayMoveSpeedFactor; 00067 00069 bool endturnquestion; 00070 00072 bool units_gray_after_move; 00073 00075 int mapzoom; 00076 00078 int mapzoomeditor; 00079 00081 // int dontMarkFieldsNotAccessible_movement; 00082 00084 int attackspeed1; 00085 00087 int attackspeed2; 00088 00090 int attackspeed3; 00091 00093 bool forceWindowedMode; 00094 00096 bool hardwareSurface; 00097 00099 bool hideMouseOnScreenUpdates; 00100 00102 bool debugReplay; 00103 00105 bool mapeditWindowedMode; 00106 00108 int xresolution; 00109 00111 int yresolution; 00112 00114 int mapeditor_xresolution; 00115 00117 int mapeditor_yresolution; 00118 00119 bool maped_modalSelectionWindow; 00120 00122 bool automaticTraining; 00123 00125 struct Mouse 00126 { 00127 // int scrollbutton; 00128 00130 int fieldmarkbutton; 00131 00133 // int smallguibutton; 00134 00136 // int largeguibutton; 00137 00143 // int smalliconundermouse; 00144 00146 int centerbutton; 00147 00149 int dragndropbutton; 00150 00152 // int unitweaponinfo; 00153 00155 // int singleClickAction; 00156 00157 int zoomoutbutton; 00158 int zoominbutton; 00159 00161 bool singleClickAction; 00162 00163 static ASCString getButtonName( int button ); 00164 } 00165 mouse; 00166 00167 00168 struct SoundSettings 00169 { 00171 bool muteEffects; 00172 00174 bool muteMusic; 00175 00177 bool off; 00178 00179 int soundVolume; 00180 00181 int musicVolume; 00182 } 00183 sound; 00184 00185 struct { 00186 bool fillResources; 00187 bool fillAmmo; 00188 } unitProduction; 00189 00191 bool autoproduceammunition; 00192 00193 // int onlinehelptime; 00194 // int smallguiiconopenaftermove; 00195 00196 int replayspeed; 00197 // int showUnitOwner; 00198 00199 int panelColumns; 00200 00201 bool cacheASCGUI; 00202 00203 bool replayMovieMode; 00204 bool recordCampaignMaps; 00205 00206 vector<ASCString> visibleMapLayer; 00207 00209 int aircraftCrashWarningTime; 00210 00211 struct PanelData { 00212 int x; 00213 int y; 00214 bool visible; 00215 }; 00216 00217 typedef map<ASCString, PanelData> PanelDataContainer; 00218 PanelDataContainer panelData; 00219 00220 bool getPanelData( const ASCString& name, PanelData& data ); 00221 void updatePanelData( const ASCString& name, PanelData data ); 00222 00223 ASCString BI3directory; 00224 00225 struct { 00226 ASCString hostname; 00227 int port; 00228 ASCString username; 00229 } pbemServer; 00230 00231 ASCString mailProgram; 00232 00233 ASCString graphicsDriver; 00234 00235 ASCString startupMap; 00236 ASCString defaultPassword; 00237 ASCString defaultSuperVisorPassword; 00238 Password getDefaultPassword ( ); 00239 Password getDefaultSupervisorPassword ( ); 00240 00241 struct { 00242 int framerate; 00243 int ascframeratelimit; 00244 int quality; 00245 } video; 00246 00247 static const int maxSearchPathNum; 00248 int searchPathNum; 00249 ASCString searchPath[30]; 00250 00251 typedef map<ASCString,int> DialogAnswers; 00252 DialogAnswers dialogAnswers; 00253 00254 ASCString languageOverride; 00255 00257 bool saveEventMessagesExternal; 00258 00259 bool logKillsToConsole; 00260 00261 private: 00262 bool _changed; 00263 }; 00264 00265 inline 00266 bool CGameOptions::isChanged() 00267 { 00268 return _changed; 00269 } 00270 00271 inline 00272 void CGameOptions::setChanged(bool flag ) 00273 { 00274 _changed = flag; 00275 } 00276 00277 00278 #endif //#ifndef GAMEOPTIONS_H
1.5.1