00001 // 00002 // C++ Interface: gamedialog 00003 // 00004 // Description: 00005 // 00006 // 00007 // Author: Kevin Hirschmann <hirsch@dhcppc0>, (C) 2005 00008 // 00009 // Copyright: See COPYING file that comes with this distribution 00010 // 00011 // 00012 #ifndef GAMEDIALOG_H 00013 #define GAMEDIALOG_H 00014 00015 #include "gameoptions.h" 00016 #include "paradialog.h" 00017 #include "pgmultilineedit.h" 00018 #include "gamemap.h" 00022 class GameDialog: public ASC_PG_Dialog{ 00023 public: 00024 00025 ~GameDialog(); 00026 00027 static bool gameDialog(); 00028 protected: 00029 bool handleEventKeyDown (const SDL_KeyboardEvent *key); 00030 private: 00031 static const int xSize; 00032 static const int ySize; 00033 static const int buttonIndent; 00034 static GameDialog* instance; 00035 PG_Button* singlePlayerButton; 00036 PG_Button* multiPlayerButton; 00037 PG_Button* loadGameButton; 00038 PG_Button* saveGameButton; 00039 PG_Button* optionsButton; 00040 PG_Button* exitButton; 00041 PG_Button* continueButton; 00042 00043 GameDialog(); 00044 00045 bool closeWindow(); 00046 bool newGame(PG_Button* button); 00047 bool singleGame(PG_Button* button); 00048 bool multiGame(PG_Button* button); 00049 bool saveGame(PG_Button* button); 00050 bool loadGame(PG_Button* button); 00051 bool showOptions(PG_Button* button); 00052 bool exitGame(PG_Button* button); 00053 bool supervise(PG_Button* button); 00054 00055 00056 }; 00057 00058 00059 00060 class SinglePlayerDialog: public ASC_PG_Dialog{ 00061 public: 00062 static void singlePlayerDialog(PG_MessageObject* caller); 00063 00064 ~SinglePlayerDialog(); 00065 private: 00066 static const int xSize; 00067 static const int ySize; 00068 static const int buttonIndent; 00069 static SinglePlayerDialog* instance; 00070 00071 PG_Button* campaignButton; 00072 PG_Button* singleLevelButton; 00073 PG_Button* cancelButton; 00074 00075 SinglePlayerDialog(PG_MessageObject* parent); 00076 00077 bool campaign(PG_Button* button); 00078 bool singleLevel(PG_Button* button); 00079 bool closeWindow(); 00080 }; 00081 00082 00083 00084 class MultiPlayerDialog: public ASC_PG_Dialog{ 00085 public: 00086 static void multiPlayerDialog(PG_MessageObject* c); 00087 ~MultiPlayerDialog(); 00088 private: 00089 static const int xSize; 00090 static const int ySize; 00091 static const int buttonIndent; 00092 00093 PG_Button* continueGameButton; 00094 PG_Button* superViseButton; 00095 PG_Button* setupNWButton; 00096 PG_Button* changeMapPasswordButton; 00097 PG_Button* cancelButton; 00098 00099 MultiPlayerDialog(PG_MessageObject* c); 00100 00101 bool continueGame(PG_Button* button); 00102 bool superVise(PG_Button* button); 00103 bool setupNWGame(PG_Button* button); 00104 bool changeMapPassword(PG_Button* button); 00105 bool closeWindow(); 00106 }; 00107 00108 00109 00110 class ConfirmExitDialog: public ASC_PG_Dialog{ 00111 public: 00112 static void confirmExitDialog(PG_MessageObject* c); 00113 00114 00115 ~ConfirmExitDialog(); 00116 private: 00117 static const int xSize; 00118 static const int ySize; 00119 00120 PG_Button* okButton; 00121 PG_Button* cancelButton; 00122 00123 ConfirmExitDialog(PG_MessageObject* c); 00124 00125 bool exitGame(PG_Button* button); 00126 bool closeWindow(); 00127 }; 00128 00129 00130 00131 class OptionsDialog: public ASC_PG_Dialog{ 00132 public: 00133 00134 static void optionsDialog(PG_MessageObject* c); 00135 00136 ~OptionsDialog(); 00137 private: 00138 static const int xSize; 00139 static const int ySize; 00140 static const int buttonIndent; 00141 00142 PG_Button* okButton; 00143 PG_Button* soundButton; 00144 PG_Button* mouseButton; 00145 PG_Button* otherButton; 00146 PG_Button* displayButton; 00147 00148 OptionsDialog(PG_MessageObject* c); 00149 00150 bool showSoundOptions(PG_Button* button); 00151 bool showOtherOptions(PG_Button* button); 00152 bool closeWindow(); 00153 }; 00154 00155 00156 00157 00158 class GameOptionsDialog: public ASC_PG_Dialog{ 00159 public: 00160 static void gameOptionsDialog(PG_MessageObject* c); 00161 ~GameOptionsDialog(); 00162 private: 00163 static const int xSize; 00164 static const int ySize; 00165 static const int buttonIndent; 00166 00167 PG_Label* autoAmmunitionLabel; 00168 PG_CheckButton* autoAmmunitionCButton; 00169 00170 PG_Label* autoUnitTrainingLabel; 00171 PG_CheckButton* autoUnitTrainingCButton; 00172 00173 PG_Label* promptEndOfTurnLabel; 00174 PG_CheckButton* promptEndOfTurnCButton; 00175 00176 PG_Button* okButton; 00177 PG_Button* cancelButton; 00178 00179 PG_Button* changePasswordButton; 00180 00181 GameOptionsDialog(PG_MessageObject* c); 00182 00183 bool changePassword(PG_Button* button); 00184 00185 bool ok(PG_Button* button); 00186 bool closeWindow(); 00187 }; 00188 00189 class ChangePasswordDialog: public ASC_PG_Dialog{ 00190 public: 00191 virtual ~ChangePasswordDialog(); 00192 00193 protected: 00194 PG_LineEdit* passwordValue; 00195 00196 ChangePasswordDialog(PG_MessageObject* c); 00197 private: 00198 static const int xSize; 00199 static const int ySize; 00200 static const int buttonIndent; 00201 00202 PG_Button* okButton; 00203 PG_Button* cancelButton; 00204 PG_Label* passwordLabel; 00205 00206 virtual bool ok(PG_Button* button) = 0; 00207 00208 00209 }; 00210 /* 00211 class MousePreferencesDialog: public ASC_PG_Dialog{ 00212 public: 00213 static void mousePreferencesDialog(PG_MessageObject* c); 00214 virtual ~MousePreferencesDialog(); 00215 private: 00216 static const int xSize; 00217 static const int ySize; 00218 00219 MousePreferencesDialog(PG_MessageObject* c); 00220 bool ok(PG_Button* button); 00221 }; 00222 */ 00223 00224 class ChangeDefaultPasswordDialog: public ChangePasswordDialog{ 00225 public: 00226 static void changeDefaultPasswordDialog(PG_MessageObject* c); 00227 virtual ~ChangeDefaultPasswordDialog(); 00228 private: 00229 ChangeDefaultPasswordDialog(PG_MessageObject* c); 00230 bool ok(PG_Button* button); 00231 }; 00232 00233 class ChangeMapPasswordDialog: public ChangePasswordDialog{ 00234 public: 00235 static void changeMapPasswordDialog(PG_MessageObject* c); 00236 virtual ~ChangeMapPasswordDialog(); 00237 private: 00238 ChangeMapPasswordDialog(PG_MessageObject* c); 00239 bool ok(PG_Button* button); 00240 }; 00241 00242 00243 class SaveGameBaseDialog: public ASC_PG_Dialog{ 00244 public: 00245 00246 virtual ~SaveGameBaseDialog(); 00247 00248 protected: 00249 PG_LineEdit* fileNameValue; 00250 PG_ScrollBar* slider; 00251 PG_ListBox* fileList; 00252 00253 SaveGameBaseDialog(const ASCString& title, PG_MessageObject* c); 00254 00255 private: 00256 static const int xSize; 00257 static const int ySize; 00258 static const int buttonIndent; 00259 00260 PG_RadioButton* sortNameButton; 00261 PG_RadioButton* sortDateButton; 00262 00263 PG_Label* fileNameLabel; 00264 00265 PG_Button* okButton; 00266 PG_Button* cancelButton; 00267 00268 virtual bool ok(PG_Button* button) = 0; 00269 virtual bool handleSlider(long data); 00270 virtual bool closeWindow(); 00271 }; 00272 00273 class SaveGameDialog: public SaveGameBaseDialog{ 00274 public: 00275 static void saveGameDialog(PG_MessageObject* caller); 00276 00277 virtual ~SaveGameDialog(); 00278 private: 00279 SaveGameDialog(PG_MessageObject* caller); 00280 00281 bool ok(PG_Button* button); 00282 }; 00283 00284 #if 0 00285 00286 class LoadGameDialog: public SaveGameBaseDialog{ 00287 public: 00288 00289 static void loadGameDialog(PG_MessageObject* caller); 00290 00291 virtual ~LoadGameDialog(); 00292 private: 00293 LoadGameDialog(PG_MessageObject* caller); 00294 00295 bool ok(PG_Button* button); 00296 }; 00297 #endif 00298 00299 00300 #endif 00301
1.4.2