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