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