author | displacer |
Mon, 07 Jan 2008 13:09:10 +0000 | |
changeset 692 | 07787e748831 |
parent 686 | 494b5880989a |
child 693 | 32a546d1eb3e |
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; |
184 | 177 |
QPushButton *BtnBack; |
178 |
QGroupBox *groupBox; |
|
179 |
QPushButton *BtnNewTeam; |
|
180 |
QPushButton *BtnEditTeam; |
|
181 |
QComboBox *CBTeamName; |
|
182 |
QGroupBox *AGGroupBox; |
|
183 |
QComboBox *CBResolution; |
|
184 |
QCheckBox *CBEnableSound; |
|
185 |
QCheckBox *CBFullscreen; |
|
297 | 186 |
QCheckBox *CBShowFPS; |
529 | 187 |
QCheckBox *CBAltDamage; |
297 | 188 |
FPSEdit *fpsedit; |
184 | 189 |
QPushButton *BtnSaveOptions; |
647 | 190 |
QGroupBox *NNGroupBox; |
191 |
QLabel *labelNN; |
|
192 |
QLineEdit *editNetNick; |
|
184 | 193 |
}; |
194 |
||
195 |
class PageNet : public QWidget |
|
196 |
{ |
|
197 |
Q_OBJECT |
|
198 |
||
199 |
public: |
|
200 |
PageNet(QWidget* parent = 0); |
|
201 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
202 |
QPushButton* BtnUpdateSList; |
665 | 203 |
QTableView * tvServersList; |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
204 |
QPushButton * BtnBack; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
205 |
QPushButton * BtnNetConnect; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
206 |
QPushButton * BtnNetSvrStart; |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
207 |
QPushButton * BtnSpecifyServer; |
636 | 208 |
QRadioButton * rbLocalGame; |
209 |
QRadioButton * rbInternetGame; |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
210 |
|
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
211 |
private: |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
212 |
QGroupBox * ConnGroupBox; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
213 |
QGridLayout * GBClayout; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
214 |
|
646 | 215 |
private slots: |
216 |
void slotConnect(); |
|
217 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
612
diff
changeset
|
218 |
public slots: |
646 | 219 |
void updateServersList(); |
220 |
||
221 |
signals: |
|
665 | 222 |
void connectClicked(const QString & host, quint16 port); |
646 | 223 |
}; |
224 |
||
225 |
class PageNetServer : public QWidget |
|
226 |
{ |
|
227 |
Q_OBJECT |
|
228 |
||
229 |
public: |
|
230 |
PageNetServer(QWidget* parent = 0); |
|
231 |
||
232 |
QPushButton *BtnBack; |
|
233 |
QPushButton *BtnStart; |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
234 |
QPushButton *BtnDefault; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
235 |
QLabel *labelSD; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
236 |
QLineEdit *leServerDescr; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
237 |
QLabel *labelPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
238 |
QSpinBox *sbPort; |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
239 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
240 |
private slots: |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
241 |
void setDefaultPort(); |
184 | 242 |
}; |
243 |
||
244 |
class PageNetGame : public QWidget |
|
245 |
{ |
|
246 |
Q_OBJECT |
|
247 |
||
248 |
public: |
|
249 |
PageNetGame(QWidget* parent = 0); |
|
250 |
||
251 |
QPushButton *BtnBack; |
|
252 |
QPushButton *BtnGo; |
|
461 | 253 |
|
254 |
HWChatWidget* pChatWidget; |
|
322 | 255 |
|
256 |
TeamSelWidget* pNetTeamsWidget; |
|
257 |
GameCFGWidget* pGameCFG; |
|
184 | 258 |
}; |
259 |
||
187 | 260 |
class PageInfo : public QWidget |
261 |
{ |
|
262 |
Q_OBJECT |
|
263 |
||
264 |
public: |
|
265 |
PageInfo(QWidget* parent = 0); |
|
266 |
||
267 |
QPushButton *BtnBack; |
|
268 |
About *about; |
|
269 |
}; |
|
270 |
||
306 | 271 |
class PageGameStats : public QWidget |
272 |
{ |
|
273 |
Q_OBJECT |
|
274 |
||
275 |
public: |
|
276 |
PageGameStats(QWidget* parent = 0); |
|
277 |
||
278 |
QPushButton *BtnBack; |
|
307 | 279 |
QLabel *labelGameStats; |
306 | 280 |
}; |
281 |
||
586 | 282 |
class PageSinglePlayer : public QWidget |
283 |
{ |
|
284 |
Q_OBJECT |
|
285 |
||
286 |
public: |
|
287 |
PageSinglePlayer(QWidget* parent = 0); |
|
288 |
||
289 |
QPushButton *BtnSimpleGamePage; |
|
290 |
QPushButton *BtnTrainPage; |
|
291 |
QPushButton *BtnBack; |
|
292 |
GameCFGWidget *gameCFG; |
|
293 |
}; |
|
294 |
||
587 | 295 |
class PageTraining : public QWidget |
296 |
{ |
|
297 |
Q_OBJECT |
|
298 |
||
299 |
public: |
|
300 |
PageTraining(QWidget* parent = 0); |
|
301 |
||
302 |
QPushButton *BtnStartTrain; |
|
303 |
QPushButton *BtnBack; |
|
304 |
}; |
|
305 |
||
684 | 306 |
class PageSelectWeapon : public AbstractPage |
600 | 307 |
{ |
308 |
Q_OBJECT |
|
309 |
||
310 |
public: |
|
311 |
PageSelectWeapon(QWidget* parent = 0); |
|
312 |
||
683 | 313 |
QPushButton *BtnSave; |
314 |
QPushButton *BtnDefault; |
|
600 | 315 |
QPushButton *BtnBack; |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
600
diff
changeset
|
316 |
SelWeaponWidget* pWeapons; |
600 | 317 |
}; |
306 | 318 |
|
686 | 319 |
class PageInGame : public AbstractPage |
320 |
{ |
|
321 |
Q_OBJECT |
|
322 |
||
323 |
public: |
|
324 |
PageInGame(QWidget* parent = 0); |
|
325 |
}; |
|
326 |
||
184 | 327 |
#endif // PAGES_H |