author | displacer |
Wed, 19 Dec 2007 11:10:23 +0000 | |
changeset 681 | 7a20c50988ec |
parent 675 | 28e294a496cb |
child 683 | 57d624f71e65 |
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 |
#include <QGridLayout> |
|
20 |
#include <QPushButton> |
|
21 |
#include <QGroupBox> |
|
22 |
#include <QComboBox> |
|
311 | 23 |
#include <QCheckBox> |
184 | 24 |
#include <QLabel> |
25 |
#include <QToolBox> |
|
26 |
#include <QLineEdit> |
|
27 |
#include <QListWidget> |
|
28 |
#include <QApplication> |
|
231 | 29 |
#include <QSpinBox> |
452 | 30 |
#include <QTextEdit> |
636 | 31 |
#include <QRadioButton> |
665 | 32 |
#include <QTableView> |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
33 |
#include <QMessageBox> |
673 | 34 |
#include <QHeaderView> |
184 | 35 |
|
36 |
#include "pages.h" |
|
37 |
#include "sdlkeys.h" |
|
38 |
#include "hwconsts.h" |
|
39 |
#include "gamecfgwidget.h" |
|
40 |
#include "teamselect.h" |
|
41 |
#include "gamecfgwidget.h" |
|
42 |
#include "SquareLabel.h" |
|
43 |
#include "mapContainer.h" |
|
187 | 44 |
#include "about.h" |
297 | 45 |
#include "fpsedit.h" |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
46 |
#include "netserverslist.h" |
412 | 47 |
#include "netudpwidget.h" |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
48 |
#include "netwwwwidget.h" |
461 | 49 |
#include "chatwidget.h" |
555 | 50 |
#include "SDLs.h" |
579 | 51 |
#include "playrecordpage.h" |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
52 |
#include "selectWeapon.h" |
184 | 53 |
|
54 |
PageMain::PageMain(QWidget* parent) : QWidget(parent) |
|
55 |
{ |
|
56 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
57 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
58 |
pageLayout->setMargin(25); |
|
59 |
pageLayout->setColumnStretch(0, 1); |
|
60 |
pageLayout->setColumnStretch(1, 2); |
|
61 |
pageLayout->setColumnStretch(2, 1); |
|
62 |
||
63 |
BtnSinglePlayer = new QPushButton(this); |
|
64 |
BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
65 |
BtnSinglePlayer->setFont(*font14); |
|
66 |
BtnSinglePlayer->setText(QPushButton::tr("Single Player")); |
|
586 | 67 |
pageLayout->addWidget(BtnSinglePlayer, 0, 1); |
184 | 68 |
|
69 |
BtnMultiplayer = new QPushButton(this); |
|
70 |
BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
71 |
BtnMultiplayer->setFont(*font14); |
|
72 |
BtnMultiplayer->setText(QPushButton::tr("Multiplayer")); |
|
586 | 73 |
pageLayout->addWidget(BtnMultiplayer, 1, 1); |
184 | 74 |
|
75 |
BtnNet = new QPushButton(this); |
|
76 |
BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
77 |
BtnNet->setFont(*font14); |
|
78 |
BtnNet->setText(QPushButton::tr("Net game")); |
|
586 | 79 |
pageLayout->addWidget(BtnNet, 2, 1); |
184 | 80 |
|
579 | 81 |
BtnLoad = new QPushButton(this); |
82 |
BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
83 |
BtnLoad->setFont(*font14); |
|
673 | 84 |
BtnLoad->setText(QPushButton::tr("Saved games")); |
586 | 85 |
pageLayout->addWidget(BtnLoad, 3, 1); |
579 | 86 |
|
184 | 87 |
BtnDemos = new QPushButton(this); |
88 |
BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
89 |
BtnDemos->setFont(*font14); |
|
90 |
BtnDemos->setText(QPushButton::tr("Demos")); |
|
586 | 91 |
pageLayout->addWidget(BtnDemos, 4, 1); |
184 | 92 |
|
93 |
BtnSetup = new QPushButton(this); |
|
94 |
BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
95 |
BtnSetup->setFont(*font14); |
|
96 |
BtnSetup->setText(QPushButton::tr("Setup")); |
|
586 | 97 |
pageLayout->addWidget(BtnSetup, 5, 1); |
184 | 98 |
|
187 | 99 |
BtnInfo = new QPushButton(this); |
100 |
BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
101 |
BtnInfo->setFont(*font14); |
|
102 |
BtnInfo->setText(QPushButton::tr("About")); |
|
586 | 103 |
pageLayout->addWidget(BtnInfo, 6, 1); |
187 | 104 |
|
184 | 105 |
BtnExit = new QPushButton(parent); |
106 |
BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
107 |
BtnExit->setFont(*font14); |
|
108 |
BtnExit->setText(QPushButton::tr("Exit")); |
|
187 | 109 |
pageLayout->addWidget(BtnExit, 7, 1); |
184 | 110 |
} |
111 |
||
585
7531ae5b146e
Rename PageLocalGame -> PageSimpleGame due to future changes
unc0rr
parents:
579
diff
changeset
|
112 |
PageSimpleGame::PageSimpleGame(QWidget* parent) : QWidget(parent) |
184 | 113 |
{ |
114 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
440 | 115 |
QVBoxLayout * pageLayout = new QVBoxLayout(this); |
116 |
QHBoxLayout * topLayout = new QHBoxLayout(); |
|
117 |
QHBoxLayout * bottomLayout = new QHBoxLayout(); |
|
118 |
pageLayout->addLayout(topLayout, 100); |
|
119 |
pageLayout->addLayout(bottomLayout, 0); |
|
120 |
||
121 |
BtnBack = new QPushButton(this); |
|
184 | 122 |
BtnBack->setFont(*font14); |
123 |
BtnBack->setText(QPushButton::tr("Back")); |
|
440 | 124 |
bottomLayout->addWidget(BtnBack, 100); |
125 |
bottomLayout->addStretch(100); |
|
586 | 126 |
BtnSimpleGame = new QPushButton(this); |
184 | 127 |
BtnSimpleGame->setFont(*font14); |
128 |
BtnSimpleGame->setText(QPushButton::tr("Simple Game")); |
|
440 | 129 |
bottomLayout->addWidget(BtnSimpleGame, 100); |
130 |
||
184 | 131 |
gameCFG = new GameCFGWidget(this); |
440 | 132 |
topLayout->addStretch(100); |
133 |
topLayout->addWidget(gameCFG); |
|
134 |
topLayout->addStretch(100); |
|
184 | 135 |
} |
136 |
||
137 |
PageEditTeam::PageEditTeam(QWidget* parent) : QWidget(parent) |
|
138 |
{ |
|
139 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
140 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
310 | 141 |
pageLayout->setColumnStretch(0, 1); |
184 | 142 |
pageLayout->setColumnMinimumWidth(0, 150); |
143 |
pageLayout->setColumnStretch(1, 100); |
|
336 | 144 |
pageLayout->setColumnMinimumWidth(1, 210); |
451 | 145 |
pageLayout->setColumnStretch(2, 75); |
336 | 146 |
pageLayout->setColumnMinimumWidth(2, 110); |
451 | 147 |
pageLayout->setColumnStretch(3, 75); |
336 | 148 |
pageLayout->setColumnMinimumWidth(3, 110); |
184 | 149 |
|
150 |
GBoxTeam = new QGroupBox(this); |
|
151 |
GBoxTeam->setTitle(QGroupBox::tr("Team")); |
|
152 |
GBoxTeam->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
153 |
QGridLayout * GBTLayout = new QGridLayout(GBoxTeam); |
|
154 |
TeamNameEdit = new QLineEdit(GBoxTeam); |
|
155 |
TeamNameEdit->setMaxLength(15); |
|
231 | 156 |
GBTLayout->addWidget(TeamNameEdit, 0, 0, 1, 0); |
157 |
||
184 | 158 |
pageLayout->addWidget(GBoxTeam, 0, 0); |
159 |
||
588 | 160 |
GBoxHedgehogs = new QGroupBox(this); |
184 | 161 |
GBoxHedgehogs->setTitle(QGroupBox::tr("Team Members")); |
162 |
GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
163 |
QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs); |
|
164 |
for(int i = 0; i < 8; i++) |
|
165 |
{ |
|
166 |
HHNameEdit[i] = new QLineEdit(GBoxHedgehogs); |
|
167 |
HHNameEdit[i]->setGeometry(QRect(10, 20 + i * 30, 141, 20)); |
|
168 |
HHNameEdit[i]->setMaxLength(15); |
|
169 |
GBHLayout->addWidget(HHNameEdit[i]); |
|
170 |
} |
|
171 |
pageLayout->addWidget(GBoxHedgehogs, 1, 0, 2, 1); |
|
172 |
||
173 |
BtnTeamDiscard = new QPushButton(this); |
|
174 |
BtnTeamDiscard->setFont(*font14); |
|
175 |
BtnTeamDiscard->setText(QPushButton::tr("Discard")); |
|
176 |
pageLayout->addWidget(BtnTeamDiscard, 4, 0); |
|
177 |
||
588 | 178 |
GBoxBinds = new QGroupBox(this); |
184 | 179 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
180 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
|
181 |
BindsBox = new QToolBox(GBoxBinds); |
|
182 |
BindsBox->setLineWidth(0); |
|
183 |
GBBLayout->addWidget(BindsBox); |
|
184 |
page_A = new QWidget(); |
|
185 |
BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
|
186 |
page_W = new QWidget(); |
|
187 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
|
188 |
page_WP = new QWidget(); |
|
189 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
|
190 |
page_O = new QWidget(); |
|
191 |
BindsBox->addItem(page_O, QToolBox::tr("Other")); |
|
192 |
pageLayout->addWidget(GBoxBinds, 0, 1, 5, 1); |
|
193 |
||
194 |
QStringList binds; |
|
195 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
196 |
{ |
|
197 |
binds << sdlkeys[i][1]; |
|
198 |
} |
|
199 |
||
200 |
quint16 widind = 0, i = 0; |
|
201 |
while (i < BINDS_NUMBER) { |
|
202 |
quint16 num = 0; |
|
203 |
QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind)); |
|
204 |
do { |
|
205 |
LBind[i] = new QLabel(BindsBox->widget(widind)); |
|
206 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
|
207 |
LBind[i]->setAlignment(Qt::AlignRight); |
|
208 |
pagelayout->addWidget(LBind[i], num, 0); |
|
209 |
CBBind[i] = new QComboBox(BindsBox->widget(widind)); |
|
210 |
CBBind[i]->addItems(binds); |
|
211 |
pagelayout->addWidget(CBBind[i], num, 1); |
|
212 |
num++; |
|
213 |
} while (!cbinds[i++].chwidget); |
|
214 |
pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2); |
|
215 |
widind++; |
|
216 |
} |
|
217 |
||
588 | 218 |
GBoxGrave = new QGroupBox(this); |
184 | 219 |
GBoxGrave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
220 |
GBoxGrave->setTitle(QGroupBox::tr("Grave")); |
|
221 |
QGridLayout * GBGLayout = new QGridLayout(GBoxGrave); |
|
222 |
CBGrave = new QComboBox(GBoxGrave); |
|
223 |
CBGrave->setMaxCount(65535); |
|
224 |
GBGLayout->addWidget(CBGrave, 0, 0, 1, 3); |
|
225 |
GravePreview = new QLabel(GBoxGrave); |
|
226 |
GravePreview->setScaledContents(false); |
|
336 | 227 |
pageLayout->addWidget(GBoxGrave, 0, 3, 2, 1); |
184 | 228 |
GBGLayout->addWidget(GravePreview, 1, 1); |
336 | 229 |
|
230 |
GBoxTeamLvl = new QGroupBox(this); |
|
231 |
GBoxTeamLvl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
232 |
GBoxTeamLvl->setTitle(QGroupBox::tr("Team level")); |
|
233 |
QGridLayout * GBTLLayout = new QGridLayout(GBoxTeamLvl); |
|
234 |
CBTeamLvl = new QComboBox(GBoxTeamLvl); |
|
235 |
CBTeamLvl->addItem(QComboBox::tr("Human")); |
|
427 | 236 |
CBTeamLvl->addItem(QComboBox::tr("Level 5")); |
237 |
CBTeamLvl->addItem(QComboBox::tr("Level 4")); |
|
336 | 238 |
CBTeamLvl->addItem(QComboBox::tr("Level 3")); |
427 | 239 |
CBTeamLvl->addItem(QComboBox::tr("Level 2")); |
240 |
CBTeamLvl->addItem(QComboBox::tr("Level 1")); |
|
336 | 241 |
CBTeamLvl->setMaxCount(6); |
242 |
GBTLLayout->addWidget(CBTeamLvl, 0, 0, 1, 3); |
|
243 |
LevelPict = new QLabel(GBoxTeamLvl); |
|
244 |
LevelPict->setScaledContents(false); |
|
245 |
LevelPict->setFixedSize(32, 32); |
|
246 |
pageLayout->addWidget(GBoxTeamLvl, 0, 2, 2, 1); |
|
247 |
GBTLLayout->addWidget(LevelPict, 1, 1); |
|
184 | 248 |
|
249 |
GBoxFort = new QGroupBox(this); |
|
250 |
GBoxFort->setTitle(QGroupBox::tr("Fort")); |
|
251 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort); |
|
252 |
CBFort = new QComboBox(GBoxFort); |
|
253 |
CBFort->setMaxCount(65535); |
|
254 |
GBFLayout->addWidget(CBFort, 0, 0); |
|
588 | 255 |
FortPreview = new SquareLabel(GBoxFort); |
310 | 256 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
184 | 257 |
FortPreview->setPixmap(QPixmap()); |
258 |
GBFLayout->addWidget(FortPreview, 1, 0); |
|
336 | 259 |
pageLayout->addWidget(GBoxFort, 2, 2, 1, 2); |
184 | 260 |
|
588 | 261 |
BtnTeamSave = new QPushButton(this); |
184 | 262 |
BtnTeamSave->setFont(*font14); |
263 |
BtnTeamSave->setText(QPushButton::tr("Save")); |
|
336 | 264 |
pageLayout->addWidget(BtnTeamSave, 4, 2, 1, 2); |
184 | 265 |
|
266 |
QDir tmpdir; |
|
267 |
tmpdir.cd(datadir->absolutePath()); |
|
268 |
tmpdir.cd("Forts"); |
|
269 |
tmpdir.setFilter(QDir::Files); |
|
270 |
||
603 | 271 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1")); |
184 | 272 |
tmpdir.cd("../Graphics/Graves"); |
273 |
QStringList list = tmpdir.entryList(QStringList("*.png")); |
|
274 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
|
275 |
{ |
|
603 | 276 |
CBGrave->addItem((*it).replace(QRegExp("^(.*)\\.png"), "\\1")); |
184 | 277 |
} |
278 |
||
279 |
connect(CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
|
336 | 280 |
connect(CBTeamLvl, SIGNAL(activated(int)), this, SLOT(CBTeamLvl_activated(int))); |
184 | 281 |
connect(CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
282 |
} |
|
283 |
||
284 |
void PageEditTeam::CBGrave_activated(const QString & gravename) |
|
285 |
{ |
|
286 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png"); |
|
287 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32)); |
|
288 |
} |
|
289 |
||
290 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
291 |
{ |
|
292 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
|
293 |
FortPreview->setPixmap(pix); |
|
294 |
} |
|
295 |
||
336 | 296 |
void PageEditTeam::CBTeamLvl_activated(int id) |
297 |
{ |
|
298 |
QPixmap pix(QString(":/res/botlevels/%1.png").arg(id)); |
|
299 |
LevelPict->setPixmap(pix); |
|
300 |
} |
|
301 |
||
184 | 302 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : QWidget(parent) |
303 |
{ |
|
304 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
305 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
306 |
||
307 |
BtnBack = new QPushButton(this); |
|
308 |
BtnBack->setFont(*font14); |
|
309 |
BtnBack->setText(QPushButton::tr("Back")); |
|
310 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
187 | 311 |
|
184 | 312 |
gameCFG = new GameCFGWidget(this); |
313 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2); |
|
314 |
teamsSelect = new TeamSelWidget(this); |
|
315 |
pageLayout->addWidget(teamsSelect, 0, 2, 1, 2); |
|
316 |
||
317 |
BtnStartMPGame = new QPushButton(this); |
|
318 |
BtnStartMPGame->setFont(*font14); |
|
319 |
BtnStartMPGame->setText(QPushButton::tr("Start")); |
|
320 |
pageLayout->addWidget(BtnStartMPGame, 1, 3); |
|
321 |
} |
|
322 |
||
323 |
PageOptions::PageOptions(QWidget* parent) : QWidget(parent) |
|
324 |
{ |
|
325 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
326 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
427 | 327 |
pageLayout->setColumnStretch(0, 100); |
328 |
pageLayout->setColumnStretch(1, 100); |
|
329 |
pageLayout->setColumnStretch(2, 100); |
|
330 |
pageLayout->setRowStretch(0, 0); |
|
331 |
pageLayout->setRowStretch(1, 0); |
|
332 |
pageLayout->setRowStretch(2, 100); |
|
333 |
pageLayout->setRowStretch(3, 0); |
|
334 |
||
184 | 335 |
groupBox = new QGroupBox(this); |
336 |
groupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
337 |
groupBox->setTitle(QGroupBox::tr("Teams")); |
|
338 |
pageLayout->addWidget(groupBox, 0, 0, 1, 3); |
|
339 |
||
340 |
QGridLayout * GBTlayout = new QGridLayout(groupBox); |
|
341 |
BtnNewTeam = new QPushButton(groupBox); |
|
342 |
BtnNewTeam->setFont(*font14); |
|
343 |
BtnNewTeam->setText(QPushButton::tr("New team")); |
|
344 |
GBTlayout->addWidget(BtnNewTeam, 0, 0); |
|
345 |
||
346 |
CBTeamName = new QComboBox(groupBox); |
|
347 |
GBTlayout->addWidget(CBTeamName, 0, 1); |
|
348 |
||
349 |
BtnEditTeam = new QPushButton(groupBox); |
|
350 |
BtnEditTeam->setFont(*font14); |
|
351 |
BtnEditTeam->setText(QPushButton::tr("Edit team")); |
|
352 |
GBTlayout->addWidget(BtnEditTeam, 0, 2); |
|
353 |
||
354 |
AGGroupBox = new QGroupBox(this); |
|
355 |
AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
356 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
427 | 357 |
pageLayout->addWidget(AGGroupBox, 1, 1); |
184 | 358 |
|
427 | 359 |
QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
436 | 360 |
QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
427 | 361 |
QLabel * resolution = new QLabel(AGGroupBox); |
362 |
resolution->setText(QLabel::tr("Resolution")); |
|
363 |
GBAreslayout->addWidget(resolution); |
|
364 |
||
184 | 365 |
CBResolution = new QComboBox(AGGroupBox); |
555 | 366 |
SDLInteraction sdli; |
367 |
CBResolution->addItems(sdli.getResolutions()); |
|
427 | 368 |
GBAreslayout->addWidget(CBResolution); |
369 |
GBAlayout->addLayout(GBAreslayout); |
|
370 |
||
436 | 371 |
QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
427 | 372 |
QLabel * maxfps = new QLabel(AGGroupBox); |
373 |
maxfps->setText(QLabel::tr("FPS limit")); |
|
374 |
GBAfpslayout->addWidget(maxfps); |
|
375 |
GBAlayout->addLayout(GBAfpslayout); |
|
184 | 376 |
|
377 |
CBFullscreen = new QCheckBox(AGGroupBox); |
|
378 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
427 | 379 |
GBAlayout->addWidget(CBFullscreen); |
184 | 380 |
|
381 |
CBEnableSound = new QCheckBox(AGGroupBox); |
|
382 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
|
427 | 383 |
GBAlayout->addWidget(CBEnableSound); |
184 | 384 |
|
297 | 385 |
CBShowFPS = new QCheckBox(AGGroupBox); |
386 |
CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
427 | 387 |
GBAlayout->addWidget(CBShowFPS); |
297 | 388 |
|
529 | 389 |
CBAltDamage = new QCheckBox(AGGroupBox); |
390 |
CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
391 |
GBAlayout->addWidget(CBAltDamage); |
|
392 |
||
297 | 393 |
fpsedit = new FPSEdit(AGGroupBox); |
427 | 394 |
GBAfpslayout->addWidget(fpsedit); |
184 | 395 |
|
396 |
BtnSaveOptions = new QPushButton(this); |
|
397 |
BtnSaveOptions->setFont(*font14); |
|
398 |
BtnSaveOptions->setText(QPushButton::tr("Save")); |
|
399 |
pageLayout->addWidget(BtnSaveOptions, 4, 2); |
|
400 |
||
401 |
BtnBack = new QPushButton(this); |
|
402 |
BtnBack->setFont(*font14); |
|
403 |
BtnBack->setText(QPushButton::tr("Back")); |
|
404 |
pageLayout->addWidget(BtnBack, 4, 0); |
|
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
405 |
|
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
406 |
WeaponsButt = new QPushButton(this); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
407 |
WeaponsButt->setFont(*font14); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
408 |
WeaponsButt->setText(QPushButton::tr("Weapons scheme")); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
409 |
pageLayout->addWidget(WeaponsButt, 1, 0); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
410 |
|
647 | 411 |
NNGroupBox = new QGroupBox(this); |
412 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
413 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
|
414 |
pageLayout->addWidget(NNGroupBox, 1, 2); |
|
415 |
||
416 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
417 |
labelNN = new QLabel(NNGroupBox); |
|
418 |
labelNN->setText(QLabel::tr("Net nick")); |
|
419 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
420 |
||
421 |
editNetNick = new QLineEdit(NNGroupBox); |
|
422 |
editNetNick->setMaxLength(20); |
|
423 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
424 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
184 | 425 |
} |
426 |
||
427 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
428 |
{ |
|
429 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
430 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
431 |
pageLayout->setColumnStretch(0, 1); |
|
432 |
pageLayout->setColumnStretch(1, 1); |
|
617 | 433 |
pageLayout->setColumnStretch(2, 1); |
421 | 434 |
|
435 |
BtnNetSvrStart = new QPushButton(this); |
|
436 |
BtnNetSvrStart->setFont(*font14); |
|
437 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
617 | 438 |
pageLayout->addWidget(BtnNetSvrStart, 3, 2); |
184 | 439 |
|
636 | 440 |
QGroupBox * NetTypeGroupBox = new QGroupBox(this); |
441 |
NetTypeGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
668 | 442 |
NetTypeGroupBox->setTitle(QGroupBox::tr("Servers list")); |
636 | 443 |
pageLayout->addWidget(NetTypeGroupBox, 0, 1); |
444 |
||
445 |
QVBoxLayout * GBTlayout = new QVBoxLayout(NetTypeGroupBox); |
|
446 |
rbLocalGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 447 |
rbLocalGame->setText(tr("Local")); |
636 | 448 |
rbLocalGame->setChecked(true); |
449 |
GBTlayout->addWidget(rbLocalGame); |
|
450 |
rbInternetGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 451 |
rbInternetGame->setText(tr("Internet")); |
636 | 452 |
GBTlayout->addWidget(rbInternetGame); |
453 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
454 |
ConnGroupBox = new QGroupBox(this); |
421 | 455 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
456 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
457 |
GBClayout = new QGridLayout(ConnGroupBox); |
646 | 458 |
GBClayout->setColumnStretch(0, 1); |
421 | 459 |
GBClayout->setColumnStretch(1, 1); |
460 |
GBClayout->setColumnStretch(2, 1); |
|
184 | 461 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
462 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 463 |
BtnNetConnect->setFont(*font14); |
464 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
646 | 465 |
GBClayout->addWidget(BtnNetConnect, 2, 2); |
416 | 466 |
|
665 | 467 |
tvServersList = new QTableView(ConnGroupBox); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
468 |
tvServersList->setSelectionBehavior(QAbstractItemView::SelectRows); |
665 | 469 |
GBClayout->addWidget(tvServersList, 1, 0, 1, 3); |
421 | 470 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
471 |
BtnUpdateSList = new QPushButton(ConnGroupBox); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
472 |
BtnUpdateSList->setFont(*font14); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
473 |
BtnUpdateSList->setText(QPushButton::tr("Update")); |
646 | 474 |
GBClayout->addWidget(BtnUpdateSList, 2, 0); |
314 | 475 |
|
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
476 |
BtnSpecifyServer = new QPushButton(ConnGroupBox); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
477 |
BtnSpecifyServer->setFont(*font14); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
478 |
BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
479 |
GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
480 |
|
184 | 481 |
BtnBack = new QPushButton(this); |
482 |
BtnBack->setFont(*font14); |
|
483 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 484 |
pageLayout->addWidget(BtnBack, 3, 0); |
636 | 485 |
|
646 | 486 |
connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(updateServersList())); |
668 | 487 |
connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
184 | 488 |
} |
489 |
||
646 | 490 |
void PageNet::updateServersList() |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
491 |
{ |
636 | 492 |
if (rbLocalGame->isChecked()) |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
493 |
tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
667 | 494 |
else |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
495 |
tvServersList->setModel(new HWNetWwwModel(tvServersList)); |
659 | 496 |
|
673 | 497 |
tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
498 |
||
665 | 499 |
static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
500 |
|
665 | 501 |
connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList())); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
502 |
connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect())); |
646 | 503 |
} |
504 |
||
505 |
void PageNet::slotConnect() |
|
506 |
{ |
|
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
507 |
HWNetServersModel * model = static_cast<HWNetServersModel *>(tvServersList->model()); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
508 |
QModelIndex mi = tvServersList->currentIndex(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
509 |
if(!mi.isValid()) |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
510 |
{ |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
511 |
QMessageBox::information(this, tr("Error"), tr("Please, select server from the list above")); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
512 |
return; |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
513 |
} |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
514 |
QString host = model->index(mi.row(), 1).data().toString(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
515 |
quint16 port = model->index(mi.row(), 2).data().toUInt(); |
672
08ed55ea1e2a
- Fix a bug when server fails to start, and then connecting to another server on the same host (strange, the fix won't work on my machine)
unc0rr
parents:
671
diff
changeset
|
516 |
|
08ed55ea1e2a
- Fix a bug when server fails to start, and then connecting to another server on the same host (strange, the fix won't work on my machine)
unc0rr
parents:
671
diff
changeset
|
517 |
emit connectClicked(host, port); |
646 | 518 |
} |
519 |
||
520 |
PageNetServer::PageNetServer(QWidget* parent) : QWidget(parent) |
|
521 |
{ |
|
522 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
523 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
524 |
pageLayout->setColumnStretch(0, 1); |
|
525 |
pageLayout->setColumnStretch(1, 1); |
|
526 |
pageLayout->setColumnStretch(2, 1); |
|
527 |
||
675 | 528 |
pageLayout->setRowStretch(0, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
529 |
pageLayout->setRowStretch(1, 0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
530 |
|
646 | 531 |
BtnBack = new QPushButton(this); |
532 |
BtnBack->setFont(*font14); |
|
533 |
BtnBack->setText(QPushButton::tr("Back")); |
|
675 | 534 |
pageLayout->addWidget(BtnBack, 1, 0); |
646 | 535 |
|
536 |
BtnStart = new QPushButton(this); |
|
537 |
BtnStart->setFont(*font14); |
|
538 |
BtnStart->setText(QPushButton::tr("Start")); |
|
675 | 539 |
pageLayout->addWidget(BtnStart, 1, 2); |
540 |
||
541 |
QWidget * wg = new QWidget(this); |
|
542 |
pageLayout->addWidget(wg, 0, 0, 1, 3); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
543 |
|
675 | 544 |
QGridLayout * wgLayout = new QGridLayout(wg); |
545 |
wgLayout->setColumnStretch(0, 1); |
|
546 |
wgLayout->setColumnStretch(1, 3); |
|
547 |
wgLayout->setColumnStretch(2, 1); |
|
548 |
||
549 |
wgLayout->setRowStretch(0, 0); |
|
550 |
wgLayout->setRowStretch(1, 1); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
551 |
|
675 | 552 |
QGroupBox * gb = new QGroupBox(wg); |
553 |
wgLayout->addWidget(gb, 0, 1); |
|
554 |
||
555 |
QGridLayout * gbLayout = new QGridLayout(gb); |
|
556 |
||
557 |
labelSD = new QLabel(gb); |
|
558 |
labelSD->setText(QLabel::tr("Server name:")); |
|
559 |
gbLayout->addWidget(labelSD, 0, 0); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
560 |
|
675 | 561 |
leServerDescr = new QLineEdit(gb); |
562 |
gbLayout->addWidget(leServerDescr, 0, 1); |
|
563 |
||
564 |
labelPort = new QLabel(gb); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
565 |
labelPort->setText(QLabel::tr("Server port:")); |
675 | 566 |
gbLayout->addWidget(labelPort, 1, 0); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
567 |
|
675 | 568 |
sbPort = new QSpinBox(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
569 |
sbPort->setMinimum(0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
570 |
sbPort->setMaximum(65535); |
675 | 571 |
gbLayout->addWidget(sbPort, 1, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
572 |
|
675 | 573 |
BtnDefault = new QPushButton(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
574 |
BtnDefault->setText(QPushButton::tr("default")); |
675 | 575 |
gbLayout->addWidget(BtnDefault, 1, 2); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
576 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
577 |
connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort())); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
578 |
} |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
579 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
580 |
void PageNetServer::setDefaultPort() |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
581 |
{ |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
582 |
sbPort->setValue(46631); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
583 |
} |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
584 |
|
184 | 585 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
586 |
{ |
|
587 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
588 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 589 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 590 |
//pageLayout->setSpacing(1); |
591 |
//pageLayout->setMargin(1); |
|
463 | 592 |
pageLayout->setColumnStretch(0, 50); |
593 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 594 |
|
461 | 595 |
// chatwidget |
596 |
pChatWidget = new HWChatWidget(this); |
|
597 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 598 |
pageLayout->setRowStretch(1, 100); |
453 | 599 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
600 |
pGameCFG = new GameCFGWidget(this); |
322 | 601 |
pageLayout->addWidget(pGameCFG, 0, 0); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
602 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
603 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 604 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 605 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 606 |
|
607 |
BtnBack = new QPushButton(this); |
|
608 |
BtnBack->setFont(*font14); |
|
609 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 610 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 611 |
|
646 | 612 |
BtnGo = new QPushButton(this); |
184 | 613 |
BtnGo->setFont(*font14); |
614 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 615 |
BtnGo->setEnabled(false); |
461 | 616 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 617 |
} |
187 | 618 |
|
619 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
620 |
{ |
|
621 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
622 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
623 |
pageLayout->setColumnStretch(0, 1); |
|
624 |
pageLayout->setColumnStretch(1, 1); |
|
625 |
pageLayout->setColumnStretch(2, 1); |
|
626 |
||
627 |
BtnBack = new QPushButton(this); |
|
628 |
BtnBack->setFont(*font14); |
|
629 |
BtnBack->setText(QPushButton::tr("Back")); |
|
630 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
631 |
||
632 |
about = new About(this); |
|
633 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
634 |
} |
|
306 | 635 |
|
636 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
637 |
{ |
|
638 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
639 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
640 |
pageLayout->setColumnStretch(0, 1); |
|
641 |
pageLayout->setColumnStretch(1, 1); |
|
642 |
pageLayout->setColumnStretch(2, 1); |
|
643 |
||
644 |
BtnBack = new QPushButton(this); |
|
645 |
BtnBack->setFont(*font14); |
|
646 |
BtnBack->setText(QPushButton::tr("Back")); |
|
647 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
648 |
||
307 | 649 |
labelGameStats = new QLabel(this); |
650 |
labelGameStats->setTextFormat(Qt::RichText); |
|
651 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 652 |
} |
586 | 653 |
|
654 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent) |
|
655 |
{ |
|
656 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
657 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
658 |
pageLayout->setMargin(25); |
|
659 |
pageLayout->setColumnStretch(0, 1); |
|
660 |
pageLayout->setColumnStretch(1, 2); |
|
661 |
pageLayout->setColumnStretch(2, 1); |
|
588 | 662 |
pageLayout->setRowStretch(0, 1); |
663 |
pageLayout->setRowStretch(3, 1); |
|
586 | 664 |
|
665 |
BtnSimpleGamePage = new QPushButton(this); |
|
666 |
BtnSimpleGamePage->setFont(*font14); |
|
667 |
BtnSimpleGamePage->setText(QPushButton::tr("Simple Game")); |
|
588 | 668 |
pageLayout->addWidget(BtnSimpleGamePage, 1, 1); |
586 | 669 |
|
670 |
BtnTrainPage = new QPushButton(this); |
|
671 |
BtnTrainPage->setFont(*font14); |
|
672 |
BtnTrainPage->setText(QPushButton::tr("Training")); |
|
588 | 673 |
pageLayout->addWidget(BtnTrainPage, 2, 1); |
586 | 674 |
|
675 |
BtnBack = new QPushButton(this); |
|
676 |
BtnBack->setFont(*font14); |
|
677 |
BtnBack->setText(QPushButton::tr("Back")); |
|
588 | 678 |
pageLayout->addWidget(BtnBack, 4, 0); |
586 | 679 |
|
680 |
} |
|
681 |
||
587 | 682 |
PageTraining::PageTraining(QWidget* parent) : QWidget(parent) |
683 |
{ |
|
684 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
685 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
686 |
pageLayout->setMargin(25); |
|
687 |
pageLayout->setColumnStretch(0, 1); |
|
688 |
pageLayout->setColumnStretch(1, 2); |
|
689 |
pageLayout->setColumnStretch(2, 1); |
|
690 |
||
691 |
BtnStartTrain = new QPushButton(this); |
|
692 |
BtnStartTrain->setFont(*font14); |
|
693 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
694 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
695 |
||
696 |
BtnBack = new QPushButton(this); |
|
697 |
BtnBack->setFont(*font14); |
|
698 |
BtnBack->setText(QPushButton::tr("Back")); |
|
699 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
700 |
} |
|
701 |
||
600 | 702 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : QWidget(parent) |
703 |
{ |
|
704 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
705 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
706 |
pageLayout->setMargin(25); |
|
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
707 |
//pageLayout->setColumnStretch(0, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
708 |
//pageLayout->setColumnStretch(1, 2); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
709 |
//pageLayout->setColumnStretch(2, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
710 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
711 |
pWeapons=new SelWeaponWidget(this); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
712 |
pageLayout->addWidget(pWeapons, 0, 0); |
600 | 713 |
|
714 |
BtnBack = new QPushButton(this); |
|
715 |
BtnBack->setFont(*font14); |
|
716 |
BtnBack->setText(QPushButton::tr("Back")); |
|
717 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
718 |
} |
|
719 |