author | unc0rr |
Sun, 20 Jan 2008 12:50:26 +0000 | |
changeset 719 | bea32693bd7a |
parent 718 | f93a38d2c982 |
child 728 | 033971bbe639 |
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 |
||
692 | 70 |
QPushButton* addButton(const char* btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan) { |
71 |
QPushButton* butt = new QPushButton(this); |
|
72 |
butt->setFont(*font14); |
|
73 |
butt->setText(QPushButton::tr(btname)); |
|
74 |
grid->addWidget(butt, wy, wx, rowSpan, columnSpan); |
|
75 |
return butt; |
|
76 |
}; |
|
77 |
||
684 | 78 |
QPushButton* addButton(const char* btname, QBoxLayout* box, int where) { |
79 |
QPushButton* butt = new QPushButton(this); |
|
80 |
butt->setFont(*font14); |
|
81 |
butt->setText(QPushButton::tr(btname)); |
|
82 |
box->addWidget(butt, where); |
|
83 |
return butt; |
|
84 |
}; |
|
85 |
||
86 |
QFont * font14; |
|
87 |
}; |
|
88 |
||
89 |
class PageMain : public AbstractPage |
|
184 | 90 |
{ |
91 |
Q_OBJECT |
|
92 |
||
93 |
public: |
|
94 |
PageMain(QWidget* parent = 0); |
|
95 |
||
96 |
QPushButton *BtnSinglePlayer; |
|
97 |
QPushButton *BtnMultiplayer; |
|
98 |
QPushButton *BtnNet; |
|
99 |
QPushButton *BtnSetup; |
|
579 | 100 |
QPushButton *BtnLoad; |
184 | 101 |
QPushButton *BtnDemos; |
187 | 102 |
QPushButton *BtnInfo; |
184 | 103 |
QPushButton *BtnExit; |
104 |
}; |
|
105 |
||
684 | 106 |
class PageSimpleGame : public AbstractPage |
184 | 107 |
{ |
108 |
Q_OBJECT |
|
109 |
||
110 |
public: |
|
585
7531ae5b146e
Rename PageLocalGame -> PageSimpleGame due to future changes
unc0rr
parents:
579
diff
changeset
|
111 |
PageSimpleGame(QWidget* parent = 0); |
184 | 112 |
|
113 |
QPushButton *BtnSimpleGame; |
|
114 |
QPushButton *BtnBack; |
|
115 |
GameCFGWidget *gameCFG; |
|
116 |
}; |
|
117 |
||
692 | 118 |
class PageEditTeam : public AbstractPage |
184 | 119 |
{ |
120 |
Q_OBJECT |
|
121 |
||
122 |
public: |
|
123 |
PageEditTeam(QWidget* parent = 0); |
|
124 |
QGroupBox *GBoxHedgehogs; |
|
125 |
QGroupBox *GBoxTeam; |
|
126 |
QGroupBox *GBoxFort; |
|
127 |
QComboBox *CBFort; |
|
128 |
SquareLabel *FortPreview; |
|
129 |
QGroupBox *GBoxGrave; |
|
130 |
QComboBox *CBGrave; |
|
131 |
QLabel *GravePreview; |
|
336 | 132 |
QGroupBox *GBoxTeamLvl; |
133 |
QComboBox *CBTeamLvl; |
|
134 |
QLabel *LevelPict; |
|
184 | 135 |
QGroupBox *GBoxBinds; |
136 |
QToolBox *BindsBox; |
|
137 |
QWidget *page_A; |
|
138 |
QWidget *page_W; |
|
139 |
QWidget *page_WP; |
|
140 |
QWidget *page_O; |
|
141 |
QPushButton *BtnTeamDiscard; |
|
142 |
QPushButton *BtnTeamSave; |
|
143 |
QLineEdit * TeamNameEdit; |
|
144 |
QLineEdit * HHNameEdit[8]; |
|
145 |
QComboBox * CBBind[BINDS_NUMBER]; |
|
146 |
||
147 |
public slots: |
|
148 |
void CBGrave_activated(const QString & gravename); |
|
149 |
void CBFort_activated(const QString & gravename); |
|
336 | 150 |
void CBTeamLvl_activated(int id); |
184 | 151 |
|
152 |
private: |
|
153 |
QLabel * LBind[BINDS_NUMBER]; |
|
154 |
}; |
|
155 |
||
692 | 156 |
class PageMultiplayer : public AbstractPage |
184 | 157 |
{ |
158 |
Q_OBJECT |
|
159 |
||
160 |
public: |
|
161 |
PageMultiplayer(QWidget* parent = 0); |
|
162 |
||
163 |
QPushButton *BtnBack; |
|
164 |
GameCFGWidget *gameCFG; |
|
165 |
TeamSelWidget *teamsSelect; |
|
166 |
QPushButton *BtnStartMPGame; |
|
167 |
}; |
|
168 |
||
692 | 169 |
class PageOptions : public AbstractPage |
184 | 170 |
{ |
171 |
Q_OBJECT |
|
172 |
||
173 |
public: |
|
174 |
PageOptions(QWidget* parent = 0); |
|
175 |
||
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
587
diff
changeset
|
176 |
QPushButton* WeaponsButt; |
693 | 177 |
QPushButton* WeaponEdit; |
178 |
QComboBox* WeaponsName; |
|
179 |
||
184 | 180 |
QPushButton *BtnBack; |
181 |
QGroupBox *groupBox; |
|
182 |
QPushButton *BtnNewTeam; |
|
183 |
QPushButton *BtnEditTeam; |
|
184 |
QComboBox *CBTeamName; |
|
185 |
QGroupBox *AGGroupBox; |
|
186 |
QComboBox *CBResolution; |
|
187 |
QCheckBox *CBEnableSound; |
|
188 |
QCheckBox *CBFullscreen; |
|
297 | 189 |
QCheckBox *CBShowFPS; |
529 | 190 |
QCheckBox *CBAltDamage; |
297 | 191 |
FPSEdit *fpsedit; |
184 | 192 |
QPushButton *BtnSaveOptions; |
647 | 193 |
QGroupBox *NNGroupBox; |
194 |
QLabel *labelNN; |
|
195 |
QLineEdit *editNetNick; |
|
184 | 196 |
}; |
197 |
||
198 |
class PageNet : public QWidget |
|
199 |
{ |
|
200 |
Q_OBJECT |
|
201 |
||
202 |
public: |
|
203 |
PageNet(QWidget* parent = 0); |
|
204 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
205 |
QPushButton* BtnUpdateSList; |
665 | 206 |
QTableView * tvServersList; |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
207 |
QPushButton * BtnBack; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
208 |
QPushButton * BtnNetConnect; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
209 |
QPushButton * BtnNetSvrStart; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
210 |
QPushButton * BtnSpecifyServer; |
636 | 211 |
QRadioButton * rbLocalGame; |
212 |
QRadioButton * rbInternetGame; |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
213 |
|
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
214 |
private: |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
215 |
QGroupBox * ConnGroupBox; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
216 |
QGridLayout * GBClayout; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
217 |
|
646 | 218 |
private slots: |
219 |
void slotConnect(); |
|
220 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
221 |
public slots: |
646 | 222 |
void updateServersList(); |
223 |
||
224 |
signals: |
|
665 | 225 |
void connectClicked(const QString & host, quint16 port); |
646 | 226 |
}; |
227 |
||
228 |
class PageNetServer : public QWidget |
|
229 |
{ |
|
230 |
Q_OBJECT |
|
231 |
||
232 |
public: |
|
233 |
PageNetServer(QWidget* parent = 0); |
|
234 |
||
235 |
QPushButton *BtnBack; |
|
236 |
QPushButton *BtnStart; |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
237 |
QPushButton *BtnDefault; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
238 |
QLabel *labelSD; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
239 |
QLineEdit *leServerDescr; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
240 |
QLabel *labelPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
241 |
QSpinBox *sbPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
242 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
243 |
private slots: |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
244 |
void setDefaultPort(); |
184 | 245 |
}; |
246 |
||
247 |
class PageNetGame : public QWidget |
|
248 |
{ |
|
249 |
Q_OBJECT |
|
250 |
||
251 |
public: |
|
252 |
PageNetGame(QWidget* parent = 0); |
|
253 |
||
254 |
QPushButton *BtnBack; |
|
255 |
QPushButton *BtnGo; |
|
461 | 256 |
|
257 |
HWChatWidget* pChatWidget; |
|
322 | 258 |
|
259 |
TeamSelWidget* pNetTeamsWidget; |
|
260 |
GameCFGWidget* pGameCFG; |
|
184 | 261 |
}; |
262 |
||
187 | 263 |
class PageInfo : public QWidget |
264 |
{ |
|
265 |
Q_OBJECT |
|
266 |
||
267 |
public: |
|
268 |
PageInfo(QWidget* parent = 0); |
|
269 |
||
270 |
QPushButton *BtnBack; |
|
271 |
About *about; |
|
272 |
}; |
|
273 |
||
306 | 274 |
class PageGameStats : public QWidget |
275 |
{ |
|
276 |
Q_OBJECT |
|
277 |
||
278 |
public: |
|
279 |
PageGameStats(QWidget* parent = 0); |
|
280 |
||
281 |
QPushButton *BtnBack; |
|
307 | 282 |
QLabel *labelGameStats; |
306 | 283 |
}; |
284 |
||
586 | 285 |
class PageSinglePlayer : public QWidget |
286 |
{ |
|
287 |
Q_OBJECT |
|
288 |
||
289 |
public: |
|
290 |
PageSinglePlayer(QWidget* parent = 0); |
|
291 |
||
292 |
QPushButton *BtnSimpleGamePage; |
|
293 |
QPushButton *BtnTrainPage; |
|
294 |
QPushButton *BtnBack; |
|
295 |
GameCFGWidget *gameCFG; |
|
296 |
}; |
|
297 |
||
587 | 298 |
class PageTraining : public QWidget |
299 |
{ |
|
300 |
Q_OBJECT |
|
301 |
||
302 |
public: |
|
303 |
PageTraining(QWidget* parent = 0); |
|
304 |
||
305 |
QPushButton *BtnStartTrain; |
|
306 |
QPushButton *BtnBack; |
|
307 |
}; |
|
308 |
||
684 | 309 |
class PageSelectWeapon : public AbstractPage |
600 | 310 |
{ |
311 |
Q_OBJECT |
|
312 |
||
313 |
public: |
|
314 |
PageSelectWeapon(QWidget* parent = 0); |
|
315 |
||
683 | 316 |
QPushButton *BtnSave; |
317 |
QPushButton *BtnDefault; |
|
718 | 318 |
QPushButton *BtnDelete; |
600 | 319 |
QPushButton *BtnBack; |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
600
diff
changeset
|
320 |
SelWeaponWidget* pWeapons; |
600 | 321 |
}; |
306 | 322 |
|
686 | 323 |
class PageInGame : public AbstractPage |
324 |
{ |
|
325 |
Q_OBJECT |
|
326 |
||
327 |
public: |
|
328 |
PageInGame(QWidget* parent = 0); |
|
329 |
}; |
|
330 |
||
184 | 331 |
#endif // PAGES_H |