author | displacer |
Mon, 24 Sep 2007 20:34:28 +0000 | |
changeset 612 | 333d095319de |
parent 603 | d7877468653b |
child 617 | 127510b442ca |
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> |
184 | 31 |
|
32 |
#include "pages.h" |
|
33 |
#include "sdlkeys.h" |
|
34 |
#include "hwconsts.h" |
|
35 |
#include "gamecfgwidget.h" |
|
36 |
#include "teamselect.h" |
|
37 |
#include "gamecfgwidget.h" |
|
38 |
#include "SquareLabel.h" |
|
39 |
#include "mapContainer.h" |
|
187 | 40 |
#include "about.h" |
297 | 41 |
#include "fpsedit.h" |
412 | 42 |
#include "netudpwidget.h" |
461 | 43 |
#include "chatwidget.h" |
555 | 44 |
#include "SDLs.h" |
579 | 45 |
#include "playrecordpage.h" |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
46 |
#include "selectWeapon.h" |
184 | 47 |
|
48 |
PageMain::PageMain(QWidget* parent) : QWidget(parent) |
|
49 |
{ |
|
50 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
51 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
52 |
pageLayout->setMargin(25); |
|
53 |
pageLayout->setColumnStretch(0, 1); |
|
54 |
pageLayout->setColumnStretch(1, 2); |
|
55 |
pageLayout->setColumnStretch(2, 1); |
|
56 |
||
57 |
BtnSinglePlayer = new QPushButton(this); |
|
58 |
BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
59 |
BtnSinglePlayer->setFont(*font14); |
|
60 |
BtnSinglePlayer->setText(QPushButton::tr("Single Player")); |
|
586 | 61 |
pageLayout->addWidget(BtnSinglePlayer, 0, 1); |
184 | 62 |
|
63 |
BtnMultiplayer = new QPushButton(this); |
|
64 |
BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
65 |
BtnMultiplayer->setFont(*font14); |
|
66 |
BtnMultiplayer->setText(QPushButton::tr("Multiplayer")); |
|
586 | 67 |
pageLayout->addWidget(BtnMultiplayer, 1, 1); |
184 | 68 |
|
69 |
BtnNet = new QPushButton(this); |
|
70 |
BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
71 |
BtnNet->setFont(*font14); |
|
72 |
BtnNet->setText(QPushButton::tr("Net game")); |
|
586 | 73 |
pageLayout->addWidget(BtnNet, 2, 1); |
184 | 74 |
|
579 | 75 |
BtnLoad = new QPushButton(this); |
76 |
BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
77 |
BtnLoad->setFont(*font14); |
|
78 |
BtnLoad->setText(QPushButton::tr("Load")); |
|
586 | 79 |
pageLayout->addWidget(BtnLoad, 3, 1); |
579 | 80 |
|
184 | 81 |
BtnDemos = new QPushButton(this); |
82 |
BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
83 |
BtnDemos->setFont(*font14); |
|
84 |
BtnDemos->setText(QPushButton::tr("Demos")); |
|
586 | 85 |
pageLayout->addWidget(BtnDemos, 4, 1); |
184 | 86 |
|
87 |
BtnSetup = new QPushButton(this); |
|
88 |
BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
89 |
BtnSetup->setFont(*font14); |
|
90 |
BtnSetup->setText(QPushButton::tr("Setup")); |
|
586 | 91 |
pageLayout->addWidget(BtnSetup, 5, 1); |
184 | 92 |
|
187 | 93 |
BtnInfo = new QPushButton(this); |
94 |
BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
95 |
BtnInfo->setFont(*font14); |
|
96 |
BtnInfo->setText(QPushButton::tr("About")); |
|
586 | 97 |
pageLayout->addWidget(BtnInfo, 6, 1); |
187 | 98 |
|
184 | 99 |
BtnExit = new QPushButton(parent); |
100 |
BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
101 |
BtnExit->setFont(*font14); |
|
102 |
BtnExit->setText(QPushButton::tr("Exit")); |
|
187 | 103 |
pageLayout->addWidget(BtnExit, 7, 1); |
184 | 104 |
} |
105 |
||
585
7531ae5b146e
Rename PageLocalGame -> PageSimpleGame due to future changes
unc0rr
parents:
579
diff
changeset
|
106 |
PageSimpleGame::PageSimpleGame(QWidget* parent) : QWidget(parent) |
184 | 107 |
{ |
108 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
440 | 109 |
QVBoxLayout * pageLayout = new QVBoxLayout(this); |
110 |
QHBoxLayout * topLayout = new QHBoxLayout(); |
|
111 |
QHBoxLayout * bottomLayout = new QHBoxLayout(); |
|
112 |
pageLayout->addLayout(topLayout, 100); |
|
113 |
pageLayout->addLayout(bottomLayout, 0); |
|
114 |
||
115 |
BtnBack = new QPushButton(this); |
|
184 | 116 |
BtnBack->setFont(*font14); |
117 |
BtnBack->setText(QPushButton::tr("Back")); |
|
440 | 118 |
bottomLayout->addWidget(BtnBack, 100); |
119 |
bottomLayout->addStretch(100); |
|
586 | 120 |
BtnSimpleGame = new QPushButton(this); |
184 | 121 |
BtnSimpleGame->setFont(*font14); |
122 |
BtnSimpleGame->setText(QPushButton::tr("Simple Game")); |
|
440 | 123 |
bottomLayout->addWidget(BtnSimpleGame, 100); |
124 |
||
184 | 125 |
gameCFG = new GameCFGWidget(this); |
440 | 126 |
topLayout->addStretch(100); |
127 |
topLayout->addWidget(gameCFG); |
|
128 |
topLayout->addStretch(100); |
|
184 | 129 |
} |
130 |
||
131 |
PageEditTeam::PageEditTeam(QWidget* parent) : QWidget(parent) |
|
132 |
{ |
|
133 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
134 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
310 | 135 |
pageLayout->setColumnStretch(0, 1); |
184 | 136 |
pageLayout->setColumnMinimumWidth(0, 150); |
137 |
pageLayout->setColumnStretch(1, 100); |
|
336 | 138 |
pageLayout->setColumnMinimumWidth(1, 210); |
451 | 139 |
pageLayout->setColumnStretch(2, 75); |
336 | 140 |
pageLayout->setColumnMinimumWidth(2, 110); |
451 | 141 |
pageLayout->setColumnStretch(3, 75); |
336 | 142 |
pageLayout->setColumnMinimumWidth(3, 110); |
184 | 143 |
|
144 |
GBoxTeam = new QGroupBox(this); |
|
145 |
GBoxTeam->setTitle(QGroupBox::tr("Team")); |
|
146 |
GBoxTeam->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
147 |
QGridLayout * GBTLayout = new QGridLayout(GBoxTeam); |
|
148 |
TeamNameEdit = new QLineEdit(GBoxTeam); |
|
149 |
TeamNameEdit->setMaxLength(15); |
|
231 | 150 |
GBTLayout->addWidget(TeamNameEdit, 0, 0, 1, 0); |
151 |
||
184 | 152 |
pageLayout->addWidget(GBoxTeam, 0, 0); |
153 |
||
588 | 154 |
GBoxHedgehogs = new QGroupBox(this); |
184 | 155 |
GBoxHedgehogs->setTitle(QGroupBox::tr("Team Members")); |
156 |
GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
157 |
QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs); |
|
158 |
for(int i = 0; i < 8; i++) |
|
159 |
{ |
|
160 |
HHNameEdit[i] = new QLineEdit(GBoxHedgehogs); |
|
161 |
HHNameEdit[i]->setGeometry(QRect(10, 20 + i * 30, 141, 20)); |
|
162 |
HHNameEdit[i]->setMaxLength(15); |
|
163 |
GBHLayout->addWidget(HHNameEdit[i]); |
|
164 |
} |
|
165 |
pageLayout->addWidget(GBoxHedgehogs, 1, 0, 2, 1); |
|
166 |
||
167 |
BtnTeamDiscard = new QPushButton(this); |
|
168 |
BtnTeamDiscard->setFont(*font14); |
|
169 |
BtnTeamDiscard->setText(QPushButton::tr("Discard")); |
|
170 |
pageLayout->addWidget(BtnTeamDiscard, 4, 0); |
|
171 |
||
588 | 172 |
GBoxBinds = new QGroupBox(this); |
184 | 173 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
174 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
|
175 |
BindsBox = new QToolBox(GBoxBinds); |
|
176 |
BindsBox->setLineWidth(0); |
|
177 |
GBBLayout->addWidget(BindsBox); |
|
178 |
page_A = new QWidget(); |
|
179 |
BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
|
180 |
page_W = new QWidget(); |
|
181 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
|
182 |
page_WP = new QWidget(); |
|
183 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
|
184 |
page_O = new QWidget(); |
|
185 |
BindsBox->addItem(page_O, QToolBox::tr("Other")); |
|
186 |
pageLayout->addWidget(GBoxBinds, 0, 1, 5, 1); |
|
187 |
||
188 |
QStringList binds; |
|
189 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
190 |
{ |
|
191 |
binds << sdlkeys[i][1]; |
|
192 |
} |
|
193 |
||
194 |
quint16 widind = 0, i = 0; |
|
195 |
while (i < BINDS_NUMBER) { |
|
196 |
quint16 num = 0; |
|
197 |
QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind)); |
|
198 |
do { |
|
199 |
LBind[i] = new QLabel(BindsBox->widget(widind)); |
|
200 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
|
201 |
LBind[i]->setAlignment(Qt::AlignRight); |
|
202 |
pagelayout->addWidget(LBind[i], num, 0); |
|
203 |
CBBind[i] = new QComboBox(BindsBox->widget(widind)); |
|
204 |
CBBind[i]->addItems(binds); |
|
205 |
pagelayout->addWidget(CBBind[i], num, 1); |
|
206 |
num++; |
|
207 |
} while (!cbinds[i++].chwidget); |
|
208 |
pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2); |
|
209 |
widind++; |
|
210 |
} |
|
211 |
||
588 | 212 |
GBoxGrave = new QGroupBox(this); |
184 | 213 |
GBoxGrave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
214 |
GBoxGrave->setTitle(QGroupBox::tr("Grave")); |
|
215 |
QGridLayout * GBGLayout = new QGridLayout(GBoxGrave); |
|
216 |
CBGrave = new QComboBox(GBoxGrave); |
|
217 |
CBGrave->setMaxCount(65535); |
|
218 |
GBGLayout->addWidget(CBGrave, 0, 0, 1, 3); |
|
219 |
GravePreview = new QLabel(GBoxGrave); |
|
220 |
GravePreview->setScaledContents(false); |
|
336 | 221 |
pageLayout->addWidget(GBoxGrave, 0, 3, 2, 1); |
184 | 222 |
GBGLayout->addWidget(GravePreview, 1, 1); |
336 | 223 |
|
224 |
GBoxTeamLvl = new QGroupBox(this); |
|
225 |
GBoxTeamLvl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
226 |
GBoxTeamLvl->setTitle(QGroupBox::tr("Team level")); |
|
227 |
QGridLayout * GBTLLayout = new QGridLayout(GBoxTeamLvl); |
|
228 |
CBTeamLvl = new QComboBox(GBoxTeamLvl); |
|
229 |
CBTeamLvl->addItem(QComboBox::tr("Human")); |
|
427 | 230 |
CBTeamLvl->addItem(QComboBox::tr("Level 5")); |
231 |
CBTeamLvl->addItem(QComboBox::tr("Level 4")); |
|
336 | 232 |
CBTeamLvl->addItem(QComboBox::tr("Level 3")); |
427 | 233 |
CBTeamLvl->addItem(QComboBox::tr("Level 2")); |
234 |
CBTeamLvl->addItem(QComboBox::tr("Level 1")); |
|
336 | 235 |
CBTeamLvl->setMaxCount(6); |
236 |
GBTLLayout->addWidget(CBTeamLvl, 0, 0, 1, 3); |
|
237 |
LevelPict = new QLabel(GBoxTeamLvl); |
|
238 |
LevelPict->setScaledContents(false); |
|
239 |
LevelPict->setFixedSize(32, 32); |
|
240 |
pageLayout->addWidget(GBoxTeamLvl, 0, 2, 2, 1); |
|
241 |
GBTLLayout->addWidget(LevelPict, 1, 1); |
|
184 | 242 |
|
243 |
GBoxFort = new QGroupBox(this); |
|
244 |
GBoxFort->setTitle(QGroupBox::tr("Fort")); |
|
245 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort); |
|
246 |
CBFort = new QComboBox(GBoxFort); |
|
247 |
CBFort->setMaxCount(65535); |
|
248 |
GBFLayout->addWidget(CBFort, 0, 0); |
|
588 | 249 |
FortPreview = new SquareLabel(GBoxFort); |
310 | 250 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
184 | 251 |
FortPreview->setPixmap(QPixmap()); |
252 |
GBFLayout->addWidget(FortPreview, 1, 0); |
|
336 | 253 |
pageLayout->addWidget(GBoxFort, 2, 2, 1, 2); |
184 | 254 |
|
588 | 255 |
BtnTeamSave = new QPushButton(this); |
184 | 256 |
BtnTeamSave->setFont(*font14); |
257 |
BtnTeamSave->setText(QPushButton::tr("Save")); |
|
336 | 258 |
pageLayout->addWidget(BtnTeamSave, 4, 2, 1, 2); |
184 | 259 |
|
260 |
QDir tmpdir; |
|
261 |
tmpdir.cd(datadir->absolutePath()); |
|
262 |
tmpdir.cd("Forts"); |
|
263 |
tmpdir.setFilter(QDir::Files); |
|
264 |
||
603 | 265 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1")); |
184 | 266 |
tmpdir.cd("../Graphics/Graves"); |
267 |
QStringList list = tmpdir.entryList(QStringList("*.png")); |
|
268 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
|
269 |
{ |
|
603 | 270 |
CBGrave->addItem((*it).replace(QRegExp("^(.*)\\.png"), "\\1")); |
184 | 271 |
} |
272 |
||
273 |
connect(CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
|
336 | 274 |
connect(CBTeamLvl, SIGNAL(activated(int)), this, SLOT(CBTeamLvl_activated(int))); |
184 | 275 |
connect(CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
276 |
} |
|
277 |
||
278 |
void PageEditTeam::CBGrave_activated(const QString & gravename) |
|
279 |
{ |
|
280 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png"); |
|
281 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32)); |
|
282 |
} |
|
283 |
||
284 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
285 |
{ |
|
286 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
|
287 |
FortPreview->setPixmap(pix); |
|
288 |
} |
|
289 |
||
336 | 290 |
void PageEditTeam::CBTeamLvl_activated(int id) |
291 |
{ |
|
292 |
QPixmap pix(QString(":/res/botlevels/%1.png").arg(id)); |
|
293 |
LevelPict->setPixmap(pix); |
|
294 |
} |
|
295 |
||
184 | 296 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : QWidget(parent) |
297 |
{ |
|
298 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
299 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
300 |
||
301 |
BtnBack = new QPushButton(this); |
|
302 |
BtnBack->setFont(*font14); |
|
303 |
BtnBack->setText(QPushButton::tr("Back")); |
|
304 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
187 | 305 |
|
184 | 306 |
gameCFG = new GameCFGWidget(this); |
307 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2); |
|
308 |
teamsSelect = new TeamSelWidget(this); |
|
309 |
pageLayout->addWidget(teamsSelect, 0, 2, 1, 2); |
|
310 |
||
311 |
BtnStartMPGame = new QPushButton(this); |
|
312 |
BtnStartMPGame->setFont(*font14); |
|
313 |
BtnStartMPGame->setText(QPushButton::tr("Start")); |
|
314 |
pageLayout->addWidget(BtnStartMPGame, 1, 3); |
|
315 |
} |
|
316 |
||
317 |
PageOptions::PageOptions(QWidget* parent) : QWidget(parent) |
|
318 |
{ |
|
319 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
320 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
427 | 321 |
pageLayout->setColumnStretch(0, 100); |
322 |
pageLayout->setColumnStretch(1, 100); |
|
323 |
pageLayout->setColumnStretch(2, 100); |
|
324 |
pageLayout->setRowStretch(0, 0); |
|
325 |
pageLayout->setRowStretch(1, 0); |
|
326 |
pageLayout->setRowStretch(2, 100); |
|
327 |
pageLayout->setRowStretch(3, 0); |
|
328 |
||
184 | 329 |
groupBox = new QGroupBox(this); |
330 |
groupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
331 |
groupBox->setTitle(QGroupBox::tr("Teams")); |
|
332 |
pageLayout->addWidget(groupBox, 0, 0, 1, 3); |
|
333 |
||
334 |
QGridLayout * GBTlayout = new QGridLayout(groupBox); |
|
335 |
BtnNewTeam = new QPushButton(groupBox); |
|
336 |
BtnNewTeam->setFont(*font14); |
|
337 |
BtnNewTeam->setText(QPushButton::tr("New team")); |
|
338 |
GBTlayout->addWidget(BtnNewTeam, 0, 0); |
|
339 |
||
340 |
CBTeamName = new QComboBox(groupBox); |
|
341 |
GBTlayout->addWidget(CBTeamName, 0, 1); |
|
342 |
||
343 |
BtnEditTeam = new QPushButton(groupBox); |
|
344 |
BtnEditTeam->setFont(*font14); |
|
345 |
BtnEditTeam->setText(QPushButton::tr("Edit team")); |
|
346 |
GBTlayout->addWidget(BtnEditTeam, 0, 2); |
|
347 |
||
348 |
AGGroupBox = new QGroupBox(this); |
|
349 |
AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
350 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
427 | 351 |
pageLayout->addWidget(AGGroupBox, 1, 1); |
184 | 352 |
|
427 | 353 |
QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
436 | 354 |
QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
427 | 355 |
QLabel * resolution = new QLabel(AGGroupBox); |
356 |
resolution->setText(QLabel::tr("Resolution")); |
|
357 |
GBAreslayout->addWidget(resolution); |
|
358 |
||
184 | 359 |
CBResolution = new QComboBox(AGGroupBox); |
555 | 360 |
SDLInteraction sdli; |
361 |
CBResolution->addItems(sdli.getResolutions()); |
|
427 | 362 |
GBAreslayout->addWidget(CBResolution); |
363 |
GBAlayout->addLayout(GBAreslayout); |
|
364 |
||
436 | 365 |
QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
427 | 366 |
QLabel * maxfps = new QLabel(AGGroupBox); |
367 |
maxfps->setText(QLabel::tr("FPS limit")); |
|
368 |
GBAfpslayout->addWidget(maxfps); |
|
369 |
GBAlayout->addLayout(GBAfpslayout); |
|
184 | 370 |
|
371 |
CBFullscreen = new QCheckBox(AGGroupBox); |
|
372 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
427 | 373 |
GBAlayout->addWidget(CBFullscreen); |
184 | 374 |
|
375 |
CBEnableSound = new QCheckBox(AGGroupBox); |
|
376 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
|
427 | 377 |
GBAlayout->addWidget(CBEnableSound); |
184 | 378 |
|
297 | 379 |
CBShowFPS = new QCheckBox(AGGroupBox); |
380 |
CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
427 | 381 |
GBAlayout->addWidget(CBShowFPS); |
297 | 382 |
|
529 | 383 |
CBAltDamage = new QCheckBox(AGGroupBox); |
384 |
CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
385 |
GBAlayout->addWidget(CBAltDamage); |
|
386 |
||
297 | 387 |
fpsedit = new FPSEdit(AGGroupBox); |
427 | 388 |
GBAfpslayout->addWidget(fpsedit); |
184 | 389 |
|
390 |
BtnSaveOptions = new QPushButton(this); |
|
391 |
BtnSaveOptions->setFont(*font14); |
|
392 |
BtnSaveOptions->setText(QPushButton::tr("Save")); |
|
393 |
pageLayout->addWidget(BtnSaveOptions, 4, 2); |
|
394 |
||
395 |
BtnBack = new QPushButton(this); |
|
396 |
BtnBack->setFont(*font14); |
|
397 |
BtnBack->setText(QPushButton::tr("Back")); |
|
398 |
pageLayout->addWidget(BtnBack, 4, 0); |
|
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
399 |
|
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
400 |
WeaponsButt = new QPushButton(this); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
401 |
WeaponsButt->setFont(*font14); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
402 |
WeaponsButt->setText(QPushButton::tr("Weapons scheme")); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
403 |
pageLayout->addWidget(WeaponsButt, 1, 0); |
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
588
diff
changeset
|
404 |
|
184 | 405 |
} |
406 |
||
407 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
408 |
{ |
|
409 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
410 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
411 |
pageLayout->setColumnStretch(0, 1); |
|
412 |
pageLayout->setColumnStretch(1, 1); |
|
421 | 413 |
|
414 |
BtnNetSvrStart = new QPushButton(this); |
|
415 |
BtnNetSvrStart->setFont(*font14); |
|
416 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
417 |
pageLayout->addWidget(BtnNetSvrStart, 0, 1); |
|
184 | 418 |
|
419 |
NNGroupBox = new QGroupBox(this); |
|
314 | 420 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
184 | 421 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
421 | 422 |
pageLayout->addWidget(NNGroupBox, 0, 0); |
184 | 423 |
|
424 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
425 |
labelNN = new QLabel(NNGroupBox); |
|
426 |
labelNN->setText(QLabel::tr("Net nick")); |
|
427 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
428 |
||
429 |
editNetNick = new QLineEdit(NNGroupBox); |
|
430 |
editNetNick->setMaxLength(20); |
|
431 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
432 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
433 |
||
421 | 434 |
QGroupBox * ConnGroupBox = new QGroupBox(this); |
435 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
|
436 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
437 |
QGridLayout * GBClayout = new QGridLayout(ConnGroupBox); |
|
438 |
GBClayout->setColumnStretch(0, 0); |
|
439 |
GBClayout->setColumnStretch(1, 1); |
|
440 |
GBClayout->setColumnStretch(2, 1); |
|
441 |
GBClayout->setRowStretch(0, 0); |
|
442 |
GBClayout->setRowStretch(1, 0); |
|
443 |
GBClayout->setRowStretch(2, 1); |
|
444 |
||
445 |
labelIP = new QLabel(ConnGroupBox); |
|
184 | 446 |
labelIP->setText(QLabel::tr("Server address")); |
421 | 447 |
GBClayout->addWidget(labelIP, 0, 0); |
184 | 448 |
|
421 | 449 |
editIP = new QLineEdit(ConnGroupBox); |
184 | 450 |
editIP->setMaxLength(50); |
421 | 451 |
GBClayout->addWidget(editIP, 0, 1); |
184 | 452 |
|
421 | 453 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 454 |
BtnNetConnect->setFont(*font14); |
455 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
421 | 456 |
GBClayout->addWidget(BtnNetConnect, 0, 2); |
416 | 457 |
|
421 | 458 |
pUdpClient=new HWNetUdpWidget(ConnGroupBox); |
459 |
GBClayout->addWidget(pUdpClient, 1, 0, 2, 2); |
|
460 |
||
461 |
pUpdateUdpButt = new QPushButton(ConnGroupBox); |
|
416 | 462 |
pUpdateUdpButt->setFont(*font14); |
463 |
pUpdateUdpButt->setText(QPushButton::tr("Update")); |
|
421 | 464 |
GBClayout->addWidget(pUpdateUdpButt, 1, 2); |
314 | 465 |
|
184 | 466 |
BtnBack = new QPushButton(this); |
467 |
BtnBack->setFont(*font14); |
|
468 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 469 |
pageLayout->addWidget(BtnBack, 3, 0); |
184 | 470 |
} |
471 |
||
472 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
|
473 |
{ |
|
474 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
475 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 476 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 477 |
//pageLayout->setSpacing(1); |
478 |
//pageLayout->setMargin(1); |
|
463 | 479 |
pageLayout->setColumnStretch(0, 50); |
480 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 481 |
|
461 | 482 |
// chatwidget |
483 |
pChatWidget = new HWChatWidget(this); |
|
484 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 485 |
pageLayout->setRowStretch(1, 100); |
453 | 486 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
487 |
pGameCFG = new GameCFGWidget(this); |
322 | 488 |
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
|
489 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
490 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 491 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 492 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 493 |
|
494 |
BtnBack = new QPushButton(this); |
|
495 |
BtnBack->setFont(*font14); |
|
496 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 497 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 498 |
|
499 |
BtnGo = new QPushButton(this); |
|
500 |
BtnGo->setFont(*font14); |
|
501 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 502 |
BtnGo->setEnabled(false); |
461 | 503 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 504 |
} |
187 | 505 |
|
506 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
507 |
{ |
|
508 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
509 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
510 |
pageLayout->setColumnStretch(0, 1); |
|
511 |
pageLayout->setColumnStretch(1, 1); |
|
512 |
pageLayout->setColumnStretch(2, 1); |
|
513 |
||
514 |
BtnBack = new QPushButton(this); |
|
515 |
BtnBack->setFont(*font14); |
|
516 |
BtnBack->setText(QPushButton::tr("Back")); |
|
517 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
518 |
||
519 |
about = new About(this); |
|
520 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
521 |
} |
|
306 | 522 |
|
523 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
524 |
{ |
|
525 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
526 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
527 |
pageLayout->setColumnStretch(0, 1); |
|
528 |
pageLayout->setColumnStretch(1, 1); |
|
529 |
pageLayout->setColumnStretch(2, 1); |
|
530 |
||
531 |
BtnBack = new QPushButton(this); |
|
532 |
BtnBack->setFont(*font14); |
|
533 |
BtnBack->setText(QPushButton::tr("Back")); |
|
534 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
535 |
||
307 | 536 |
labelGameStats = new QLabel(this); |
537 |
labelGameStats->setTextFormat(Qt::RichText); |
|
538 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 539 |
} |
586 | 540 |
|
541 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent) |
|
542 |
{ |
|
543 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
544 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
545 |
pageLayout->setMargin(25); |
|
546 |
pageLayout->setColumnStretch(0, 1); |
|
547 |
pageLayout->setColumnStretch(1, 2); |
|
548 |
pageLayout->setColumnStretch(2, 1); |
|
588 | 549 |
pageLayout->setRowStretch(0, 1); |
550 |
pageLayout->setRowStretch(3, 1); |
|
586 | 551 |
|
552 |
BtnSimpleGamePage = new QPushButton(this); |
|
553 |
BtnSimpleGamePage->setFont(*font14); |
|
554 |
BtnSimpleGamePage->setText(QPushButton::tr("Simple Game")); |
|
588 | 555 |
pageLayout->addWidget(BtnSimpleGamePage, 1, 1); |
586 | 556 |
|
557 |
BtnTrainPage = new QPushButton(this); |
|
558 |
BtnTrainPage->setFont(*font14); |
|
559 |
BtnTrainPage->setText(QPushButton::tr("Training")); |
|
588 | 560 |
pageLayout->addWidget(BtnTrainPage, 2, 1); |
586 | 561 |
|
562 |
BtnBack = new QPushButton(this); |
|
563 |
BtnBack->setFont(*font14); |
|
564 |
BtnBack->setText(QPushButton::tr("Back")); |
|
588 | 565 |
pageLayout->addWidget(BtnBack, 4, 0); |
586 | 566 |
|
567 |
} |
|
568 |
||
587 | 569 |
PageTraining::PageTraining(QWidget* parent) : QWidget(parent) |
570 |
{ |
|
571 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
572 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
573 |
pageLayout->setMargin(25); |
|
574 |
pageLayout->setColumnStretch(0, 1); |
|
575 |
pageLayout->setColumnStretch(1, 2); |
|
576 |
pageLayout->setColumnStretch(2, 1); |
|
577 |
||
578 |
BtnStartTrain = new QPushButton(this); |
|
579 |
BtnStartTrain->setFont(*font14); |
|
580 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
581 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
582 |
||
583 |
BtnBack = new QPushButton(this); |
|
584 |
BtnBack->setFont(*font14); |
|
585 |
BtnBack->setText(QPushButton::tr("Back")); |
|
586 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
587 |
} |
|
588 |
||
600 | 589 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : QWidget(parent) |
590 |
{ |
|
591 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
592 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
593 |
pageLayout->setMargin(25); |
|
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
594 |
//pageLayout->setColumnStretch(0, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
595 |
//pageLayout->setColumnStretch(1, 2); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
596 |
//pageLayout->setColumnStretch(2, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
597 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
598 |
pWeapons=new SelWeaponWidget(this); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
599 |
pageLayout->addWidget(pWeapons, 0, 0); |
600 | 600 |
|
601 |
BtnBack = new QPushButton(this); |
|
602 |
BtnBack->setFont(*font14); |
|
603 |
BtnBack->setText(QPushButton::tr("Back")); |
|
604 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
605 |
} |
|
606 |