author | unc0rr |
Sun, 30 Dec 2007 15:24:02 +0000 | |
changeset 688 | e4d1fb310a66 |
parent 686 | 494b5880989a |
child 692 | 07787e748831 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
2 |
* Hedgewars, a worms-like game |
|
486 | 3 |
* Copyright (c) 2006, 2007 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef PAGES_H |
|
20 |
#define PAGES_H |
|
21 |
||
22 |
#include <QWidget> |
|
684 | 23 |
#include <QPushButton> |
24 |
#include <QFont> |
|
25 |
#include <QGridLayout> |
|
184 | 26 |
|
27 |
#include "binds.h" |
|
322 | 28 |
#include "mapContainer.h" |
184 | 29 |
|
30 |
class QPushButton; |
|
31 |
class QGroupBox; |
|
32 |
class QComboBox; |
|
33 |
class QLabel; |
|
34 |
class QToolBox; |
|
35 |
class QLineEdit; |
|
665 | 36 |
class QListWidget; |
37 |
class QCheckBox; |
|
38 |
class QSpinBox; |
|
39 |
class QTextEdit; |
|
40 |
class QRadioButton; |
|
41 |
class QTableView; |
|
42 |
||
43 |
class GameCFGWidget; |
|
184 | 44 |
class TeamSelWidget; |
45 |
class DemosList; |
|
46 |
class SquareLabel; |
|
187 | 47 |
class About; |
297 | 48 |
class FPSEdit; |
461 | 49 |
class HWChatWidget; |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
600
diff
changeset
|
50 |
class SelWeaponWidget; |
184 | 51 |
|
684 | 52 |
class AbstractPage : public QWidget |
53 |
{ |
|
54 |
public: |
|
55 |
||
56 |
protected: |
|
57 |
AbstractPage(QWidget* parent = 0) { |
|
58 |
font14 = new QFont("MS Shell Dlg", 14); |
|
59 |
} |
|
60 |
virtual ~AbstractPage() {}; |
|
61 |
||
62 |
QPushButton* addButton(const char* btname, QGridLayout* grid, int wy, int wx) { |
|
63 |
QPushButton* butt = new QPushButton(this); |
|
64 |
butt->setFont(*font14); |
|
65 |
butt->setText(QPushButton::tr(btname)); |
|
66 |
grid->addWidget(butt, wy, wx); |
|
67 |
return butt; |
|
68 |
}; |
|
69 |
||
70 |
QPushButton* addButton(const char* btname, QBoxLayout* box, int where) { |
|
71 |
QPushButton* butt = new QPushButton(this); |
|
72 |
butt->setFont(*font14); |
|
73 |
butt->setText(QPushButton::tr(btname)); |
|
74 |
box->addWidget(butt, where); |
|
75 |
return butt; |
|
76 |
}; |
|
77 |
||
78 |
QFont * font14; |
|
79 |
}; |
|
80 |
||
81 |
class PageMain : public AbstractPage |
|
184 | 82 |
{ |
83 |
Q_OBJECT |
|
84 |
||
85 |
public: |
|
86 |
PageMain(QWidget* parent = 0); |
|
87 |
||
88 |
QPushButton *BtnSinglePlayer; |
|
89 |
QPushButton *BtnMultiplayer; |
|
90 |
QPushButton *BtnNet; |
|
91 |
QPushButton *BtnSetup; |
|
579 | 92 |
QPushButton *BtnLoad; |
184 | 93 |
QPushButton *BtnDemos; |
187 | 94 |
QPushButton *BtnInfo; |
184 | 95 |
QPushButton *BtnExit; |
96 |
}; |
|
97 |
||
684 | 98 |
class PageSimpleGame : public AbstractPage |
184 | 99 |
{ |
100 |
Q_OBJECT |
|
101 |
||
102 |
public: |
|
585
7531ae5b146e
Rename PageLocalGame -> PageSimpleGame due to future changes
unc0rr
parents:
579
diff
changeset
|
103 |
PageSimpleGame(QWidget* parent = 0); |
184 | 104 |
|
105 |
QPushButton *BtnSimpleGame; |
|
106 |
QPushButton *BtnBack; |
|
107 |
GameCFGWidget *gameCFG; |
|
108 |
}; |
|
109 |
||
110 |
class PageEditTeam : public QWidget |
|
111 |
{ |
|
112 |
Q_OBJECT |
|
113 |
||
114 |
public: |
|
115 |
PageEditTeam(QWidget* parent = 0); |
|
116 |
QGroupBox *GBoxHedgehogs; |
|
117 |
QGroupBox *GBoxTeam; |
|
118 |
QGroupBox *GBoxFort; |
|
119 |
QComboBox *CBFort; |
|
120 |
SquareLabel *FortPreview; |
|
121 |
QGroupBox *GBoxGrave; |
|
122 |
QComboBox *CBGrave; |
|
123 |
QLabel *GravePreview; |
|
336 | 124 |
QGroupBox *GBoxTeamLvl; |
125 |
QComboBox *CBTeamLvl; |
|
126 |
QLabel *LevelPict; |
|
184 | 127 |
QGroupBox *GBoxBinds; |
128 |
QToolBox *BindsBox; |
|
129 |
QWidget *page_A; |
|
130 |
QWidget *page_W; |
|
131 |
QWidget *page_WP; |
|
132 |
QWidget *page_O; |
|
133 |
QPushButton *BtnTeamDiscard; |
|
134 |
QPushButton *BtnTeamSave; |
|
135 |
QLineEdit * TeamNameEdit; |
|
136 |
QLineEdit * HHNameEdit[8]; |
|
137 |
QComboBox * CBBind[BINDS_NUMBER]; |
|
138 |
||
139 |
public slots: |
|
140 |
void CBGrave_activated(const QString & gravename); |
|
141 |
void CBFort_activated(const QString & gravename); |
|
336 | 142 |
void CBTeamLvl_activated(int id); |
184 | 143 |
|
144 |
private: |
|
145 |
QLabel * LBind[BINDS_NUMBER]; |
|
146 |
}; |
|
147 |
||
148 |
class PageMultiplayer : public QWidget |
|
149 |
{ |
|
150 |
Q_OBJECT |
|
151 |
||
152 |
public: |
|
153 |
PageMultiplayer(QWidget* parent = 0); |
|
154 |
||
155 |
QPushButton *BtnBack; |
|
156 |
GameCFGWidget *gameCFG; |
|
157 |
TeamSelWidget *teamsSelect; |
|
158 |
QPushButton *BtnStartMPGame; |
|
159 |
}; |
|
160 |
||
161 |
class PageOptions : public QWidget |
|
162 |
{ |
|
163 |
Q_OBJECT |
|
164 |
||
165 |
public: |
|
166 |
PageOptions(QWidget* parent = 0); |
|
167 |
||
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
587
diff
changeset
|
168 |
QPushButton* WeaponsButt; |
184 | 169 |
QPushButton *BtnBack; |
170 |
QGroupBox *groupBox; |
|
171 |
QPushButton *BtnNewTeam; |
|
172 |
QPushButton *BtnEditTeam; |
|
173 |
QComboBox *CBTeamName; |
|
174 |
QGroupBox *AGGroupBox; |
|
175 |
QComboBox *CBResolution; |
|
176 |
QCheckBox *CBEnableSound; |
|
177 |
QCheckBox *CBFullscreen; |
|
297 | 178 |
QCheckBox *CBShowFPS; |
529 | 179 |
QCheckBox *CBAltDamage; |
297 | 180 |
FPSEdit *fpsedit; |
184 | 181 |
QPushButton *BtnSaveOptions; |
647 | 182 |
QGroupBox *NNGroupBox; |
183 |
QLabel *labelNN; |
|
184 |
QLineEdit *editNetNick; |
|
184 | 185 |
}; |
186 |
||
187 |
class PageNet : public QWidget |
|
188 |
{ |
|
189 |
Q_OBJECT |
|
190 |
||
191 |
public: |
|
192 |
PageNet(QWidget* parent = 0); |
|
193 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
194 |
QPushButton* BtnUpdateSList; |
665 | 195 |
QTableView * tvServersList; |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
196 |
QPushButton * BtnBack; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
197 |
QPushButton * BtnNetConnect; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
198 |
QPushButton * BtnNetSvrStart; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
199 |
QPushButton * BtnSpecifyServer; |
636 | 200 |
QRadioButton * rbLocalGame; |
201 |
QRadioButton * rbInternetGame; |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
202 |
|
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
203 |
private: |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
204 |
QGroupBox * ConnGroupBox; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
205 |
QGridLayout * GBClayout; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
206 |
|
646 | 207 |
private slots: |
208 |
void slotConnect(); |
|
209 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
210 |
public slots: |
646 | 211 |
void updateServersList(); |
212 |
||
213 |
signals: |
|
665 | 214 |
void connectClicked(const QString & host, quint16 port); |
646 | 215 |
}; |
216 |
||
217 |
class PageNetServer : public QWidget |
|
218 |
{ |
|
219 |
Q_OBJECT |
|
220 |
||
221 |
public: |
|
222 |
PageNetServer(QWidget* parent = 0); |
|
223 |
||
224 |
QPushButton *BtnBack; |
|
225 |
QPushButton *BtnStart; |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
226 |
QPushButton *BtnDefault; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
227 |
QLabel *labelSD; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
228 |
QLineEdit *leServerDescr; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
229 |
QLabel *labelPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
230 |
QSpinBox *sbPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
231 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
232 |
private slots: |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
233 |
void setDefaultPort(); |
184 | 234 |
}; |
235 |
||
236 |
class PageNetGame : public QWidget |
|
237 |
{ |
|
238 |
Q_OBJECT |
|
239 |
||
240 |
public: |
|
241 |
PageNetGame(QWidget* parent = 0); |
|
242 |
||
243 |
QPushButton *BtnBack; |
|
244 |
QPushButton *BtnGo; |
|
461 | 245 |
|
246 |
HWChatWidget* pChatWidget; |
|
322 | 247 |
|
248 |
TeamSelWidget* pNetTeamsWidget; |
|
249 |
GameCFGWidget* pGameCFG; |
|
184 | 250 |
}; |
251 |
||
187 | 252 |
class PageInfo : public QWidget |
253 |
{ |
|
254 |
Q_OBJECT |
|
255 |
||
256 |
public: |
|
257 |
PageInfo(QWidget* parent = 0); |
|
258 |
||
259 |
QPushButton *BtnBack; |
|
260 |
About *about; |
|
261 |
}; |
|
262 |
||
306 | 263 |
class PageGameStats : public QWidget |
264 |
{ |
|
265 |
Q_OBJECT |
|
266 |
||
267 |
public: |
|
268 |
PageGameStats(QWidget* parent = 0); |
|
269 |
||
270 |
QPushButton *BtnBack; |
|
307 | 271 |
QLabel *labelGameStats; |
306 | 272 |
}; |
273 |
||
586 | 274 |
class PageSinglePlayer : public QWidget |
275 |
{ |
|
276 |
Q_OBJECT |
|
277 |
||
278 |
public: |
|
279 |
PageSinglePlayer(QWidget* parent = 0); |
|
280 |
||
281 |
QPushButton *BtnSimpleGamePage; |
|
282 |
QPushButton *BtnTrainPage; |
|
283 |
QPushButton *BtnBack; |
|
284 |
GameCFGWidget *gameCFG; |
|
285 |
}; |
|
286 |
||
587 | 287 |
class PageTraining : public QWidget |
288 |
{ |
|
289 |
Q_OBJECT |
|
290 |
||
291 |
public: |
|
292 |
PageTraining(QWidget* parent = 0); |
|
293 |
||
294 |
QPushButton *BtnStartTrain; |
|
295 |
QPushButton *BtnBack; |
|
296 |
}; |
|
297 |
||
684 | 298 |
class PageSelectWeapon : public AbstractPage |
600 | 299 |
{ |
300 |
Q_OBJECT |
|
301 |
||
302 |
public: |
|
303 |
PageSelectWeapon(QWidget* parent = 0); |
|
304 |
||
683 | 305 |
QPushButton *BtnSave; |
306 |
QPushButton *BtnDefault; |
|
600 | 307 |
QPushButton *BtnBack; |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
600
diff
changeset
|
308 |
SelWeaponWidget* pWeapons; |
600 | 309 |
}; |
306 | 310 |
|
686 | 311 |
class PageInGame : public AbstractPage |
312 |
{ |
|
313 |
Q_OBJECT |
|
314 |
||
315 |
public: |
|
316 |
PageInGame(QWidget* parent = 0); |
|
317 |
}; |
|
318 |
||
184 | 319 |
#endif // PAGES_H |