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