File: gamedialog.h

package info (click to toggle)
asc 2.6.1.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 81,740 kB
  • sloc: cpp: 158,704; sh: 11,544; ansic: 6,736; makefile: 604; perl: 138
file content (301 lines) | stat: -rw-r--r-- 6,420 bytes parent folder | download | duplicates (7)
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
//
// C++ Interface: gamedialog
//
// Description: 
//
//
// Author: Kevin Hirschmann <hirsch@dhcppc0>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef GAMEDIALOG_H
#define GAMEDIALOG_H

#include "gameoptions.h"
#include "paradialog.h"
#include "pgmultilineedit.h"
#include "gamemap.h"
/**
@author Kevin Hirschmann
*/
class GameDialog: public ASC_PG_Dialog{
public:    

    ~GameDialog();
    
    static bool gameDialog();    
protected:
  bool eventKeyDown (const SDL_KeyboardEvent *key);
private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;
  static GameDialog* instance;
  PG_Button* singlePlayerButton;
  PG_Button* multiPlayerButton;
  PG_Button* loadGameButton;
  PG_Button* saveGameButton;
  PG_Button* optionsButton;
  PG_Button* exitButton;
  PG_Button* continueButton;
  
  GameDialog();
  
  bool closeWindow();
  bool newGame(PG_Button* button);
  bool singleGame(PG_Button* button);
  bool multiGame(PG_Button* button);
  bool saveGame(PG_Button* button);
  bool loadGame(PG_Button* button);
  bool showOptions(PG_Button* button);
  bool exitGame(PG_Button* button);
  bool supervise(PG_Button* button);
 
  
};



class SinglePlayerDialog: public ASC_PG_Dialog{
public:  
  static void singlePlayerDialog(PG_MessageObject* caller);
    
  ~SinglePlayerDialog();
private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;
  static SinglePlayerDialog* instance;
  
  PG_Button* campaignButton;
  PG_Button* singleLevelButton;
  PG_Button* cancelButton;
  
  SinglePlayerDialog(PG_MessageObject* parent);
  
  bool campaign(PG_Button* button);
  bool singleLevel(PG_Button* button);
  bool closeWindow();
};



class MultiPlayerDialog: public ASC_PG_Dialog{
public:    
  static void multiPlayerDialog(PG_MessageObject* c);  
  ~MultiPlayerDialog();
private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;
  
  PG_Button* continueGameButton;
  PG_Button* superViseButton;
  PG_Button* setupNWButton;
  PG_Button* changeMapPasswordButton;
  PG_Button* cancelButton;
  
  MultiPlayerDialog(PG_MessageObject* c);
  
  bool continueGame(PG_Button* button);
  bool superVise(PG_Button* button);
  bool setupNWGame(PG_Button* button);
  bool changeMapPassword(PG_Button* button);
  bool closeWindow();
};



class ConfirmExitDialog: public ASC_PG_Dialog{
public:  
  static void confirmExitDialog(PG_MessageObject* c);
  
  
  ~ConfirmExitDialog();
private:
  static const int xSize;
  static const int ySize;
  
  PG_Button* okButton;
  PG_Button* cancelButton;
  
  ConfirmExitDialog(PG_MessageObject* c);
  
  bool exitGame(PG_Button* button);
  bool closeWindow();
};



class OptionsDialog: public ASC_PG_Dialog{
public:  
  
  static void optionsDialog(PG_MessageObject* c);
    
  ~OptionsDialog();
private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;
  
  PG_Button* okButton;
  PG_Button* soundButton;
  PG_Button* mouseButton;
  PG_Button* otherButton;
  PG_Button* displayButton;
  
  OptionsDialog(PG_MessageObject* c);
  
  bool showSoundOptions(PG_Button* button);
  bool showOtherOptions(PG_Button* button);
  bool closeWindow();
};




class GameOptionsDialog: public ASC_PG_Dialog{
public:    
   static void gameOptionsDialog(PG_MessageObject* c);  
  ~GameOptionsDialog();
private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;    
  
  PG_Label* autoAmmunitionLabel;
  PG_CheckButton* autoAmmunitionCButton;
  
  PG_Label* autoUnitTrainingLabel;
  PG_CheckButton* autoUnitTrainingCButton;    
  
  PG_Label* promptEndOfTurnLabel;
  PG_CheckButton* promptEndOfTurnCButton;
  
  PG_Button* okButton;
  PG_Button* cancelButton;
  
  PG_Button* changePasswordButton;
  
  GameOptionsDialog(PG_MessageObject* c);
  
  bool changePassword(PG_Button* button);
  
  bool ok(PG_Button* button);
  bool closeWindow();
};

class ChangePasswordDialog: public ASC_PG_Dialog{
  public:    
    virtual ~ChangePasswordDialog();
    
    protected:
    PG_LineEdit* passwordValue;
	
    ChangePasswordDialog(PG_MessageObject* c);
  private:  
    static const int xSize;
    static const int ySize;
    static const int buttonIndent;
    
    PG_Button* okButton;
    PG_Button* cancelButton;
    PG_Label* passwordLabel;
    
    virtual bool ok(PG_Button* button) = 0;


};
/*
class MousePreferencesDialog: public ASC_PG_Dialog{
  public:
   static void mousePreferencesDialog(PG_MessageObject* c);
   virtual ~MousePreferencesDialog();
private:
   static const int xSize;
   static const int ySize;
    
   MousePreferencesDialog(PG_MessageObject* c);
   bool ok(PG_Button* button);
};
*/

class ChangeDefaultPasswordDialog: public ChangePasswordDialog{
public:
   static void changeDefaultPasswordDialog(PG_MessageObject* c);
   virtual ~ChangeDefaultPasswordDialog();
private:
   ChangeDefaultPasswordDialog(PG_MessageObject* c);
   bool ok(PG_Button* button);
};

class ChangeMapPasswordDialog: public ChangePasswordDialog{
public:
   static void changeMapPasswordDialog(PG_MessageObject* c);
   virtual ~ChangeMapPasswordDialog();
private:
   ChangeMapPasswordDialog(PG_MessageObject* c);
   bool ok(PG_Button* button);
};


class SaveGameBaseDialog: public ASC_PG_Dialog{
public:  
  
  virtual ~SaveGameBaseDialog();
  
protected:  
PG_LineEdit* fileNameValue;
PG_ScrollBar* slider;
PG_ListBox* fileList;

SaveGameBaseDialog(const ASCString& title, PG_MessageObject* c);

private:
  static const int xSize;
  static const int ySize;
  static const int buttonIndent;      
    
  PG_RadioButton* sortNameButton;
  PG_RadioButton* sortDateButton;
  
  PG_Label* fileNameLabel;
    
  PG_Button* okButton;
  PG_Button* cancelButton;
  
  virtual bool ok(PG_Button* button) = 0;
  virtual bool handleSlider(long data);
  virtual bool closeWindow();
};

class SaveGameDialog: public SaveGameBaseDialog{
public:  
  static void saveGameDialog(PG_MessageObject* caller);  
  
  virtual ~SaveGameDialog();
private:
  SaveGameDialog(PG_MessageObject* caller);
    
  bool ok(PG_Button* button);  
};

#if 0

class LoadGameDialog: public SaveGameBaseDialog{
public:  
  
  static void loadGameDialog(PG_MessageObject* caller);  
  
  virtual ~LoadGameDialog();
private:
  LoadGameDialog(PG_MessageObject* caller);  
    
  bool ok(PG_Button* button);  
};
#endif


#endif