author | unc0rr |
Fri, 18 Apr 2008 18:06:17 +0000 | |
changeset 849 | 82ac0596aa3c |
parent 788 | 00720357601f |
child 1066 | 1f1b3686a2b0 |
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 |
||
728 | 62 |
QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx) { |
684 | 63 |
QPushButton* butt = new QPushButton(this); |
64 |
butt->setFont(*font14); |
|
728 | 65 |
butt->setText(btname); |
684 | 66 |
grid->addWidget(butt, wy, wx); |
67 |
return butt; |
|
68 |
}; |
|
69 |
||
728 | 70 |
QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan) { |
692 | 71 |
QPushButton* butt = new QPushButton(this); |
72 |
butt->setFont(*font14); |
|
728 | 73 |
butt->setText(btname); |
692 | 74 |
grid->addWidget(butt, wy, wx, rowSpan, columnSpan); |
75 |
return butt; |
|
76 |
}; |
|
77 |
||
728 | 78 |
QPushButton* addButton(QString btname, QBoxLayout* box, int where) { |
684 | 79 |
QPushButton* butt = new QPushButton(this); |
80 |
butt->setFont(*font14); |
|
728 | 81 |
butt->setText(btname); |
684 | 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 |
||
692 | 106 |
class PageEditTeam : public AbstractPage |
184 | 107 |
{ |
108 |
Q_OBJECT |
|
109 |
||
110 |
public: |
|
111 |
PageEditTeam(QWidget* parent = 0); |
|
112 |
QGroupBox *GBoxHedgehogs; |
|
113 |
QGroupBox *GBoxTeam; |
|
114 |
QGroupBox *GBoxFort; |
|
115 |
QComboBox *CBFort; |
|
116 |
SquareLabel *FortPreview; |
|
117 |
QGroupBox *GBoxGrave; |
|
118 |
QComboBox *CBGrave; |
|
119 |
QLabel *GravePreview; |
|
336 | 120 |
QGroupBox *GBoxTeamLvl; |
121 |
QComboBox *CBTeamLvl; |
|
122 |
QLabel *LevelPict; |
|
184 | 123 |
QGroupBox *GBoxBinds; |
124 |
QToolBox *BindsBox; |
|
125 |
QWidget *page_A; |
|
126 |
QWidget *page_W; |
|
127 |
QWidget *page_WP; |
|
128 |
QWidget *page_O; |
|
129 |
QPushButton *BtnTeamDiscard; |
|
130 |
QPushButton *BtnTeamSave; |
|
131 |
QLineEdit * TeamNameEdit; |
|
132 |
QLineEdit * HHNameEdit[8]; |
|
133 |
QComboBox * CBBind[BINDS_NUMBER]; |
|
134 |
||
135 |
public slots: |
|
136 |
void CBGrave_activated(const QString & gravename); |
|
137 |
void CBFort_activated(const QString & gravename); |
|
336 | 138 |
void CBTeamLvl_activated(int id); |
184 | 139 |
|
140 |
private: |
|
141 |
QLabel * LBind[BINDS_NUMBER]; |
|
142 |
}; |
|
143 |
||
692 | 144 |
class PageMultiplayer : public AbstractPage |
184 | 145 |
{ |
146 |
Q_OBJECT |
|
147 |
||
148 |
public: |
|
149 |
PageMultiplayer(QWidget* parent = 0); |
|
150 |
||
151 |
QPushButton *BtnBack; |
|
152 |
GameCFGWidget *gameCFG; |
|
153 |
TeamSelWidget *teamsSelect; |
|
154 |
QPushButton *BtnStartMPGame; |
|
155 |
}; |
|
156 |
||
692 | 157 |
class PageOptions : public AbstractPage |
184 | 158 |
{ |
159 |
Q_OBJECT |
|
160 |
||
161 |
public: |
|
162 |
PageOptions(QWidget* parent = 0); |
|
163 |
||
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
587
diff
changeset
|
164 |
QPushButton* WeaponsButt; |
693 | 165 |
QPushButton* WeaponEdit; |
166 |
QComboBox* WeaponsName; |
|
167 |
||
184 | 168 |
QPushButton *BtnBack; |
169 |
QGroupBox *groupBox; |
|
170 |
QPushButton *BtnNewTeam; |
|
171 |
QPushButton *BtnEditTeam; |
|
172 |
QComboBox *CBTeamName; |
|
173 |
QGroupBox *AGGroupBox; |
|
174 |
QComboBox *CBResolution; |
|
175 |
QCheckBox *CBEnableSound; |
|
176 |
QCheckBox *CBFullscreen; |
|
297 | 177 |
QCheckBox *CBShowFPS; |
529 | 178 |
QCheckBox *CBAltDamage; |
297 | 179 |
FPSEdit *fpsedit; |
184 | 180 |
QPushButton *BtnSaveOptions; |
647 | 181 |
QGroupBox *NNGroupBox; |
182 |
QLabel *labelNN; |
|
183 |
QLineEdit *editNetNick; |
|
184 | 184 |
}; |
185 |
||
186 |
class PageNet : public QWidget |
|
187 |
{ |
|
188 |
Q_OBJECT |
|
189 |
||
190 |
public: |
|
191 |
PageNet(QWidget* parent = 0); |
|
192 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
193 |
QPushButton* BtnUpdateSList; |
665 | 194 |
QTableView * tvServersList; |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
195 |
QPushButton * BtnBack; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
196 |
QPushButton * BtnNetConnect; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
197 |
QPushButton * BtnNetSvrStart; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
198 |
QPushButton * BtnSpecifyServer; |
636 | 199 |
QRadioButton * rbLocalGame; |
200 |
QRadioButton * rbInternetGame; |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
201 |
|
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
202 |
private: |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
203 |
QGroupBox * ConnGroupBox; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
204 |
QGridLayout * GBClayout; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
205 |
|
646 | 206 |
private slots: |
207 |
void slotConnect(); |
|
208 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
209 |
public slots: |
646 | 210 |
void updateServersList(); |
211 |
||
212 |
signals: |
|
665 | 213 |
void connectClicked(const QString & host, quint16 port); |
646 | 214 |
}; |
215 |
||
216 |
class PageNetServer : public QWidget |
|
217 |
{ |
|
218 |
Q_OBJECT |
|
219 |
||
220 |
public: |
|
221 |
PageNetServer(QWidget* parent = 0); |
|
222 |
||
223 |
QPushButton *BtnBack; |
|
224 |
QPushButton *BtnStart; |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
225 |
QPushButton *BtnDefault; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
226 |
QLabel *labelSD; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
227 |
QLineEdit *leServerDescr; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
228 |
QLabel *labelPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
229 |
QSpinBox *sbPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
230 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
231 |
private slots: |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
232 |
void setDefaultPort(); |
184 | 233 |
}; |
234 |
||
235 |
class PageNetGame : public QWidget |
|
236 |
{ |
|
237 |
Q_OBJECT |
|
238 |
||
239 |
public: |
|
240 |
PageNetGame(QWidget* parent = 0); |
|
241 |
||
242 |
QPushButton *BtnBack; |
|
243 |
QPushButton *BtnGo; |
|
461 | 244 |
|
245 |
HWChatWidget* pChatWidget; |
|
322 | 246 |
|
247 |
TeamSelWidget* pNetTeamsWidget; |
|
248 |
GameCFGWidget* pGameCFG; |
|
184 | 249 |
}; |
250 |
||
187 | 251 |
class PageInfo : public QWidget |
252 |
{ |
|
253 |
Q_OBJECT |
|
254 |
||
255 |
public: |
|
256 |
PageInfo(QWidget* parent = 0); |
|
257 |
||
258 |
QPushButton *BtnBack; |
|
259 |
About *about; |
|
260 |
}; |
|
261 |
||
306 | 262 |
class PageGameStats : public QWidget |
263 |
{ |
|
264 |
Q_OBJECT |
|
265 |
||
266 |
public: |
|
267 |
PageGameStats(QWidget* parent = 0); |
|
268 |
||
269 |
QPushButton *BtnBack; |
|
307 | 270 |
QLabel *labelGameStats; |
306 | 271 |
}; |
272 |
||
586 | 273 |
class PageSinglePlayer : public QWidget |
274 |
{ |
|
275 |
Q_OBJECT |
|
276 |
||
277 |
public: |
|
278 |
PageSinglePlayer(QWidget* parent = 0); |
|
279 |
||
280 |
QPushButton *BtnSimpleGamePage; |
|
281 |
QPushButton *BtnTrainPage; |
|
282 |
QPushButton *BtnBack; |
|
283 |
GameCFGWidget *gameCFG; |
|
284 |
}; |
|
285 |
||
587 | 286 |
class PageTraining : public QWidget |
287 |
{ |
|
288 |
Q_OBJECT |
|
289 |
||
290 |
public: |
|
291 |
PageTraining(QWidget* parent = 0); |
|
292 |
||
293 |
QPushButton *BtnStartTrain; |
|
294 |
QPushButton *BtnBack; |
|
295 |
}; |
|
296 |
||
684 | 297 |
class PageSelectWeapon : public AbstractPage |
600 | 298 |
{ |
299 |
Q_OBJECT |
|
300 |
||
301 |
public: |
|
302 |
PageSelectWeapon(QWidget* parent = 0); |
|
303 |
||
683 | 304 |
QPushButton *BtnSave; |
305 |
QPushButton *BtnDefault; |
|
718 | 306 |
QPushButton *BtnDelete; |
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 |