author | unc0rr |
Tue, 23 Sep 2008 06:27:53 +0000 | |
changeset 1286 | a02a5345b91e |
parent 1282 | 76533d0e76e3 |
child 1287 | 4a0cbcbe3521 |
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); |
1282 | 138 |
HHHats[i]->setIconSize(QSize(32, 37)); |
139 |
//HHHats[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents); |
|
1239 | 140 |
//HHHats[i]->setModelColumn(1); |
1240 | 141 |
//HHHats[i]->setMinimumWidth(132); |
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
142 |
GBHLayout->addWidget(HHHats[i], i, 1); |
184 | 143 |
} |
1252 | 144 |
vbox1->addWidget(GBoxHedgehogs); |
145 |
||
146 |
||
147 |
GBoxGrave = new QGroupBox(this); |
|
148 |
GBoxGrave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
149 |
GBoxGrave->setTitle(QGroupBox::tr("Grave")); |
|
150 |
QGridLayout * GBGLayout = new QGridLayout(GBoxGrave); |
|
151 |
CBGrave = new QComboBox(GBoxGrave); |
|
152 |
CBGrave->setMaxCount(65535); |
|
153 |
GBGLayout->addWidget(CBGrave, 0, 0, 1, 3); |
|
154 |
GravePreview = new QLabel(GBoxGrave); |
|
155 |
GravePreview->setScaledContents(false); |
|
156 |
GBGLayout->addWidget(GravePreview, 1, 1); |
|
157 |
vbox2->addWidget(GBoxGrave); |
|
158 |
||
159 |
//page1Layout->addWidget(new QWidget(), 3, 1, 1, 1); |
|
184 | 160 |
|
1252 | 161 |
GBoxTeamLvl = new QGroupBox(this); |
162 |
GBoxTeamLvl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
163 |
GBoxTeamLvl->setTitle(QGroupBox::tr("Team level")); |
|
164 |
QGridLayout * GBTLLayout = new QGridLayout(GBoxTeamLvl); |
|
165 |
CBTeamLvl = new QComboBox(GBoxTeamLvl); |
|
166 |
CBTeamLvl->addItem(QComboBox::tr("Human")); |
|
167 |
CBTeamLvl->addItem(QComboBox::tr("Level 5")); |
|
168 |
CBTeamLvl->addItem(QComboBox::tr("Level 4")); |
|
169 |
CBTeamLvl->addItem(QComboBox::tr("Level 3")); |
|
170 |
CBTeamLvl->addItem(QComboBox::tr("Level 2")); |
|
171 |
CBTeamLvl->addItem(QComboBox::tr("Level 1")); |
|
172 |
CBTeamLvl->setMaxCount(6); |
|
173 |
GBTLLayout->addWidget(CBTeamLvl, 0, 0, 1, 3); |
|
174 |
LevelPict = new QLabel(GBoxTeamLvl); |
|
175 |
LevelPict->setScaledContents(false); |
|
176 |
LevelPict->setFixedSize(32, 32); |
|
177 |
GBTLLayout->addWidget(LevelPict, 1, 1); |
|
178 |
vbox2->addWidget(GBoxTeamLvl); |
|
184 | 179 |
|
1252 | 180 |
GBoxFort = new QGroupBox(this); |
181 |
GBoxFort->setTitle(QGroupBox::tr("Fort")); |
|
182 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort); |
|
183 |
CBFort = new QComboBox(GBoxFort); |
|
184 |
CBFort->setMaxCount(65535); |
|
185 |
GBFLayout->addWidget(CBFort, 0, 0); |
|
186 |
FortPreview = new SquareLabel(GBoxFort); |
|
187 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
188 |
FortPreview->setPixmap(QPixmap()); |
|
189 |
GBFLayout->addWidget(FortPreview, 1, 0); |
|
190 |
vbox3->addWidget(GBoxFort); |
|
191 |
||
192 |
QDir tmpdir; |
|
193 |
tmpdir.cd(datadir->absolutePath()); |
|
194 |
tmpdir.cd("Forts"); |
|
195 |
tmpdir.setFilter(QDir::Files); |
|
196 |
||
197 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1")); |
|
198 |
tmpdir.cd("../Graphics/Graves"); |
|
199 |
QStringList list = tmpdir.entryList(QStringList("*.png")); |
|
200 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
|
201 |
{ |
|
202 |
CBGrave->addItem((*it).replace(QRegExp("^(.*)\\.png"), "\\1")); |
|
203 |
} |
|
204 |
||
205 |
connect(CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
|
206 |
connect(CBTeamLvl, SIGNAL(activated(int)), this, SLOT(CBTeamLvl_activated(int))); |
|
207 |
connect(CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
|
208 |
||
209 |
vbox1->addStretch(); |
|
210 |
vbox2->addStretch(); |
|
211 |
// vbox3->addStretch(); |
|
212 |
||
213 |
// ====== Page 2 ====== |
|
588 | 214 |
GBoxBinds = new QGroupBox(this); |
184 | 215 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
216 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
|
217 |
BindsBox = new QToolBox(GBoxBinds); |
|
218 |
BindsBox->setLineWidth(0); |
|
219 |
GBBLayout->addWidget(BindsBox); |
|
220 |
page_A = new QWidget(); |
|
221 |
BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
|
222 |
page_W = new QWidget(); |
|
223 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
|
224 |
page_WP = new QWidget(); |
|
225 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
|
226 |
page_O = new QWidget(); |
|
227 |
BindsBox->addItem(page_O, QToolBox::tr("Other")); |
|
1252 | 228 |
page2Layout->addWidget(GBoxBinds, 0, 0); |
184 | 229 |
|
230 |
QStringList binds; |
|
231 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
232 |
{ |
|
233 |
binds << sdlkeys[i][1]; |
|
234 |
} |
|
235 |
||
236 |
quint16 widind = 0, i = 0; |
|
237 |
while (i < BINDS_NUMBER) { |
|
238 |
quint16 num = 0; |
|
239 |
QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind)); |
|
240 |
do { |
|
241 |
LBind[i] = new QLabel(BindsBox->widget(widind)); |
|
242 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
|
243 |
LBind[i]->setAlignment(Qt::AlignRight); |
|
244 |
pagelayout->addWidget(LBind[i], num, 0); |
|
245 |
CBBind[i] = new QComboBox(BindsBox->widget(widind)); |
|
246 |
CBBind[i]->addItems(binds); |
|
247 |
pagelayout->addWidget(CBBind[i], num, 1); |
|
248 |
num++; |
|
249 |
} while (!cbinds[i++].chwidget); |
|
250 |
pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2); |
|
251 |
widind++; |
|
252 |
} |
|
253 |
} |
|
254 |
||
255 |
void PageEditTeam::CBGrave_activated(const QString & gravename) |
|
256 |
{ |
|
257 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png"); |
|
258 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32)); |
|
259 |
} |
|
260 |
||
261 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
262 |
{ |
|
263 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
|
264 |
FortPreview->setPixmap(pix); |
|
265 |
} |
|
266 |
||
336 | 267 |
void PageEditTeam::CBTeamLvl_activated(int id) |
268 |
{ |
|
269 |
QPixmap pix(QString(":/res/botlevels/%1.png").arg(id)); |
|
270 |
LevelPict->setPixmap(pix); |
|
271 |
} |
|
272 |
||
692 | 273 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : |
274 |
AbstractPage(parent) |
|
184 | 275 |
{ |
276 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
277 |
||
1218 | 278 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
187 | 279 |
|
184 | 280 |
gameCFG = new GameCFGWidget(this); |
281 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2); |
|
696 | 282 |
|
1218 | 283 |
pageLayout->setRowStretch(1, 1); |
284 |
||
184 | 285 |
teamsSelect = new TeamSelWidget(this); |
1218 | 286 |
pageLayout->addWidget(teamsSelect, 0, 2, 2, 2); |
184 | 287 |
|
1218 | 288 |
BtnStartMPGame = addButton(tr("Start"), pageLayout, 2, 3); |
184 | 289 |
} |
290 |
||
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
|
291 |
PageOptions::PageOptions(QWidget* parent) : |
692 | 292 |
AbstractPage(parent) |
184 | 293 |
{ |
294 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
427 | 295 |
pageLayout->setColumnStretch(0, 100); |
296 |
pageLayout->setColumnStretch(1, 100); |
|
297 |
pageLayout->setColumnStretch(2, 100); |
|
298 |
pageLayout->setRowStretch(0, 0); |
|
299 |
pageLayout->setRowStretch(1, 0); |
|
719 | 300 |
pageLayout->setRowStretch(2, 0); |
301 |
pageLayout->setRowStretch(3, 100); |
|
302 |
pageLayout->setRowStretch(4, 0); |
|
427 | 303 |
|
1198 | 304 |
|
305 |
QGroupBox * gbTwoBoxes = new QGroupBox(this); |
|
306 |
pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
|
307 |
QHBoxLayout * gbTBLayout = new QHBoxLayout(gbTwoBoxes); |
|
308 |
{ |
|
309 |
teamsBox = new IconedGroupBox(this); |
|
310 |
teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
|
311 |
teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
312 |
teamsBox->setTitle(QGroupBox::tr("Teams")); |
|
313 |
||
314 |
QGridLayout * GBTlayout = new QGridLayout(teamsBox); |
|
315 |
||
316 |
BtnNewTeam = addButton(tr("New team"), GBTlayout, 1, 0); |
|
317 |
||
318 |
CBTeamName = new QComboBox(teamsBox); |
|
319 |
GBTlayout->addWidget(CBTeamName, 0, 0, 1, 2); |
|
184 | 320 |
|
1198 | 321 |
BtnEditTeam = addButton(tr("Edit team"), GBTlayout, 1, 1); |
1199 | 322 |
|
323 |
labelNN = new QLabel(teamsBox); |
|
324 |
labelNN->setText(QLabel::tr("Net nick")); |
|
325 |
GBTlayout->addWidget(labelNN, 2, 0, 1, 2); |
|
326 |
||
327 |
editNetNick = new QLineEdit(teamsBox); |
|
328 |
editNetNick->setMaxLength(20); |
|
329 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
330 |
GBTlayout->addWidget(editNetNick, 3, 0, 1, 2); |
|
331 |
||
1198 | 332 |
gbTBLayout->addWidget(teamsBox); |
333 |
} |
|
184 | 334 |
|
1198 | 335 |
{ |
336 |
IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
|
1199 | 337 |
groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
1198 | 338 |
groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
1199 | 339 |
//groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
1198 | 340 |
groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
341 |
QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
|
184 | 342 |
|
1198 | 343 |
WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0); |
344 |
WeaponsName = new QComboBox(this); |
|
345 |
WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2); |
|
346 |
WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1); |
|
347 |
gbTBLayout->addWidget(groupWeapons); |
|
348 |
} |
|
184 | 349 |
|
1193 | 350 |
AGGroupBox = new IconedGroupBox(this); |
351 |
AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png")); |
|
184 | 352 |
AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
353 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
693 | 354 |
pageLayout->addWidget(AGGroupBox, 2, 1); |
184 | 355 |
|
427 | 356 |
QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
436 | 357 |
QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
427 | 358 |
QLabel * resolution = new QLabel(AGGroupBox); |
359 |
resolution->setText(QLabel::tr("Resolution")); |
|
360 |
GBAreslayout->addWidget(resolution); |
|
361 |
||
184 | 362 |
CBResolution = new QComboBox(AGGroupBox); |
427 | 363 |
GBAreslayout->addWidget(CBResolution); |
364 |
GBAlayout->addLayout(GBAreslayout); |
|
365 |
||
436 | 366 |
QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
427 | 367 |
QLabel * maxfps = new QLabel(AGGroupBox); |
368 |
maxfps->setText(QLabel::tr("FPS limit")); |
|
369 |
GBAfpslayout->addWidget(maxfps); |
|
370 |
GBAlayout->addLayout(GBAfpslayout); |
|
184 | 371 |
|
372 |
CBFullscreen = new QCheckBox(AGGroupBox); |
|
373 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
427 | 374 |
GBAlayout->addWidget(CBFullscreen); |
184 | 375 |
|
1162 | 376 |
CBFrontendFullscreen = new QCheckBox(AGGroupBox); |
377 |
CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen")); |
|
378 |
GBAlayout->addWidget(CBFrontendFullscreen); |
|
379 |
||
1157 | 380 |
CBEnableSound = new QCheckBox(AGGroupBox); |
184 | 381 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
427 | 382 |
GBAlayout->addWidget(CBEnableSound); |
184 | 383 |
|
1157 | 384 |
CBEnableMusic = new QCheckBox(AGGroupBox); |
1129 | 385 |
CBEnableMusic->setText(QCheckBox::tr("Enable music")); |
386 |
GBAlayout->addWidget(CBEnableMusic); |
|
387 |
||
297 | 388 |
CBShowFPS = new QCheckBox(AGGroupBox); |
389 |
CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
427 | 390 |
GBAlayout->addWidget(CBShowFPS); |
297 | 391 |
|
529 | 392 |
CBAltDamage = new QCheckBox(AGGroupBox); |
393 |
CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
394 |
GBAlayout->addWidget(CBAltDamage); |
|
395 |
||
297 | 396 |
fpsedit = new FPSEdit(AGGroupBox); |
427 | 397 |
GBAfpslayout->addWidget(fpsedit); |
184 | 398 |
|
1157 | 399 |
BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 4, 2, true); |
184 | 400 |
|
1153 | 401 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); |
184 | 402 |
} |
403 |
||
1153 | 404 |
PageNet::PageNet(QWidget* parent) : AbstractPage(parent) |
184 | 405 |
{ |
406 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
407 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
408 |
pageLayout->setColumnStretch(0, 1); |
|
409 |
pageLayout->setColumnStretch(1, 1); |
|
617 | 410 |
pageLayout->setColumnStretch(2, 1); |
421 | 411 |
|
412 |
BtnNetSvrStart = new QPushButton(this); |
|
413 |
BtnNetSvrStart->setFont(*font14); |
|
414 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
617 | 415 |
pageLayout->addWidget(BtnNetSvrStart, 3, 2); |
184 | 416 |
|
636 | 417 |
QGroupBox * NetTypeGroupBox = new QGroupBox(this); |
418 |
NetTypeGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
668 | 419 |
NetTypeGroupBox->setTitle(QGroupBox::tr("Servers list")); |
636 | 420 |
pageLayout->addWidget(NetTypeGroupBox, 0, 1); |
421 |
||
422 |
QVBoxLayout * GBTlayout = new QVBoxLayout(NetTypeGroupBox); |
|
423 |
rbLocalGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 424 |
rbLocalGame->setText(tr("Local")); |
636 | 425 |
rbLocalGame->setChecked(true); |
426 |
GBTlayout->addWidget(rbLocalGame); |
|
427 |
rbInternetGame = new QRadioButton(NetTypeGroupBox); |
|
668 | 428 |
rbInternetGame->setText(tr("Internet")); |
636 | 429 |
GBTlayout->addWidget(rbInternetGame); |
430 |
||
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
431 |
ConnGroupBox = new QGroupBox(this); |
421 | 432 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
433 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
434 |
GBClayout = new QGridLayout(ConnGroupBox); |
646 | 435 |
GBClayout->setColumnStretch(0, 1); |
421 | 436 |
GBClayout->setColumnStretch(1, 1); |
437 |
GBClayout->setColumnStretch(2, 1); |
|
184 | 438 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
439 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 440 |
BtnNetConnect->setFont(*font14); |
441 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
646 | 442 |
GBClayout->addWidget(BtnNetConnect, 2, 2); |
416 | 443 |
|
665 | 444 |
tvServersList = new QTableView(ConnGroupBox); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
445 |
tvServersList->setSelectionBehavior(QAbstractItemView::SelectRows); |
665 | 446 |
GBClayout->addWidget(tvServersList, 1, 0, 1, 3); |
421 | 447 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
448 |
BtnUpdateSList = new QPushButton(ConnGroupBox); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
449 |
BtnUpdateSList->setFont(*font14); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
450 |
BtnUpdateSList->setText(QPushButton::tr("Update")); |
646 | 451 |
GBClayout->addWidget(BtnUpdateSList, 2, 0); |
314 | 452 |
|
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
453 |
BtnSpecifyServer = new QPushButton(ConnGroupBox); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
454 |
BtnSpecifyServer->setFont(*font14); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
455 |
BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
456 |
GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
457 |
|
1153 | 458 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 3, 0, true); |
636 | 459 |
|
646 | 460 |
connect(rbLocalGame, SIGNAL(toggled(bool)), this, SLOT(updateServersList())); |
668 | 461 |
connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
184 | 462 |
} |
463 |
||
646 | 464 |
void PageNet::updateServersList() |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
465 |
{ |
636 | 466 |
if (rbLocalGame->isChecked()) |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
467 |
tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
667 | 468 |
else |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
469 |
tvServersList->setModel(new HWNetWwwModel(tvServersList)); |
659 | 470 |
|
673 | 471 |
tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
472 |
||
665 | 473 |
static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
474 |
|
665 | 475 |
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
|
476 |
connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect())); |
646 | 477 |
} |
478 |
||
479 |
void PageNet::slotConnect() |
|
480 |
{ |
|
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
481 |
HWNetServersModel * model = static_cast<HWNetServersModel *>(tvServersList->model()); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
482 |
QModelIndex mi = tvServersList->currentIndex(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
483 |
if(!mi.isValid()) |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
484 |
{ |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
485 |
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
|
486 |
return; |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
487 |
} |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
488 |
QString host = model->index(mi.row(), 1).data().toString(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
489 |
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
|
490 |
|
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
|
491 |
emit connectClicked(host, port); |
646 | 492 |
} |
493 |
||
1153 | 494 |
PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent) |
646 | 495 |
{ |
496 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
497 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
498 |
pageLayout->setColumnStretch(0, 1); |
|
499 |
pageLayout->setColumnStretch(1, 1); |
|
500 |
pageLayout->setColumnStretch(2, 1); |
|
501 |
||
675 | 502 |
pageLayout->setRowStretch(0, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
503 |
pageLayout->setRowStretch(1, 0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
504 |
|
1153 | 505 |
BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
646 | 506 |
|
507 |
BtnStart = new QPushButton(this); |
|
508 |
BtnStart->setFont(*font14); |
|
509 |
BtnStart->setText(QPushButton::tr("Start")); |
|
675 | 510 |
pageLayout->addWidget(BtnStart, 1, 2); |
511 |
||
512 |
QWidget * wg = new QWidget(this); |
|
513 |
pageLayout->addWidget(wg, 0, 0, 1, 3); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
514 |
|
675 | 515 |
QGridLayout * wgLayout = new QGridLayout(wg); |
516 |
wgLayout->setColumnStretch(0, 1); |
|
517 |
wgLayout->setColumnStretch(1, 3); |
|
518 |
wgLayout->setColumnStretch(2, 1); |
|
519 |
||
520 |
wgLayout->setRowStretch(0, 0); |
|
521 |
wgLayout->setRowStretch(1, 1); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
522 |
|
675 | 523 |
QGroupBox * gb = new QGroupBox(wg); |
524 |
wgLayout->addWidget(gb, 0, 1); |
|
525 |
||
526 |
QGridLayout * gbLayout = new QGridLayout(gb); |
|
527 |
||
528 |
labelSD = new QLabel(gb); |
|
529 |
labelSD->setText(QLabel::tr("Server name:")); |
|
530 |
gbLayout->addWidget(labelSD, 0, 0); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
531 |
|
675 | 532 |
leServerDescr = new QLineEdit(gb); |
533 |
gbLayout->addWidget(leServerDescr, 0, 1); |
|
534 |
||
535 |
labelPort = new QLabel(gb); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
536 |
labelPort->setText(QLabel::tr("Server port:")); |
675 | 537 |
gbLayout->addWidget(labelPort, 1, 0); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
538 |
|
675 | 539 |
sbPort = new QSpinBox(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
540 |
sbPort->setMinimum(0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
541 |
sbPort->setMaximum(65535); |
675 | 542 |
gbLayout->addWidget(sbPort, 1, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
543 |
|
675 | 544 |
BtnDefault = new QPushButton(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
545 |
BtnDefault->setText(QPushButton::tr("default")); |
675 | 546 |
gbLayout->addWidget(BtnDefault, 1, 2); |
657
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 |
connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort())); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
549 |
} |
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 |
void PageNetServer::setDefaultPort() |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
552 |
{ |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
553 |
sbPort->setValue(46631); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
554 |
} |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
555 |
|
1153 | 556 |
PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent) |
184 | 557 |
{ |
558 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
559 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 560 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 561 |
//pageLayout->setSpacing(1); |
463 | 562 |
pageLayout->setColumnStretch(0, 50); |
563 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 564 |
|
461 | 565 |
// chatwidget |
566 |
pChatWidget = new HWChatWidget(this); |
|
567 |
pageLayout->addWidget(pChatWidget, 1, 0); |
|
464 | 568 |
pageLayout->setRowStretch(1, 100); |
453 | 569 |
|
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 |
pGameCFG = new GameCFGWidget(this); |
322 | 571 |
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
|
572 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
573 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 574 |
pNetTeamsWidget->setAcceptOuter(true); |
461 | 575 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1, 2, 1); |
184 | 576 |
|
1153 | 577 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
184 | 578 |
|
646 | 579 |
BtnGo = new QPushButton(this); |
184 | 580 |
BtnGo->setFont(*font14); |
581 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
492 | 582 |
BtnGo->setEnabled(false); |
461 | 583 |
pageLayout->addWidget(BtnGo, 2, 1); |
184 | 584 |
} |
187 | 585 |
|
1153 | 586 |
PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent) |
187 | 587 |
{ |
588 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
589 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
590 |
pageLayout->setColumnStretch(0, 1); |
|
591 |
pageLayout->setColumnStretch(1, 1); |
|
592 |
pageLayout->setColumnStretch(2, 1); |
|
593 |
||
1153 | 594 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
187 | 595 |
|
596 |
about = new About(this); |
|
597 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
598 |
} |
|
306 | 599 |
|
1153 | 600 |
PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent) |
306 | 601 |
{ |
602 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
603 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
604 |
pageLayout->setColumnStretch(0, 1); |
|
605 |
pageLayout->setColumnStretch(1, 1); |
|
606 |
pageLayout->setColumnStretch(2, 1); |
|
607 |
||
1153 | 608 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
306 | 609 |
|
307 | 610 |
labelGameStats = new QLabel(this); |
611 |
labelGameStats->setTextFormat(Qt::RichText); |
|
612 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); |
|
306 | 613 |
} |
586 | 614 |
|
1150 | 615 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) |
586 | 616 |
{ |
617 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
618 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1252 | 619 |
// pageLayout->setColumnStretch(0, 1); |
620 |
// pageLayout->setColumnStretch(1, 2); |
|
621 |
// pageLayout->setColumnStretch(2, 1); |
|
588 | 622 |
pageLayout->setRowStretch(0, 1); |
1150 | 623 |
pageLayout->setRowStretch(6, 1); |
586 | 624 |
|
1150 | 625 |
BtnSimpleGamePage = addButton(tr("Simple Game"), pageLayout, 1, 1); |
626 |
BtnTrainPage = addButton(tr("Training"), pageLayout, 2, 1); |
|
627 |
BtnMultiplayer = addButton(tr("Multiplayer"), pageLayout, 3, 1); |
|
628 |
BtnLoad = addButton(tr("Saved games"), pageLayout, 4, 1); |
|
629 |
BtnDemos = addButton(tr("Demos"), pageLayout, 5, 1); |
|
586 | 630 |
|
1153 | 631 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true); |
586 | 632 |
} |
633 |
||
1153 | 634 |
PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent) |
587 | 635 |
{ |
636 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
637 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
638 |
pageLayout->setColumnStretch(0, 1); |
|
639 |
pageLayout->setColumnStretch(1, 2); |
|
640 |
pageLayout->setColumnStretch(2, 1); |
|
641 |
||
642 |
BtnStartTrain = new QPushButton(this); |
|
643 |
BtnStartTrain->setFont(*font14); |
|
644 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
645 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
646 |
||
1153 | 647 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
587 | 648 |
} |
649 |
||
923
b3d097097b54
Use default ammostore string size for weapons number instead of predefined const
unc0rr
parents:
788
diff
changeset
|
650 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : |
684 | 651 |
AbstractPage(parent) |
600 | 652 |
{ |
653 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
923
b3d097097b54
Use default ammostore string size for weapons number instead of predefined const
unc0rr
parents:
788
diff
changeset
|
654 |
|
1168 | 655 |
pWeapons = new SelWeaponWidget(cDefaultAmmoStore->size() - 10, this); |
718 | 656 |
pageLayout->addWidget(pWeapons, 0, 0, 1, 4); |
600 | 657 |
|
1168 | 658 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
730 | 659 |
BtnDefault = addButton(tr("Default"), pageLayout, 1, 1); |
660 |
BtnDelete = addButton(tr("Delete"), pageLayout, 1, 2); |
|
1168 | 661 |
BtnSave = addButton(":/res/Save.png", pageLayout, 1, 3, true); |
600 | 662 |
} |
663 |
||
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
|
664 |
PageInGame::PageInGame(QWidget* parent) : |
686 | 665 |
AbstractPage(parent) |
666 |
{ |
|
667 |
QLabel * label = new QLabel(this); |
|
668 |
label->setText("In game..."); |
|
669 |
} |