author | unc0rr |
Fri, 18 May 2007 16:40:43 +0000 | |
changeset 514 | fb8ba88a83c3 |
parent 492 | 78e80f899b59 |
child 529 | 812682c1ab62 |
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 |
|
400 |
fpsedit = new FPSEdit(AGGroupBox); |
|
427 | 401 |
GBAfpslayout->addWidget(fpsedit); |
184 | 402 |
|
403 |
BtnSaveOptions = new QPushButton(this); |
|
404 |
BtnSaveOptions->setFont(*font14); |
|
405 |
BtnSaveOptions->setText(QPushButton::tr("Save")); |
|
406 |
pageLayout->addWidget(BtnSaveOptions, 4, 2); |
|
407 |
||
408 |
BtnBack = new QPushButton(this); |
|
409 |
BtnBack->setFont(*font14); |
|
410 |
BtnBack->setText(QPushButton::tr("Back")); |
|
411 |
pageLayout->addWidget(BtnBack, 4, 0); |
|
412 |
} |
|
413 |
||
414 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
415 |
{ |
|
416 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
417 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
418 |
pageLayout->setColumnStretch(0, 1); |
|
419 |
pageLayout->setColumnStretch(1, 1); |
|
421 | 420 |
|
421 |
BtnNetSvrStart = new QPushButton(this); |
|
422 |
BtnNetSvrStart->setFont(*font14); |
|
423 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
424 |
pageLayout->addWidget(BtnNetSvrStart, 0, 1); |
|
184 | 425 |
|
426 |
NNGroupBox = new QGroupBox(this); |
|
314 | 427 |
NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
184 | 428 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
421 | 429 |
pageLayout->addWidget(NNGroupBox, 0, 0); |
184 | 430 |
|
431 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
|
432 |
labelNN = new QLabel(NNGroupBox); |
|
433 |
labelNN->setText(QLabel::tr("Net nick")); |
|
434 |
GBNlayout->addWidget(labelNN, 0, 0); |
|
435 |
||
436 |
editNetNick = new QLineEdit(NNGroupBox); |
|
437 |
editNetNick->setMaxLength(20); |
|
438 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
439 |
GBNlayout->addWidget(editNetNick, 0, 1); |
|
440 |
||
421 | 441 |
QGroupBox * ConnGroupBox = new QGroupBox(this); |
442 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
|
443 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
444 |
QGridLayout * GBClayout = new QGridLayout(ConnGroupBox); |
|
445 |
GBClayout->setColumnStretch(0, 0); |
|
446 |
GBClayout->setColumnStretch(1, 1); |
|
447 |
GBClayout->setColumnStretch(2, 1); |
|
448 |
GBClayout->setRowStretch(0, 0); |
|
449 |
GBClayout->setRowStretch(1, 0); |
|
450 |
GBClayout->setRowStretch(2, 1); |
|
451 |
||
452 |
labelIP = new QLabel(ConnGroupBox); |
|
184 | 453 |
labelIP->setText(QLabel::tr("Server address")); |
421 | 454 |
GBClayout->addWidget(labelIP, 0, 0); |
184 | 455 |
|
421 | 456 |
editIP = new QLineEdit(ConnGroupBox); |
184 | 457 |
editIP->setMaxLength(50); |
421 | 458 |
GBClayout->addWidget(editIP, 0, 1); |
184 | 459 |
|
421 | 460 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 461 |
BtnNetConnect->setFont(*font14); |
462 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
421 | 463 |
GBClayout->addWidget(BtnNetConnect, 0, 2); |
416 | 464 |
|
421 | 465 |
pUdpClient=new HWNetUdpWidget(ConnGroupBox); |
466 |
GBClayout->addWidget(pUdpClient, 1, 0, 2, 2); |
|
467 |
||
468 |
pUpdateUdpButt = new QPushButton(ConnGroupBox); |
|
416 | 469 |
pUpdateUdpButt->setFont(*font14); |
470 |
pUpdateUdpButt->setText(QPushButton::tr("Update")); |
|
421 | 471 |
GBClayout->addWidget(pUpdateUdpButt, 1, 2); |
314 | 472 |
|
184 | 473 |
BtnBack = new QPushButton(this); |
474 |
BtnBack->setFont(*font14); |
|
475 |
BtnBack->setText(QPushButton::tr("Back")); |
|
412 | 476 |
pageLayout->addWidget(BtnBack, 3, 0); |
184 | 477 |
} |
478 |
||
479 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
|
480 |
{ |
|
481 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
482 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 483 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 484 |
//pageLayout->setSpacing(1); |
485 |
//pageLayout->setMargin(1); |
|
463 | 486 |
pageLayout->setColumnStretch(0, 50); |
487 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 488 |
|
461 | 489 |
// chatwidget |
490 |
pChatWidget = new HWChatWidget(this); |
|
491 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 492 |
pageLayout->setRowStretch(1, 100); |
453 | 493 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
494 |
pGameCFG = new GameCFGWidget(this); |
322 | 495 |
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
|
496 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
497 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 498 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 499 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 500 |
|
501 |
BtnBack = new QPushButton(this); |
|
502 |
BtnBack->setFont(*font14); |
|
503 |
BtnBack->setText(QPushButton::tr("Back")); |
|
461 | 504 |
pageLayout->addWidget(BtnBack, 2, 0); |
184 | 505 |
|
506 |
BtnGo = new QPushButton(this); |
|
507 |
BtnGo->setFont(*font14); |
|
508 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 509 |
BtnGo->setEnabled(false); |
461 | 510 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 511 |
} |
187 | 512 |
|
513 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent) |
|
514 |
{ |
|
515 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
516 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
517 |
pageLayout->setColumnStretch(0, 1); |
|
518 |
pageLayout->setColumnStretch(1, 1); |
|
519 |
pageLayout->setColumnStretch(2, 1); |
|
520 |
||
521 |
BtnBack = new QPushButton(this); |
|
522 |
BtnBack->setFont(*font14); |
|
523 |
BtnBack->setText(QPushButton::tr("Back")); |
|
524 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
525 |
||
526 |
about = new About(this); |
|
527 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
528 |
} |
|
306 | 529 |
|
530 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent) |
|
531 |
{ |
|
532 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
533 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
534 |
pageLayout->setColumnStretch(0, 1); |
|
535 |
pageLayout->setColumnStretch(1, 1); |
|
536 |
pageLayout->setColumnStretch(2, 1); |
|
537 |
||
538 |
BtnBack = new QPushButton(this); |
|
539 |
BtnBack->setFont(*font14); |
|
540 |
BtnBack->setText(QPushButton::tr("Back")); |
|
541 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
542 |
||
307 | 543 |
labelGameStats = new QLabel(this); |
544 |
labelGameStats->setTextFormat(Qt::RichText); |
|
545 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 546 |
} |