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