author | unc0rr |
Thu, 11 Sep 2008 17:02:39 +0000 | |
changeset 1252 | 2e2719c0a397 |
parent 1249 | b6670a6ea2d0 |
child 1282 | 76533d0e76e3 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
1236 | 3 |
* Copyright (c) 2006-2008 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> |
636 | 31 |
#include <QRadioButton> |
665 | 32 |
#include <QTableView> |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
33 |
#include <QMessageBox> |
673 | 34 |
#include <QHeaderView> |
1252 | 35 |
#include <QTabWidget> |
184 | 36 |
|
37 |
#include "pages.h" |
|
38 |
#include "sdlkeys.h" |
|
39 |
#include "hwconsts.h" |
|
40 |
#include "gamecfgwidget.h" |
|
41 |
#include "teamselect.h" |
|
42 |
#include "gamecfgwidget.h" |
|
43 |
#include "SquareLabel.h" |
|
44 |
#include "mapContainer.h" |
|
187 | 45 |
#include "about.h" |
297 | 46 |
#include "fpsedit.h" |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
47 |
#include "netserverslist.h" |
412 | 48 |
#include "netudpwidget.h" |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
49 |
#include "netwwwwidget.h" |
461 | 50 |
#include "chatwidget.h" |
579 | 51 |
#include "playrecordpage.h" |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
52 |
#include "selectWeapon.h" |
1192 | 53 |
#include "igbox.h" |
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
54 |
#include "hats.h" |
184 | 55 |
|
684 | 56 |
PageMain::PageMain(QWidget* parent) : |
57 |
AbstractPage(parent) |
|
184 | 58 |
{ |
59 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1148 | 60 |
//pageLayout->setColumnStretch(0, 1); |
61 |
//pageLayout->setColumnStretch(1, 2); |
|
62 |
//pageLayout->setColumnStretch(2, 1); |
|
184 | 63 |
|
1199 | 64 |
//QPushButton* btnLogo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true); |
65 |
//pageLayout->setAlignment(btnLogo, Qt::AlignHCenter); |
|
1148 | 66 |
pageLayout->setRowStretch(0, 1); |
1150 | 67 |
pageLayout->setRowStretch(1, 1); |
68 |
pageLayout->setRowStretch(2, 0); |
|
69 |
pageLayout->setRowStretch(3, 1); |
|
1199 | 70 |
pageLayout->setRowStretch(4, 1); |
184 | 71 |
|
1152
c72b939c00df
Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents:
1151
diff
changeset
|
72 |
BtnSinglePlayer = addButton(":/res/LocalPlay.png", pageLayout, 2, 0, 1, 2, true); |
1150 | 73 |
pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignHCenter); |
184 | 74 |
|
1152
c72b939c00df
Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents:
1151
diff
changeset
|
75 |
BtnNet = addButton(":/res/NetworkPlay.png", pageLayout, 2, 2, 1, 2, true); |
1150 | 76 |
pageLayout->setAlignment(BtnNet, Qt::AlignHCenter); |
579 | 77 |
|
1199 | 78 |
BtnSetup = addButton(":/res/Settings.png", pageLayout, 4, 3, true); |
184 | 79 |
|
1199 | 80 |
//BtnInfo = addButton(":/res/About.png", pageLayout, 3, 1, 1, 2, true); |
81 |
BtnInfo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true); |
|
1212 | 82 |
BtnInfo->setStyleSheet("border: transparent;background: transparent;"); |
1150 | 83 |
pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter); |
1199 | 84 |
//pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter); |
184 | 85 |
|
1199 | 86 |
BtnExit = addButton(":/res/Exit.png", pageLayout, 4, 0, 1, 1, true); |
184 | 87 |
} |
88 |
||
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
730
diff
changeset
|
89 |
PageEditTeam::PageEditTeam(QWidget* parent) : |
692 | 90 |
AbstractPage(parent) |
184 | 91 |
{ |
92 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1252 | 93 |
QTabWidget * tbw = new QTabWidget(this); |
94 |
QWidget * page1 = new QWidget(); |
|
95 |
QWidget * page2 = new QWidget(); |
|
96 |
tbw->addTab(page1, tr("General")); |
|
97 |
tbw->addTab(page2, tr("Advanced")); |
|
98 |
pageLayout->addWidget(tbw, 0, 0, 1, 3); |
|
99 |
BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
|
100 |
BtnTeamSave = addButton(":/res/Save.png", pageLayout, 1, 2, true);; |
|
184 | 101 |
|
1252 | 102 |
QHBoxLayout * page1Layout = new QHBoxLayout(page1); |
103 |
page1Layout->setAlignment(Qt::AlignTop); |
|
104 |
QGridLayout * page2Layout = new QGridLayout(page2); |
|
105 |
||
106 |
// ====== Page 1 ====== |
|
107 |
QVBoxLayout * vbox1 = new QVBoxLayout(); |
|
108 |
QVBoxLayout * vbox2 = new QVBoxLayout(); |
|
109 |
QVBoxLayout * vbox3 = new QVBoxLayout(); |
|
110 |
page1Layout->addLayout(vbox1); |
|
111 |
page1Layout->addLayout(vbox2); |
|
112 |
page1Layout->addLayout(vbox3); |
|
113 |
||
184 | 114 |
GBoxTeam = new QGroupBox(this); |
115 |
GBoxTeam->setTitle(QGroupBox::tr("Team")); |
|
116 |
GBoxTeam->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
117 |
QGridLayout * GBTLayout = new QGridLayout(GBoxTeam); |
|
118 |
TeamNameEdit = new QLineEdit(GBoxTeam); |
|
1216
df1b19976e28
Allow team and hh name length be up to 64 letters length
unc0rr
parents:
1212
diff
changeset
|
119 |
TeamNameEdit->setMaxLength(64); |
231 | 120 |
GBTLayout->addWidget(TeamNameEdit, 0, 0, 1, 0); |
1252 | 121 |
vbox1->addWidget(GBoxTeam); |
184 | 122 |
|
588 | 123 |
GBoxHedgehogs = new QGroupBox(this); |
184 | 124 |
GBoxHedgehogs->setTitle(QGroupBox::tr("Team Members")); |
125 |
GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
126 |
QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs); |
|
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
127 |
|
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
128 |
HatsModel * hatsModel = new HatsModel(GBoxHedgehogs); |
184 | 129 |
for(int i = 0; i < 8; i++) |
130 |
{ |
|
131 |
HHNameEdit[i] = new QLineEdit(GBoxHedgehogs); |
|
1216
df1b19976e28
Allow team and hh name length be up to 64 letters length
unc0rr
parents:
1212
diff
changeset
|
132 |
HHNameEdit[i]->setMaxLength(64); |
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
133 |
HHNameEdit[i]->setMinimumWidth(120); |
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
134 |
GBHLayout->addWidget(HHNameEdit[i], i, 0); |
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
135 |
|
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
136 |
HHHats[i] = new QComboBox(GBoxHedgehogs); |
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
137 |
HHHats[i]->setModel(hatsModel); |
1239 | 138 |
//HHHats[i]->setModelColumn(1); |
1240 | 139 |
//HHHats[i]->setMinimumWidth(132); |
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
140 |
GBHLayout->addWidget(HHHats[i], i, 1); |
184 | 141 |
} |
1252 | 142 |
vbox1->addWidget(GBoxHedgehogs); |
143 |
||
144 |
||
145 |
GBoxGrave = new QGroupBox(this); |
|
146 |
GBoxGrave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
147 |
GBoxGrave->setTitle(QGroupBox::tr("Grave")); |
|
148 |
QGridLayout * GBGLayout = new QGridLayout(GBoxGrave); |
|
149 |
CBGrave = new QComboBox(GBoxGrave); |
|
150 |
CBGrave->setMaxCount(65535); |
|
151 |
GBGLayout->addWidget(CBGrave, 0, 0, 1, 3); |
|
152 |
GravePreview = new QLabel(GBoxGrave); |
|
153 |
GravePreview->setScaledContents(false); |
|
154 |
GBGLayout->addWidget(GravePreview, 1, 1); |
|
155 |
vbox2->addWidget(GBoxGrave); |
|
156 |
||
157 |
//page1Layout->addWidget(new QWidget(), 3, 1, 1, 1); |
|
184 | 158 |
|
1252 | 159 |
GBoxTeamLvl = new QGroupBox(this); |
160 |
GBoxTeamLvl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
161 |
GBoxTeamLvl->setTitle(QGroupBox::tr("Team level")); |
|
162 |
QGridLayout * GBTLLayout = new QGridLayout(GBoxTeamLvl); |
|
163 |
CBTeamLvl = new QComboBox(GBoxTeamLvl); |
|
164 |
CBTeamLvl->addItem(QComboBox::tr("Human")); |
|
165 |
CBTeamLvl->addItem(QComboBox::tr("Level 5")); |
|
166 |
CBTeamLvl->addItem(QComboBox::tr("Level 4")); |
|
167 |
CBTeamLvl->addItem(QComboBox::tr("Level 3")); |
|
168 |
CBTeamLvl->addItem(QComboBox::tr("Level 2")); |
|
169 |
CBTeamLvl->addItem(QComboBox::tr("Level 1")); |
|
170 |
CBTeamLvl->setMaxCount(6); |
|
171 |
GBTLLayout->addWidget(CBTeamLvl, 0, 0, 1, 3); |
|
172 |
LevelPict = new QLabel(GBoxTeamLvl); |
|
173 |
LevelPict->setScaledContents(false); |
|
174 |
LevelPict->setFixedSize(32, 32); |
|
175 |
GBTLLayout->addWidget(LevelPict, 1, 1); |
|
176 |
vbox2->addWidget(GBoxTeamLvl); |
|
184 | 177 |
|
1252 | 178 |
GBoxFort = new QGroupBox(this); |
179 |
GBoxFort->setTitle(QGroupBox::tr("Fort")); |
|
180 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort); |
|
181 |
CBFort = new QComboBox(GBoxFort); |
|
182 |
CBFort->setMaxCount(65535); |
|
183 |
GBFLayout->addWidget(CBFort, 0, 0); |
|
184 |
FortPreview = new SquareLabel(GBoxFort); |
|
185 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
186 |
FortPreview->setPixmap(QPixmap()); |
|
187 |
GBFLayout->addWidget(FortPreview, 1, 0); |
|
188 |
vbox3->addWidget(GBoxFort); |
|
189 |
||
190 |
QDir tmpdir; |
|
191 |
tmpdir.cd(datadir->absolutePath()); |
|
192 |
tmpdir.cd("Forts"); |
|
193 |
tmpdir.setFilter(QDir::Files); |
|
194 |
||
195 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1")); |
|
196 |
tmpdir.cd("../Graphics/Graves"); |
|
197 |
QStringList list = tmpdir.entryList(QStringList("*.png")); |
|
198 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
|
199 |
{ |
|
200 |
CBGrave->addItem((*it).replace(QRegExp("^(.*)\\.png"), "\\1")); |
|
201 |
} |
|
202 |
||
203 |
connect(CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
|
204 |
connect(CBTeamLvl, SIGNAL(activated(int)), this, SLOT(CBTeamLvl_activated(int))); |
|
205 |
connect(CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
|
206 |
||
207 |
vbox1->addStretch(); |
|
208 |
vbox2->addStretch(); |
|
209 |
// vbox3->addStretch(); |
|
210 |
||
211 |
// ====== Page 2 ====== |
|
588 | 212 |
GBoxBinds = new QGroupBox(this); |
184 | 213 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
214 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
|
215 |
BindsBox = new QToolBox(GBoxBinds); |
|
216 |
BindsBox->setLineWidth(0); |
|
217 |
GBBLayout->addWidget(BindsBox); |
|
218 |
page_A = new QWidget(); |
|
219 |
BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
|
220 |
page_W = new QWidget(); |
|
221 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
|
222 |
page_WP = new QWidget(); |
|
223 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
|
224 |
page_O = new QWidget(); |
|
225 |
BindsBox->addItem(page_O, QToolBox::tr("Other")); |
|
1252 | 226 |
page2Layout->addWidget(GBoxBinds, 0, 0); |
184 | 227 |
|
228 |
QStringList binds; |
|
229 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
230 |
{ |
|
231 |
binds << sdlkeys[i][1]; |
|
232 |
} |
|
233 |
||
234 |
quint16 widind = 0, i = 0; |
|
235 |
while (i < BINDS_NUMBER) { |
|
236 |
quint16 num = 0; |
|
237 |
QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind)); |
|
238 |
do { |
|
239 |
LBind[i] = new QLabel(BindsBox->widget(widind)); |
|
240 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
|
241 |
LBind[i]->setAlignment(Qt::AlignRight); |
|
242 |
pagelayout->addWidget(LBind[i], num, 0); |
|
243 |
CBBind[i] = new QComboBox(BindsBox->widget(widind)); |
|
244 |
CBBind[i]->addItems(binds); |
|
245 |
pagelayout->addWidget(CBBind[i], num, 1); |
|
246 |
num++; |
|
247 |
} while (!cbinds[i++].chwidget); |
|
248 |
pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2); |
|
249 |
widind++; |
|
250 |
} |
|
251 |
} |
|
252 |
||
253 |
void PageEditTeam::CBGrave_activated(const QString & gravename) |
|
254 |
{ |
|
255 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png"); |
|
256 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32)); |
|
257 |
} |
|
258 |
||
259 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
260 |
{ |
|
261 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
|
262 |
FortPreview->setPixmap(pix); |
|
263 |
} |
|
264 |
||
336 | 265 |
void PageEditTeam::CBTeamLvl_activated(int id) |
266 |
{ |
|
267 |
QPixmap pix(QString(":/res/botlevels/%1.png").arg(id)); |
|
268 |
LevelPict->setPixmap(pix); |
|
269 |
} |
|
270 |
||
692 | 271 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : |
272 |
AbstractPage(parent) |
|
184 | 273 |
{ |
274 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
275 |
||
1218 | 276 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
187 | 277 |
|
184 | 278 |
gameCFG = new GameCFGWidget(this); |
279 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2); |
|
696 | 280 |
|
1218 | 281 |
pageLayout->setRowStretch(1, 1); |
282 |
||
184 | 283 |
teamsSelect = new TeamSelWidget(this); |
1218 | 284 |
pageLayout->addWidget(teamsSelect, 0, 2, 2, 2); |
184 | 285 |
|
1218 | 286 |
BtnStartMPGame = addButton(tr("Start"), pageLayout, 2, 3); |
184 | 287 |
} |
288 |
||
1249
b6670a6ea2d0
Remove 25pix margin on every page, so exit button is almost in the same place on all pages
unc0rr
parents:
1240
diff
changeset
|
289 |
PageOptions::PageOptions(QWidget* parent) : |
692 | 290 |
AbstractPage(parent) |
184 | 291 |
{ |
292 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
427 | 293 |
pageLayout->setColumnStretch(0, 100); |
294 |
pageLayout->setColumnStretch(1, 100); |
|
295 |
pageLayout->setColumnStretch(2, 100); |
|
296 |
pageLayout->setRowStretch(0, 0); |
|
297 |
pageLayout->setRowStretch(1, 0); |
|
719 | 298 |
pageLayout->setRowStretch(2, 0); |
299 |
pageLayout->setRowStretch(3, 100); |
|
300 |
pageLayout->setRowStretch(4, 0); |
|
427 | 301 |
|
1198 | 302 |
|
303 |
QGroupBox * gbTwoBoxes = new QGroupBox(this); |
|
304 |
pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
|
305 |
QHBoxLayout * gbTBLayout = new QHBoxLayout(gbTwoBoxes); |
|
306 |
{ |
|
307 |
teamsBox = new IconedGroupBox(this); |
|
308 |
teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
|
309 |
teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
310 |
teamsBox->setTitle(QGroupBox::tr("Teams")); |
|
311 |
||
312 |
QGridLayout * GBTlayout = new QGridLayout(teamsBox); |
|
313 |
||
314 |
BtnNewTeam = addButton(tr("New team"), GBTlayout, 1, 0); |
|
315 |
||
316 |
CBTeamName = new QComboBox(teamsBox); |
|
317 |
GBTlayout->addWidget(CBTeamName, 0, 0, 1, 2); |
|
184 | 318 |
|
1198 | 319 |
BtnEditTeam = addButton(tr("Edit team"), GBTlayout, 1, 1); |
1199 | 320 |
|
321 |
labelNN = new QLabel(teamsBox); |
|
322 |
labelNN->setText(QLabel::tr("Net nick")); |
|
323 |
GBTlayout->addWidget(labelNN, 2, 0, 1, 2); |
|
324 |
||
325 |
editNetNick = new QLineEdit(teamsBox); |
|
326 |
editNetNick->setMaxLength(20); |
|
327 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
328 |
GBTlayout->addWidget(editNetNick, 3, 0, 1, 2); |
|
329 |
||
1198 | 330 |
gbTBLayout->addWidget(teamsBox); |
331 |
} |
|
184 | 332 |
|
1198 | 333 |
{ |
334 |
IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
|
1199 | 335 |
groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
1198 | 336 |
groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
1199 | 337 |
//groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
1198 | 338 |
groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
339 |
QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
|
184 | 340 |
|
1198 | 341 |
WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0); |
342 |
WeaponsName = new QComboBox(this); |
|
343 |
WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2); |
|
344 |
WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1); |
|
345 |
gbTBLayout->addWidget(groupWeapons); |
|
346 |
} |
|
184 | 347 |
|
1193 | 348 |
AGGroupBox = new IconedGroupBox(this); |
349 |
AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png")); |
|
184 | 350 |
AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
351 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
693 | 352 |
pageLayout->addWidget(AGGroupBox, 2, 1); |
184 | 353 |
|
427 | 354 |
QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
436 | 355 |
QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
427 | 356 |
QLabel * resolution = new QLabel(AGGroupBox); |
357 |
resolution->setText(QLabel::tr("Resolution")); |
|
358 |
GBAreslayout->addWidget(resolution); |
|
359 |
||
184 | 360 |
CBResolution = new QComboBox(AGGroupBox); |
427 | 361 |
GBAreslayout->addWidget(CBResolution); |
362 |
GBAlayout->addLayout(GBAreslayout); |
|
363 |
||
436 | 364 |
QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
427 | 365 |
QLabel * maxfps = new QLabel(AGGroupBox); |
366 |
maxfps->setText(QLabel::tr("FPS limit")); |
|
367 |
GBAfpslayout->addWidget(maxfps); |
|
368 |
GBAlayout->addLayout(GBAfpslayout); |
|
184 | 369 |
|
370 |
CBFullscreen = new QCheckBox(AGGroupBox); |
|
371 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
427 | 372 |
GBAlayout->addWidget(CBFullscreen); |
184 | 373 |
|
1162 | 374 |
CBFrontendFullscreen = new QCheckBox(AGGroupBox); |
375 |
CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen")); |
|
376 |
GBAlayout->addWidget(CBFrontendFullscreen); |
|
377 |
||
1157 | 378 |
CBEnableSound = new QCheckBox(AGGroupBox); |
184 | 379 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
427 | 380 |
GBAlayout->addWidget(CBEnableSound); |
184 | 381 |
|
1157 | 382 |
CBEnableMusic = new QCheckBox(AGGroupBox); |
1129 | 383 |
CBEnableMusic->setText(QCheckBox::tr("Enable music")); |
384 |
GBAlayout->addWidget(CBEnableMusic); |
|
385 |
||
297 | 386 |
CBShowFPS = new QCheckBox(AGGroupBox); |
387 |
CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
427 | 388 |
GBAlayout->addWidget(CBShowFPS); |
297 | 389 |
|
529 | 390 |
CBAltDamage = new QCheckBox(AGGroupBox); |
391 |
CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
392 |
GBAlayout->addWidget(CBAltDamage); |
|
393 |
||
297 | 394 |
fpsedit = new FPSEdit(AGGroupBox); |
427 | 395 |
GBAfpslayout->addWidget(fpsedit); |
184 | 396 |
|
1157 | 397 |
BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 4, 2, true); |
184 | 398 |
|
1153 | 399 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); |
184 | 400 |
} |
401 |
||
1153 | 402 |
PageNet::PageNet(QWidget* parent) : AbstractPage(parent) |
184 | 403 |
{ |
404 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
405 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
406 |
pageLayout->setColumnStretch(0, 1); |
|
407 |
pageLayout->setColumnStretch(1, 1); |
|
617 | 408 |
pageLayout->setColumnStretch(2, 1); |
421 | 409 |
|
410 |
BtnNetSvrStart = new QPushButton(this); |
|
411 |
BtnNetSvrStart->setFont(*font14); |
|
412 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
617 | 413 |
pageLayout->addWidget(BtnNetSvrStart, 3, 2); |
184 | 414 |
|
636 | 415 |
QGroupBox * NetTypeGroupBox = new QGroupBox(this); |
416 |
NetTypeGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
668 | 417 |
NetTypeGroupBox->setTitle(QGroupBox::tr("Servers list")); |
636 | 418 |
pageLayout->addWidget(NetTypeGroupBox, 0, 1); |
419 |
||
420 |
QVBoxLayout * GBTlayout = new QVBoxLayout(NetTypeGroupBox); |
|
421 |
rbLocalGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 422 |
rbLocalGame->setText(tr("Local")); |
636 | 423 |
rbLocalGame->setChecked(true); |
424 |
GBTlayout->addWidget(rbLocalGame); |
|
425 |
rbInternetGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 426 |
rbInternetGame->setText(tr("Internet")); |
636 | 427 |
GBTlayout->addWidget(rbInternetGame); |
428 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
429 |
ConnGroupBox = new QGroupBox(this); |
421 | 430 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
431 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
432 |
GBClayout = new QGridLayout(ConnGroupBox); |
646 | 433 |
GBClayout->setColumnStretch(0, 1); |
421 | 434 |
GBClayout->setColumnStretch(1, 1); |
435 |
GBClayout->setColumnStretch(2, 1); |
|
184 | 436 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
437 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 438 |
BtnNetConnect->setFont(*font14); |
439 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
646 | 440 |
GBClayout->addWidget(BtnNetConnect, 2, 2); |
416 | 441 |
|
665 | 442 |
tvServersList = new QTableView(ConnGroupBox); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
443 |
tvServersList->setSelectionBehavior(QAbstractItemView::SelectRows); |
665 | 444 |
GBClayout->addWidget(tvServersList, 1, 0, 1, 3); |
421 | 445 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
446 |
BtnUpdateSList = new QPushButton(ConnGroupBox); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
447 |
BtnUpdateSList->setFont(*font14); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
448 |
BtnUpdateSList->setText(QPushButton::tr("Update")); |
646 | 449 |
GBClayout->addWidget(BtnUpdateSList, 2, 0); |
314 | 450 |
|
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
451 |
BtnSpecifyServer = new QPushButton(ConnGroupBox); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
452 |
BtnSpecifyServer->setFont(*font14); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
453 |
BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
454 |
GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
455 |
|
1153 | 456 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true); |
636 | 457 |
|
646 | 458 |
connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(updateServersList())); |
668 | 459 |
connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
184 | 460 |
} |
461 |
||
646 | 462 |
void PageNet::updateServersList() |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
463 |
{ |
636 | 464 |
if (rbLocalGame->isChecked()) |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
465 |
tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
667 | 466 |
else |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
467 |
tvServersList->setModel(new HWNetWwwModel(tvServersList)); |
659 | 468 |
|
673 | 469 |
tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
470 |
||
665 | 471 |
static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
472 |
|
665 | 473 |
connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList())); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
474 |
connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect())); |
646 | 475 |
} |
476 |
||
477 |
void PageNet::slotConnect() |
|
478 |
{ |
|
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
479 |
HWNetServersModel * model = static_cast<HWNetServersModel *>(tvServersList->model()); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
480 |
QModelIndex mi = tvServersList->currentIndex(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
481 |
if(!mi.isValid()) |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
482 |
{ |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
483 |
QMessageBox::information(this, tr("Error"), tr("Please, select server from the list above")); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
484 |
return; |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
485 |
} |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
486 |
QString host = model->index(mi.row(), 1).data().toString(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
487 |
quint16 port = model->index(mi.row(), 2).data().toUInt(); |
672
08ed55ea1e2a
- Fix a bug when server fails to start, and then connecting to another server on the same host (strange, the fix won't work on my machine)
unc0rr
parents:
671
diff
changeset
|
488 |
|
08ed55ea1e2a
- Fix a bug when server fails to start, and then connecting to another server on the same host (strange, the fix won't work on my machine)
unc0rr
parents:
671
diff
changeset
|
489 |
emit connectClicked(host, port); |
646 | 490 |
} |
491 |
||
1153 | 492 |
PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent) |
646 | 493 |
{ |
494 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
495 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
496 |
pageLayout->setColumnStretch(0, 1); |
|
497 |
pageLayout->setColumnStretch(1, 1); |
|
498 |
pageLayout->setColumnStretch(2, 1); |
|
499 |
||
675 | 500 |
pageLayout->setRowStretch(0, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
501 |
pageLayout->setRowStretch(1, 0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
502 |
|
1153 | 503 |
BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
646 | 504 |
|
505 |
BtnStart = new QPushButton(this); |
|
506 |
BtnStart->setFont(*font14); |
|
507 |
BtnStart->setText(QPushButton::tr("Start")); |
|
675 | 508 |
pageLayout->addWidget(BtnStart, 1, 2); |
509 |
||
510 |
QWidget * wg = new QWidget(this); |
|
511 |
pageLayout->addWidget(wg, 0, 0, 1, 3); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
512 |
|
675 | 513 |
QGridLayout * wgLayout = new QGridLayout(wg); |
514 |
wgLayout->setColumnStretch(0, 1); |
|
515 |
wgLayout->setColumnStretch(1, 3); |
|
516 |
wgLayout->setColumnStretch(2, 1); |
|
517 |
||
518 |
wgLayout->setRowStretch(0, 0); |
|
519 |
wgLayout->setRowStretch(1, 1); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
520 |
|
675 | 521 |
QGroupBox * gb = new QGroupBox(wg); |
522 |
wgLayout->addWidget(gb, 0, 1); |
|
523 |
||
524 |
QGridLayout * gbLayout = new QGridLayout(gb); |
|
525 |
||
526 |
labelSD = new QLabel(gb); |
|
527 |
labelSD->setText(QLabel::tr("Server name:")); |
|
528 |
gbLayout->addWidget(labelSD, 0, 0); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
529 |
|
675 | 530 |
leServerDescr = new QLineEdit(gb); |
531 |
gbLayout->addWidget(leServerDescr, 0, 1); |
|
532 |
||
533 |
labelPort = new QLabel(gb); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
534 |
labelPort->setText(QLabel::tr("Server port:")); |
675 | 535 |
gbLayout->addWidget(labelPort, 1, 0); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
536 |
|
675 | 537 |
sbPort = new QSpinBox(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
538 |
sbPort->setMinimum(0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
539 |
sbPort->setMaximum(65535); |
675 | 540 |
gbLayout->addWidget(sbPort, 1, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
541 |
|
675 | 542 |
BtnDefault = new QPushButton(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
543 |
BtnDefault->setText(QPushButton::tr("default")); |
675 | 544 |
gbLayout->addWidget(BtnDefault, 1, 2); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
545 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
546 |
connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort())); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
547 |
} |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
548 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
549 |
void PageNetServer::setDefaultPort() |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
550 |
{ |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
551 |
sbPort->setValue(46631); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
552 |
} |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
553 |
|
1153 | 554 |
PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent) |
184 | 555 |
{ |
556 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
557 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 558 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 559 |
//pageLayout->setSpacing(1); |
463 | 560 |
pageLayout->setColumnStretch(0, 50); |
561 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 562 |
|
461 | 563 |
// chatwidget |
564 |
pChatWidget = new HWChatWidget(this); |
|
565 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 566 |
pageLayout->setRowStretch(1, 100); |
453 | 567 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
568 |
pGameCFG = new GameCFGWidget(this); |
322 | 569 |
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
|
570 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
571 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 572 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 573 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 574 |
|
1153 | 575 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
184 | 576 |
|
646 | 577 |
BtnGo = new QPushButton(this); |
184 | 578 |
BtnGo->setFont(*font14); |
579 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 580 |
BtnGo->setEnabled(false); |
461 | 581 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 582 |
} |
187 | 583 |
|
1153 | 584 |
PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent) |
187 | 585 |
{ |
586 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
587 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
588 |
pageLayout->setColumnStretch(0, 1); |
|
589 |
pageLayout->setColumnStretch(1, 1); |
|
590 |
pageLayout->setColumnStretch(2, 1); |
|
591 |
||
1153 | 592 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
187 | 593 |
|
594 |
about = new About(this); |
|
595 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
596 |
} |
|
306 | 597 |
|
1153 | 598 |
PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent) |
306 | 599 |
{ |
600 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
601 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
602 |
pageLayout->setColumnStretch(0, 1); |
|
603 |
pageLayout->setColumnStretch(1, 1); |
|
604 |
pageLayout->setColumnStretch(2, 1); |
|
605 |
||
1153 | 606 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
306 | 607 |
|
307 | 608 |
labelGameStats = new QLabel(this); |
609 |
labelGameStats->setTextFormat(Qt::RichText); |
|
610 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 611 |
} |
586 | 612 |
|
1150 | 613 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) |
586 | 614 |
{ |
615 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
616 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1252 | 617 |
// pageLayout->setColumnStretch(0, 1); |
618 |
// pageLayout->setColumnStretch(1, 2); |
|
619 |
// pageLayout->setColumnStretch(2, 1); |
|
588 | 620 |
pageLayout->setRowStretch(0, 1); |
1150 | 621 |
pageLayout->setRowStretch(6, 1); |
586 | 622 |
|
1150 | 623 |
BtnSimpleGamePage = addButton(tr("Simple Game"), pageLayout, 1, 1); |
624 |
BtnTrainPage = addButton(tr("Training"), pageLayout, 2, 1); |
|
625 |
BtnMultiplayer = addButton(tr("Multiplayer"), pageLayout, 3, 1); |
|
626 |
BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1); |
|
627 |
BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1); |
|
586 | 628 |
|
1153 | 629 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true); |
586 | 630 |
} |
631 |
||
1153 | 632 |
PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent) |
587 | 633 |
{ |
634 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
635 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
636 |
pageLayout->setColumnStretch(0, 1); |
|
637 |
pageLayout->setColumnStretch(1, 2); |
|
638 |
pageLayout->setColumnStretch(2, 1); |
|
639 |
||
640 |
BtnStartTrain = new QPushButton(this); |
|
641 |
BtnStartTrain->setFont(*font14); |
|
642 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
643 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
644 |
||
1153 | 645 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
587 | 646 |
} |
647 |
||
923
b3d097097b54
Use default ammostore string size for weapons number instead of predefined const
unc0rr
parents:
788
diff
changeset
|
648 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : |
684 | 649 |
AbstractPage(parent) |
600 | 650 |
{ |
651 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
923
b3d097097b54
Use default ammostore string size for weapons number instead of predefined const
unc0rr
parents:
788
diff
changeset
|
652 |
|
1168 | 653 |
pWeapons = new SelWeaponWidget(cDefaultAmmoStore->size() - 10, this); |
718 | 654 |
pageLayout->addWidget(pWeapons, 0, 0, 1, 4); |
600 | 655 |
|
1168 | 656 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
730 | 657 |
BtnDefault = addButton(tr("Default"), pageLayout, 1, 1); |
658 |
BtnDelete = addButton(tr("Delete"), pageLayout, 1, 2); |
|
1168 | 659 |
BtnSave = addButton(":/res/Save.png", pageLayout, 1, 3, true); |
600 | 660 |
} |
661 |
||
1249
b6670a6ea2d0
Remove 25pix margin on every page, so exit button is almost in the same place on all pages
unc0rr
parents:
1240
diff
changeset
|
662 |
PageInGame::PageInGame(QWidget* parent) : |
686 | 663 |
AbstractPage(parent) |
664 |
{ |
|
665 |
QLabel * label = new QLabel(this); |
|
666 |
label->setText("In game..."); |
|
667 |
} |