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