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