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