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