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