author | unc0rr |
Mon, 20 Aug 2007 17:49:39 +0000 | |
changeset 579 | 94db15de0392 |
parent 555 | 0376fdcc6322 |
child 585 | 7531ae5b146e |
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")); |
|
60 |
pageLayout->addWidget(BtnSinglePlayer, 1, 1); |
|
61 |
||
62 |
BtnMultiplayer = new QPushButton(this); |
|
63 |
BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
64 |
BtnMultiplayer->setFont(*font14); |
|
65 |
BtnMultiplayer->setText(QPushButton::tr("Multiplayer")); |
|
66 |
pageLayout->addWidget(BtnMultiplayer, 2, 1); |
|
67 |
||
68 |
BtnNet = new QPushButton(this); |
|
69 |
BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
70 |
BtnNet->setFont(*font14); |
|
71 |
BtnNet->setText(QPushButton::tr("Net game")); |
|
72 |
pageLayout->addWidget(BtnNet, 3, 1); |
|
73 |
||
579 | 74 |
BtnLoad = new QPushButton(this); |
75 |
BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
76 |
BtnLoad->setFont(*font14); |
|
77 |
BtnLoad->setText(QPushButton::tr("Load")); |
|
78 |
pageLayout->addWidget(BtnLoad, 4, 1); |
|
79 |
||
184 | 80 |
BtnDemos = new QPushButton(this); |
81 |
BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
82 |
BtnDemos->setFont(*font14); |
|
83 |
BtnDemos->setText(QPushButton::tr("Demos")); |
|
579 | 84 |
pageLayout->addWidget(BtnDemos, 5, 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")); |
|
579 | 90 |
pageLayout->addWidget(BtnSetup, 6, 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")); |
|
579 | 96 |
pageLayout->addWidget(BtnInfo, 7, 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 |
||
105 |
PageLocalGame::PageLocalGame(QWidget* parent) : QWidget(parent) |
|
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); |
|
184 | 119 |
BtnSimpleGame = new QPushButton(this); |
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 |
||
153 |
GBoxHedgehogs = new QGroupBox(this); |
|
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 |
||
171 |
GBoxBinds = new QGroupBox(this); |
|
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 |
||
211 |
GBoxGrave = new QGroupBox(this); |
|
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); |
|
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 |
|
254 |
BtnTeamSave = new QPushButton(this); |
|
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); |
|
398 |
} |
|
399 |
||
400 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
401 |
{ |
|
402 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
403 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
404 |
pageLayout->setColumnStretch(0, 1); |
|
405 |
pageLayout->setColumnStretch(1, 1); |
|
421 | 406 |
|
407 |
BtnNetSvrStart = new QPushButton(this); |
|
408 |
BtnNetSvrStart->setFont(*font14); |
|
409 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
410 |
pageLayout->addWidget(BtnNetSvrStart, 0, 1); |
|
184 | 411 |
|
412 |
NNGroupBox = new QGroupBox(this); |
|
314 | 413 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
184 | 414 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
421 | 415 |
pageLayout->addWidget(NNGroupBox, 0, 0); |
184 | 416 |
|
417 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
418 |
labelNN = new QLabel(NNGroupBox); |
|
419 |
labelNN->setText(QLabel::tr("Net nick")); |
|
420 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
421 |
||
422 |
editNetNick = new QLineEdit(NNGroupBox); |
|
423 |
editNetNick->setMaxLength(20); |
|
424 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
425 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
426 |
||
421 | 427 |
QGroupBox * ConnGroupBox = new QGroupBox(this); |
428 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
|
429 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
430 |
QGridLayout * GBClayout = new QGridLayout(ConnGroupBox); |
|
431 |
GBClayout->setColumnStretch(0, 0); |
|
432 |
GBClayout->setColumnStretch(1, 1); |
|
433 |
GBClayout->setColumnStretch(2, 1); |
|
434 |
GBClayout->setRowStretch(0, 0); |
|
435 |
GBClayout->setRowStretch(1, 0); |
|
436 |
GBClayout->setRowStretch(2, 1); |
|
437 |
||
438 |
labelIP = new QLabel(ConnGroupBox); |
|
184 | 439 |
labelIP->setText(QLabel::tr("Server address")); |
421 | 440 |
GBClayout->addWidget(labelIP, 0, 0); |
184 | 441 |
|
421 | 442 |
editIP = new QLineEdit(ConnGroupBox); |
184 | 443 |
editIP->setMaxLength(50); |
421 | 444 |
GBClayout->addWidget(editIP, 0, 1); |
184 | 445 |
|
421 | 446 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 447 |
BtnNetConnect->setFont(*font14); |
448 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
421 | 449 |
GBClayout->addWidget(BtnNetConnect, 0, 2); |
416 | 450 |
|
421 | 451 |
pUdpClient=new HWNetUdpWidget(ConnGroupBox); |
452 |
GBClayout->addWidget(pUdpClient, 1, 0, 2, 2); |
|
453 |
||
454 |
pUpdateUdpButt = new QPushButton(ConnGroupBox); |
|
416 | 455 |
pUpdateUdpButt->setFont(*font14); |
456 |
pUpdateUdpButt->setText(QPushButton::tr("Update")); |
|
421 | 457 |
GBClayout->addWidget(pUpdateUdpButt, 1, 2); |
314 | 458 |
|
184 | 459 |
BtnBack = new QPushButton(this); |
460 |
BtnBack->setFont(*font14); |
|
461 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 462 |
pageLayout->addWidget(BtnBack, 3, 0); |
184 | 463 |
} |
464 |
||
465 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
|
466 |
{ |
|
467 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
468 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 469 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 470 |
//pageLayout->setSpacing(1); |
471 |
//pageLayout->setMargin(1); |
|
463 | 472 |
pageLayout->setColumnStretch(0, 50); |
473 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 474 |
|
461 | 475 |
// chatwidget |
476 |
pChatWidget = new HWChatWidget(this); |
|
477 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 478 |
pageLayout->setRowStretch(1, 100); |
453 | 479 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
480 |
pGameCFG = new GameCFGWidget(this); |
322 | 481 |
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
|
482 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
483 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 484 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 485 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 486 |
|
487 |
BtnBack = new QPushButton(this); |
|
488 |
BtnBack->setFont(*font14); |
|
489 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 490 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 491 |
|
492 |
BtnGo = new QPushButton(this); |
|
493 |
BtnGo->setFont(*font14); |
|
494 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 495 |
BtnGo->setEnabled(false); |
461 | 496 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 497 |
} |
187 | 498 |
|
499 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
500 |
{ |
|
501 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
502 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
503 |
pageLayout->setColumnStretch(0, 1); |
|
504 |
pageLayout->setColumnStretch(1, 1); |
|
505 |
pageLayout->setColumnStretch(2, 1); |
|
506 |
||
507 |
BtnBack = new QPushButton(this); |
|
508 |
BtnBack->setFont(*font14); |
|
509 |
BtnBack->setText(QPushButton::tr("Back")); |
|
510 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
511 |
||
512 |
about = new About(this); |
|
513 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
514 |
} |
|
306 | 515 |
|
516 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
517 |
{ |
|
518 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
519 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
520 |
pageLayout->setColumnStretch(0, 1); |
|
521 |
pageLayout->setColumnStretch(1, 1); |
|
522 |
pageLayout->setColumnStretch(2, 1); |
|
523 |
||
524 |
BtnBack = new QPushButton(this); |
|
525 |
BtnBack->setFont(*font14); |
|
526 |
BtnBack->setText(QPushButton::tr("Back")); |
|
527 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
528 |
||
307 | 529 |
labelGameStats = new QLabel(this); |
530 |
labelGameStats->setTextFormat(Qt::RichText); |
|
531 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 532 |
} |