author | displacer |
Fri, 30 Nov 2007 18:31:41 +0000 | |
changeset 624 | e7673b036db5 |
parent 617 | 127510b442ca |
child 632 | 5e09ae25729f |
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); |
|
617 | 413 |
pageLayout->setColumnStretch(2, 1); |
421 | 414 |
|
415 |
BtnNetSvrStart = new QPushButton(this); |
|
416 |
BtnNetSvrStart->setFont(*font14); |
|
417 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
617 | 418 |
pageLayout->addWidget(BtnNetSvrStart, 3, 2); |
184 | 419 |
|
420 |
NNGroupBox = new QGroupBox(this); |
|
314 | 421 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
184 | 422 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
421 | 423 |
pageLayout->addWidget(NNGroupBox, 0, 0); |
184 | 424 |
|
425 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
426 |
labelNN = new QLabel(NNGroupBox); |
|
427 |
labelNN->setText(QLabel::tr("Net nick")); |
|
428 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
429 |
||
430 |
editNetNick = new QLineEdit(NNGroupBox); |
|
431 |
editNetNick->setMaxLength(20); |
|
432 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
433 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
434 |
||
421 | 435 |
QGroupBox * ConnGroupBox = new QGroupBox(this); |
436 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
|
437 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
438 |
QGridLayout * GBClayout = new QGridLayout(ConnGroupBox); |
|
439 |
GBClayout->setColumnStretch(0, 0); |
|
440 |
GBClayout->setColumnStretch(1, 1); |
|
441 |
GBClayout->setColumnStretch(2, 1); |
|
442 |
GBClayout->setRowStretch(0, 0); |
|
443 |
GBClayout->setRowStretch(1, 0); |
|
444 |
GBClayout->setRowStretch(2, 1); |
|
445 |
||
446 |
labelIP = new QLabel(ConnGroupBox); |
|
184 | 447 |
labelIP->setText(QLabel::tr("Server address")); |
421 | 448 |
GBClayout->addWidget(labelIP, 0, 0); |
184 | 449 |
|
421 | 450 |
editIP = new QLineEdit(ConnGroupBox); |
184 | 451 |
editIP->setMaxLength(50); |
421 | 452 |
GBClayout->addWidget(editIP, 0, 1); |
184 | 453 |
|
421 | 454 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 455 |
BtnNetConnect->setFont(*font14); |
456 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
421 | 457 |
GBClayout->addWidget(BtnNetConnect, 0, 2); |
416 | 458 |
|
421 | 459 |
pUdpClient=new HWNetUdpWidget(ConnGroupBox); |
460 |
GBClayout->addWidget(pUdpClient, 1, 0, 2, 2); |
|
461 |
||
462 |
pUpdateUdpButt = new QPushButton(ConnGroupBox); |
|
416 | 463 |
pUpdateUdpButt->setFont(*font14); |
464 |
pUpdateUdpButt->setText(QPushButton::tr("Update")); |
|
421 | 465 |
GBClayout->addWidget(pUpdateUdpButt, 1, 2); |
314 | 466 |
|
184 | 467 |
BtnBack = new QPushButton(this); |
468 |
BtnBack->setFont(*font14); |
|
469 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 470 |
pageLayout->addWidget(BtnBack, 3, 0); |
184 | 471 |
} |
472 |
||
473 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
|
474 |
{ |
|
475 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
476 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 477 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 478 |
//pageLayout->setSpacing(1); |
479 |
//pageLayout->setMargin(1); |
|
463 | 480 |
pageLayout->setColumnStretch(0, 50); |
481 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 482 |
|
461 | 483 |
// chatwidget |
484 |
pChatWidget = new HWChatWidget(this); |
|
485 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 486 |
pageLayout->setRowStretch(1, 100); |
453 | 487 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
488 |
pGameCFG = new GameCFGWidget(this); |
322 | 489 |
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
|
490 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
491 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 492 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 493 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 494 |
|
495 |
BtnBack = new QPushButton(this); |
|
496 |
BtnBack->setFont(*font14); |
|
497 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 498 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 499 |
|
500 |
BtnGo = new QPushButton(this); |
|
501 |
BtnGo->setFont(*font14); |
|
502 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 503 |
BtnGo->setEnabled(false); |
461 | 504 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 505 |
} |
187 | 506 |
|
507 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
508 |
{ |
|
509 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
510 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
511 |
pageLayout->setColumnStretch(0, 1); |
|
512 |
pageLayout->setColumnStretch(1, 1); |
|
513 |
pageLayout->setColumnStretch(2, 1); |
|
514 |
||
515 |
BtnBack = new QPushButton(this); |
|
516 |
BtnBack->setFont(*font14); |
|
517 |
BtnBack->setText(QPushButton::tr("Back")); |
|
518 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
519 |
||
520 |
about = new About(this); |
|
521 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
522 |
} |
|
306 | 523 |
|
524 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
525 |
{ |
|
526 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
527 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
528 |
pageLayout->setColumnStretch(0, 1); |
|
529 |
pageLayout->setColumnStretch(1, 1); |
|
530 |
pageLayout->setColumnStretch(2, 1); |
|
531 |
||
532 |
BtnBack = new QPushButton(this); |
|
533 |
BtnBack->setFont(*font14); |
|
534 |
BtnBack->setText(QPushButton::tr("Back")); |
|
535 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
536 |
||
307 | 537 |
labelGameStats = new QLabel(this); |
538 |
labelGameStats->setTextFormat(Qt::RichText); |
|
539 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 540 |
} |
586 | 541 |
|
542 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent) |
|
543 |
{ |
|
544 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
545 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
546 |
pageLayout->setMargin(25); |
|
547 |
pageLayout->setColumnStretch(0, 1); |
|
548 |
pageLayout->setColumnStretch(1, 2); |
|
549 |
pageLayout->setColumnStretch(2, 1); |
|
588 | 550 |
pageLayout->setRowStretch(0, 1); |
551 |
pageLayout->setRowStretch(3, 1); |
|
586 | 552 |
|
553 |
BtnSimpleGamePage = new QPushButton(this); |
|
554 |
BtnSimpleGamePage->setFont(*font14); |
|
555 |
BtnSimpleGamePage->setText(QPushButton::tr("Simple Game")); |
|
588 | 556 |
pageLayout->addWidget(BtnSimpleGamePage, 1, 1); |
586 | 557 |
|
558 |
BtnTrainPage = new QPushButton(this); |
|
559 |
BtnTrainPage->setFont(*font14); |
|
560 |
BtnTrainPage->setText(QPushButton::tr("Training")); |
|
588 | 561 |
pageLayout->addWidget(BtnTrainPage, 2, 1); |
586 | 562 |
|
563 |
BtnBack = new QPushButton(this); |
|
564 |
BtnBack->setFont(*font14); |
|
565 |
BtnBack->setText(QPushButton::tr("Back")); |
|
588 | 566 |
pageLayout->addWidget(BtnBack, 4, 0); |
586 | 567 |
|
568 |
} |
|
569 |
||
587 | 570 |
PageTraining::PageTraining(QWidget* parent) : QWidget(parent) |
571 |
{ |
|
572 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
573 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
574 |
pageLayout->setMargin(25); |
|
575 |
pageLayout->setColumnStretch(0, 1); |
|
576 |
pageLayout->setColumnStretch(1, 2); |
|
577 |
pageLayout->setColumnStretch(2, 1); |
|
578 |
||
579 |
BtnStartTrain = new QPushButton(this); |
|
580 |
BtnStartTrain->setFont(*font14); |
|
581 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
582 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
583 |
||
584 |
BtnBack = new QPushButton(this); |
|
585 |
BtnBack->setFont(*font14); |
|
586 |
BtnBack->setText(QPushButton::tr("Back")); |
|
587 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
588 |
} |
|
589 |
||
600 | 590 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : QWidget(parent) |
591 |
{ |
|
592 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
593 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
594 |
pageLayout->setMargin(25); |
|
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
595 |
//pageLayout->setColumnStretch(0, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
596 |
//pageLayout->setColumnStretch(1, 2); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
597 |
//pageLayout->setColumnStretch(2, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
598 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
599 |
pWeapons=new SelWeaponWidget(this); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
600 |
pageLayout->addWidget(pWeapons, 0, 0); |
600 | 601 |
|
602 |
BtnBack = new QPushButton(this); |
|
603 |
BtnBack->setFont(*font14); |
|
604 |
BtnBack->setText(QPushButton::tr("Back")); |
|
605 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
606 |
} |
|
607 |