author | unc0rr |
Sun, 09 Dec 2007 17:16:15 +0000 | |
changeset 638 | e1cc516488f2 |
parent 636 | dc93ac775bb9 |
child 646 | ed610c2cd0a4 |
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 |
|
184 | 408 |
} |
409 |
||
410 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
411 |
{ |
|
412 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
413 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
414 |
pageLayout->setColumnStretch(0, 1); |
|
415 |
pageLayout->setColumnStretch(1, 1); |
|
617 | 416 |
pageLayout->setColumnStretch(2, 1); |
421 | 417 |
|
418 |
BtnNetSvrStart = new QPushButton(this); |
|
419 |
BtnNetSvrStart->setFont(*font14); |
|
420 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
617 | 421 |
pageLayout->addWidget(BtnNetSvrStart, 3, 2); |
184 | 422 |
|
423 |
NNGroupBox = new QGroupBox(this); |
|
314 | 424 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
184 | 425 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
421 | 426 |
pageLayout->addWidget(NNGroupBox, 0, 0); |
184 | 427 |
|
428 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
429 |
labelNN = new QLabel(NNGroupBox); |
|
430 |
labelNN->setText(QLabel::tr("Net nick")); |
|
431 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
432 |
||
636 | 433 |
editNetNick = new QLineEdit(NNGroupBox); |
184 | 434 |
editNetNick->setMaxLength(20); |
435 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
436 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
437 |
||
636 | 438 |
QGroupBox * NetTypeGroupBox = new QGroupBox(this); |
439 |
NetTypeGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
440 |
NetTypeGroupBox->setTitle(QGroupBox::tr("Connection type")); |
|
441 |
pageLayout->addWidget(NetTypeGroupBox, 0, 1); |
|
442 |
||
443 |
QVBoxLayout * GBTlayout = new QVBoxLayout(NetTypeGroupBox); |
|
444 |
rbLocalGame = new QRadioButton(NetTypeGroupBox); |
|
445 |
rbLocalGame->setText(tr("Local game")); |
|
446 |
rbLocalGame->setChecked(true); |
|
447 |
GBTlayout->addWidget(rbLocalGame); |
|
448 |
rbInternetGame = new QRadioButton(NetTypeGroupBox); |
|
449 |
rbInternetGame->setText(tr("Internet game")); |
|
450 |
GBTlayout->addWidget(rbInternetGame); |
|
451 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
452 |
ConnGroupBox = new QGroupBox(this); |
421 | 453 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
454 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
455 |
GBClayout = new QGridLayout(ConnGroupBox); |
421 | 456 |
GBClayout->setColumnStretch(0, 0); |
457 |
GBClayout->setColumnStretch(1, 1); |
|
458 |
GBClayout->setColumnStretch(2, 1); |
|
459 |
GBClayout->setRowStretch(0, 0); |
|
460 |
GBClayout->setRowStretch(1, 0); |
|
461 |
GBClayout->setRowStretch(2, 1); |
|
462 |
||
463 |
labelIP = new QLabel(ConnGroupBox); |
|
184 | 464 |
labelIP->setText(QLabel::tr("Server address")); |
421 | 465 |
GBClayout->addWidget(labelIP, 0, 0); |
184 | 466 |
|
421 | 467 |
editIP = new QLineEdit(ConnGroupBox); |
184 | 468 |
editIP->setMaxLength(50); |
421 | 469 |
GBClayout->addWidget(editIP, 0, 1); |
184 | 470 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
471 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 472 |
BtnNetConnect->setFont(*font14); |
473 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
421 | 474 |
GBClayout->addWidget(BtnNetConnect, 0, 2); |
416 | 475 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
476 |
netServersWidget = 0; |
421 | 477 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
478 |
BtnUpdateSList = new QPushButton(ConnGroupBox); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
479 |
BtnUpdateSList->setFont(*font14); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
480 |
BtnUpdateSList->setText(QPushButton::tr("Update")); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
481 |
GBClayout->addWidget(BtnUpdateSList, 1, 2); |
314 | 482 |
|
184 | 483 |
BtnBack = new QPushButton(this); |
484 |
BtnBack->setFont(*font14); |
|
485 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 486 |
pageLayout->addWidget(BtnBack, 3, 0); |
636 | 487 |
|
488 |
connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(changeServersList())); |
|
184 | 489 |
} |
490 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
491 |
void PageNet::changeServersList() |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
492 |
{ |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
493 |
if (netServersWidget) delete netServersWidget; |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
494 |
|
636 | 495 |
if (rbLocalGame->isChecked()) |
638 | 496 |
{ |
636 | 497 |
netServersWidget = new HWNetUdpWidget(ConnGroupBox); |
638 | 498 |
static_cast<HWNetUdpWidget *>(netServersWidget)->updateList(); |
499 |
} |
|
636 | 500 |
else |
638 | 501 |
{ |
636 | 502 |
netServersWidget = new HWNetWwwWidget(ConnGroupBox); |
638 | 503 |
static_cast<HWNetWwwWidget *>(netServersWidget)->updateList(); |
504 |
} |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
505 |
GBClayout->addWidget(netServersWidget, 1, 0, 2, 2); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
506 |
|
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
507 |
connect(BtnUpdateSList, SIGNAL(clicked()), netServersWidget, SLOT(updateList())); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
508 |
} |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
509 |
|
184 | 510 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
511 |
{ |
|
512 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
513 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 514 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 515 |
//pageLayout->setSpacing(1); |
516 |
//pageLayout->setMargin(1); |
|
463 | 517 |
pageLayout->setColumnStretch(0, 50); |
518 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 519 |
|
461 | 520 |
// chatwidget |
521 |
pChatWidget = new HWChatWidget(this); |
|
522 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 523 |
pageLayout->setRowStretch(1, 100); |
453 | 524 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
525 |
pGameCFG = new GameCFGWidget(this); |
322 | 526 |
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
|
527 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
528 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 529 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 530 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 531 |
|
532 |
BtnBack = new QPushButton(this); |
|
533 |
BtnBack->setFont(*font14); |
|
534 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 535 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 536 |
|
537 |
BtnGo = new QPushButton(this); |
|
538 |
BtnGo->setFont(*font14); |
|
539 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 540 |
BtnGo->setEnabled(false); |
461 | 541 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 542 |
} |
187 | 543 |
|
544 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
545 |
{ |
|
546 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
547 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
548 |
pageLayout->setColumnStretch(0, 1); |
|
549 |
pageLayout->setColumnStretch(1, 1); |
|
550 |
pageLayout->setColumnStretch(2, 1); |
|
551 |
||
552 |
BtnBack = new QPushButton(this); |
|
553 |
BtnBack->setFont(*font14); |
|
554 |
BtnBack->setText(QPushButton::tr("Back")); |
|
555 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
556 |
||
557 |
about = new About(this); |
|
558 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
559 |
} |
|
306 | 560 |
|
561 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
562 |
{ |
|
563 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
564 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
565 |
pageLayout->setColumnStretch(0, 1); |
|
566 |
pageLayout->setColumnStretch(1, 1); |
|
567 |
pageLayout->setColumnStretch(2, 1); |
|
568 |
||
569 |
BtnBack = new QPushButton(this); |
|
570 |
BtnBack->setFont(*font14); |
|
571 |
BtnBack->setText(QPushButton::tr("Back")); |
|
572 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
573 |
||
307 | 574 |
labelGameStats = new QLabel(this); |
575 |
labelGameStats->setTextFormat(Qt::RichText); |
|
576 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 577 |
} |
586 | 578 |
|
579 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent) |
|
580 |
{ |
|
581 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
582 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
583 |
pageLayout->setMargin(25); |
|
584 |
pageLayout->setColumnStretch(0, 1); |
|
585 |
pageLayout->setColumnStretch(1, 2); |
|
586 |
pageLayout->setColumnStretch(2, 1); |
|
588 | 587 |
pageLayout->setRowStretch(0, 1); |
588 |
pageLayout->setRowStretch(3, 1); |
|
586 | 589 |
|
590 |
BtnSimpleGamePage = new QPushButton(this); |
|
591 |
BtnSimpleGamePage->setFont(*font14); |
|
592 |
BtnSimpleGamePage->setText(QPushButton::tr("Simple Game")); |
|
588 | 593 |
pageLayout->addWidget(BtnSimpleGamePage, 1, 1); |
586 | 594 |
|
595 |
BtnTrainPage = new QPushButton(this); |
|
596 |
BtnTrainPage->setFont(*font14); |
|
597 |
BtnTrainPage->setText(QPushButton::tr("Training")); |
|
588 | 598 |
pageLayout->addWidget(BtnTrainPage, 2, 1); |
586 | 599 |
|
600 |
BtnBack = new QPushButton(this); |
|
601 |
BtnBack->setFont(*font14); |
|
602 |
BtnBack->setText(QPushButton::tr("Back")); |
|
588 | 603 |
pageLayout->addWidget(BtnBack, 4, 0); |
586 | 604 |
|
605 |
} |
|
606 |
||
587 | 607 |
PageTraining::PageTraining(QWidget* parent) : QWidget(parent) |
608 |
{ |
|
609 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
610 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
611 |
pageLayout->setMargin(25); |
|
612 |
pageLayout->setColumnStretch(0, 1); |
|
613 |
pageLayout->setColumnStretch(1, 2); |
|
614 |
pageLayout->setColumnStretch(2, 1); |
|
615 |
||
616 |
BtnStartTrain = new QPushButton(this); |
|
617 |
BtnStartTrain->setFont(*font14); |
|
618 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
619 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
620 |
||
621 |
BtnBack = new QPushButton(this); |
|
622 |
BtnBack->setFont(*font14); |
|
623 |
BtnBack->setText(QPushButton::tr("Back")); |
|
624 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
625 |
} |
|
626 |
||
600 | 627 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : QWidget(parent) |
628 |
{ |
|
629 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
630 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
631 |
pageLayout->setMargin(25); |
|
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
632 |
//pageLayout->setColumnStretch(0, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
633 |
//pageLayout->setColumnStretch(1, 2); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
634 |
//pageLayout->setColumnStretch(2, 1); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
635 |
|
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
636 |
pWeapons=new SelWeaponWidget(this); |
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
637 |
pageLayout->addWidget(pWeapons, 0, 0); |
600 | 638 |
|
639 |
BtnBack = new QPushButton(this); |
|
640 |
BtnBack->setFont(*font14); |
|
641 |
BtnBack->setText(QPushButton::tr("Back")); |
|
642 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
643 |
} |
|
644 |