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