author | unc0rr |
Wed, 07 Oct 2009 14:37:42 +0000 | |
changeset 2407 | 9f413bd5150e |
parent 2402 | edd12b259e7c |
child 2414 | fd9ca82077d8 |
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> |
1377 | 36 |
#include <QTextBrowser> |
1399 | 37 |
#include <QTableWidget> |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
38 |
#include <QAction> |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
39 |
#include <QMenu> |
1885 | 40 |
#include <QDataWidgetMapper> |
41 |
||
184 | 42 |
|
43 |
#include "pages.h" |
|
44 |
#include "sdlkeys.h" |
|
45 |
#include "hwconsts.h" |
|
46 |
#include "gamecfgwidget.h" |
|
47 |
#include "teamselect.h" |
|
48 |
#include "gamecfgwidget.h" |
|
49 |
#include "SquareLabel.h" |
|
50 |
#include "mapContainer.h" |
|
187 | 51 |
#include "about.h" |
297 | 52 |
#include "fpsedit.h" |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
53 |
#include "netserverslist.h" |
412 | 54 |
#include "netudpwidget.h" |
461 | 55 |
#include "chatwidget.h" |
579 | 56 |
#include "playrecordpage.h" |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
603
diff
changeset
|
57 |
#include "selectWeapon.h" |
1192 | 58 |
#include "igbox.h" |
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
59 |
#include "hats.h" |
1885 | 60 |
#include "misc.h" |
1932 | 61 |
#include "togglebutton.h" |
2098
c977d7f2aa09
Toggle for stars ("frontend effects") - also turns off optimisations for stars that were causing problems onone machine
nemo
parents:
2093
diff
changeset
|
62 |
#include "hwform.h" |
2191 | 63 |
#include "SDLs.h" |
184 | 64 |
|
2377 | 65 |
PageMain::PageMain(QWidget* parent) : |
684 | 66 |
AbstractPage(parent) |
184 | 67 |
{ |
2098
c977d7f2aa09
Toggle for stars ("frontend effects") - also turns off optimisations for stars that were causing problems onone machine
nemo
parents:
2093
diff
changeset
|
68 |
if(frontendEffects) setAttribute(Qt::WA_NoSystemBackground, true); |
184 | 69 |
QGridLayout * pageLayout = new QGridLayout(this); |
1148 | 70 |
//pageLayout->setColumnStretch(0, 1); |
71 |
//pageLayout->setColumnStretch(1, 2); |
|
72 |
//pageLayout->setColumnStretch(2, 1); |
|
184 | 73 |
|
1199 | 74 |
//QPushButton* btnLogo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true); |
75 |
//pageLayout->setAlignment(btnLogo, Qt::AlignHCenter); |
|
1148 | 76 |
pageLayout->setRowStretch(0, 1); |
1150 | 77 |
pageLayout->setRowStretch(1, 1); |
78 |
pageLayout->setRowStretch(2, 0); |
|
79 |
pageLayout->setRowStretch(3, 1); |
|
1199 | 80 |
pageLayout->setRowStretch(4, 1); |
184 | 81 |
|
1152
c72b939c00df
Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents:
1151
diff
changeset
|
82 |
BtnSinglePlayer = addButton(":/res/LocalPlay.png", pageLayout, 2, 0, 1, 2, true); |
1450 | 83 |
BtnSinglePlayer->setToolTip(tr("Local Game (Play a game on a single computer)")); |
1150 | 84 |
pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignHCenter); |
184 | 85 |
|
1152
c72b939c00df
Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents:
1151
diff
changeset
|
86 |
BtnNet = addButton(":/res/NetworkPlay.png", pageLayout, 2, 2, 1, 2, true); |
1450 | 87 |
BtnNet->setToolTip(tr("Network Game (Play a game across a network)")); |
1150 | 88 |
pageLayout->setAlignment(BtnNet, Qt::AlignHCenter); |
579 | 89 |
|
1199 | 90 |
BtnSetup = addButton(":/res/Settings.png", pageLayout, 4, 3, true); |
184 | 91 |
|
1199 | 92 |
//BtnInfo = addButton(":/res/About.png", pageLayout, 3, 1, 1, 2, true); |
93 |
BtnInfo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true); |
|
1212 | 94 |
BtnInfo->setStyleSheet("border: transparent;background: transparent;"); |
1150 | 95 |
pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter); |
1199 | 96 |
//pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter); |
184 | 97 |
|
1199 | 98 |
BtnExit = addButton(":/res/Exit.png", pageLayout, 4, 0, 1, 1, true); |
184 | 99 |
} |
100 |
||
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
730
diff
changeset
|
101 |
PageEditTeam::PageEditTeam(QWidget* parent) : |
692 | 102 |
AbstractPage(parent) |
184 | 103 |
{ |
104 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1252 | 105 |
QTabWidget * tbw = new QTabWidget(this); |
1389 | 106 |
QWidget * page1 = new QWidget(this); |
107 |
QWidget * page2 = new QWidget(this); |
|
1252 | 108 |
tbw->addTab(page1, tr("General")); |
109 |
tbw->addTab(page2, tr("Advanced")); |
|
110 |
pageLayout->addWidget(tbw, 0, 0, 1, 3); |
|
111 |
BtnTeamDiscard = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
|
112 |
BtnTeamSave = addButton(":/res/Save.png", pageLayout, 1, 2, true);; |
|
1443 | 113 |
BtnTeamSave->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); |
2377 | 114 |
|
1252 | 115 |
QHBoxLayout * page1Layout = new QHBoxLayout(page1); |
116 |
page1Layout->setAlignment(Qt::AlignTop); |
|
117 |
QGridLayout * page2Layout = new QGridLayout(page2); |
|
118 |
||
119 |
// ====== Page 1 ====== |
|
120 |
QVBoxLayout * vbox1 = new QVBoxLayout(); |
|
121 |
QVBoxLayout * vbox2 = new QVBoxLayout(); |
|
122 |
QVBoxLayout * vbox3 = new QVBoxLayout(); |
|
123 |
page1Layout->addLayout(vbox1); |
|
124 |
page1Layout->addLayout(vbox2); |
|
125 |
page1Layout->addLayout(vbox3); |
|
2377 | 126 |
|
588 | 127 |
GBoxHedgehogs = new QGroupBox(this); |
184 | 128 |
GBoxHedgehogs->setTitle(QGroupBox::tr("Team Members")); |
129 |
GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
130 |
QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs); |
|
1840 | 131 |
|
132 |
signalMapper = new QSignalMapper(this); |
|
2377 | 133 |
|
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
134 |
HatsModel * hatsModel = new HatsModel(GBoxHedgehogs); |
184 | 135 |
for(int i = 0; i < 8; i++) |
136 |
{ |
|
1238
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
137 |
HHHats[i] = new QComboBox(GBoxHedgehogs); |
914bd2a9a249
Add hat selection control to team editing page (it's empty combobox yet)
unc0rr
parents:
1236
diff
changeset
|
138 |
HHHats[i]->setModel(hatsModel); |
1282 | 139 |
HHHats[i]->setIconSize(QSize(32, 37)); |
140 |
//HHHats[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents); |
|
1239 | 141 |
//HHHats[i]->setModelColumn(1); |
1240 | 142 |
//HHHats[i]->setMinimumWidth(132); |
1840 | 143 |
GBHLayout->addWidget(HHHats[i], i, 0); |
144 |
||
145 |
HHNameEdit[i] = new QLineEdit(GBoxHedgehogs); |
|
146 |
HHNameEdit[i]->setMaxLength(64); |
|
147 |
HHNameEdit[i]->setMinimumWidth(120); |
|
148 |
GBHLayout->addWidget(HHNameEdit[i], i, 1); |
|
2377 | 149 |
|
1840 | 150 |
randButton[i] = addButton(":/res/dice.png", GBHLayout, i, 3, true); |
151 |
||
152 |
connect(randButton[i], SIGNAL(clicked()), signalMapper, SLOT(map())); |
|
153 |
signalMapper->setMapping(randButton[i], i); |
|
154 |
||
184 | 155 |
} |
1840 | 156 |
|
157 |
randTeamButton = addButton("Random Team", GBHLayout, 9, false); |
|
158 |
||
1252 | 159 |
vbox1->addWidget(GBoxHedgehogs); |
160 |
||
161 |
||
1288
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
162 |
GBoxTeam = new QGroupBox(this); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
163 |
GBoxTeam->setTitle(QGroupBox::tr("Team")); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
164 |
GBoxTeam->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
165 |
QVBoxLayout * GBTLayout = new QVBoxLayout(GBoxTeam); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
166 |
TeamNameEdit = new QLineEdit(GBoxTeam); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
167 |
TeamNameEdit->setMaxLength(64); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
168 |
GBTLayout->addWidget(TeamNameEdit); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
169 |
vbox2->addWidget(GBoxTeam); |
2377 | 170 |
|
1290 | 171 |
CBTeamLvl = new QComboBox(GBoxTeam); |
1440 | 172 |
CBTeamLvl->setIconSize(QSize(48, 48)); |
1287 | 173 |
CBTeamLvl->addItem(QIcon(":/res/botlevels/0.png"), QComboBox::tr("Human")); |
174 |
for(int i = 5; i > 0; i--) |
|
175 |
CBTeamLvl->addItem( |
|
176 |
QIcon(QString(":/res/botlevels/%1.png").arg(6 - i)), |
|
177 |
QString("%1 %2").arg(QComboBox::tr("Level")).arg(i) |
|
178 |
); |
|
1288
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
179 |
GBTLayout->addWidget(CBTeamLvl); |
2377 | 180 |
|
1290 | 181 |
CBGrave = new QComboBox(GBoxTeam); |
1288
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
182 |
CBGrave->setMaxCount(65535); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
183 |
CBGrave->setIconSize(QSize(32, 32)); |
cea4a8f52f5a
Reorganize team edit page a little (save a lot of space)
unc0rr
parents:
1287
diff
changeset
|
184 |
GBTLayout->addWidget(CBGrave); |
1684 | 185 |
|
1659 | 186 |
{ |
1684 | 187 |
QHBoxLayout * hbox = new QHBoxLayout(); |
188 |
CBVoicepack = new QComboBox(GBoxTeam); |
|
189 |
{ |
|
190 |
QDir tmpdir; |
|
191 |
tmpdir.cd(datadir->absolutePath()); |
|
192 |
tmpdir.cd("Sounds/voices"); |
|
193 |
QStringList list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name); |
|
194 |
CBVoicepack->addItems(list); |
|
195 |
} |
|
196 |
hbox->addWidget(CBVoicepack, 100); |
|
1718 | 197 |
BtnTestSound = addButton(":/res/PlaySound.png", hbox, 1, true); |
2294
2e6ffb3ef304
For people's consideration. Restore the .11 behaviour of not initialising sound if music is turned off. Reason. I still get 100% CPU useage in frontend due to sucky sound daemon setups *cough*pulseaudio*cough* so this offers an easy workaround for people (turn off music). Disadvantage, this removes Smaxx' code to disable sound-related buttons on failure to init sound.
nemo
parents:
2261
diff
changeset
|
198 |
//BtnTestSound->setEnabled(openal_ready()); |
1684 | 199 |
hbox->setStretchFactor(BtnTestSound, 1); |
200 |
connect(BtnTestSound, SIGNAL(clicked()), this, SLOT(testSound())); |
|
201 |
GBTLayout->addLayout(hbox); |
|
1659 | 202 |
} |
203 |
||
1252 | 204 |
GBoxFort = new QGroupBox(this); |
205 |
GBoxFort->setTitle(QGroupBox::tr("Fort")); |
|
206 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort); |
|
207 |
CBFort = new QComboBox(GBoxFort); |
|
208 |
CBFort->setMaxCount(65535); |
|
209 |
GBFLayout->addWidget(CBFort, 0, 0); |
|
210 |
FortPreview = new SquareLabel(GBoxFort); |
|
211 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
212 |
FortPreview->setPixmap(QPixmap()); |
|
2072
6e0fcbcc3f60
Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents:
2071
diff
changeset
|
213 |
// perhaps due to handling its own paintevents, SquareLabel doesn't play nice with the stars |
6e0fcbcc3f60
Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents:
2071
diff
changeset
|
214 |
//FortPreview->setAttribute(Qt::WA_PaintOnScreen, true); |
1252 | 215 |
GBFLayout->addWidget(FortPreview, 1, 0); |
216 |
vbox3->addWidget(GBoxFort); |
|
217 |
||
218 |
QDir tmpdir; |
|
219 |
tmpdir.cd(datadir->absolutePath()); |
|
220 |
tmpdir.cd("Forts"); |
|
221 |
tmpdir.setFilter(QDir::Files); |
|
222 |
||
1287 | 223 |
connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
1252 | 224 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1")); |
2377 | 225 |
|
1252 | 226 |
tmpdir.cd("../Graphics/Graves"); |
227 |
QStringList list = tmpdir.entryList(QStringList("*.png")); |
|
228 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
|
229 |
{ |
|
1287 | 230 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + *it); |
231 |
QIcon icon(pix.copy(0, 0, 32, 32)); |
|
232 |
CBGrave->addItem(icon, (*it).replace(QRegExp("^(.*)\\.png"), "\\1")); |
|
1252 | 233 |
} |
234 |
||
235 |
vbox1->addStretch(); |
|
236 |
vbox2->addStretch(); |
|
237 |
// vbox3->addStretch(); |
|
238 |
||
239 |
// ====== Page 2 ====== |
|
588 | 240 |
GBoxBinds = new QGroupBox(this); |
184 | 241 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
242 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
|
243 |
BindsBox = new QToolBox(GBoxBinds); |
|
244 |
BindsBox->setLineWidth(0); |
|
245 |
GBBLayout->addWidget(BindsBox); |
|
1389 | 246 |
page_A = new QWidget(this); |
184 | 247 |
BindsBox->addItem(page_A, QToolBox::tr("Actions")); |
1389 | 248 |
page_W = new QWidget(this); |
184 | 249 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons")); |
1389 | 250 |
page_WP = new QWidget(this); |
184 | 251 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties")); |
1389 | 252 |
page_O = new QWidget(this); |
184 | 253 |
BindsBox->addItem(page_O, QToolBox::tr("Other")); |
1252 | 254 |
page2Layout->addWidget(GBoxBinds, 0, 0); |
184 | 255 |
|
256 |
QStringList binds; |
|
257 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
258 |
{ |
|
259 |
binds << sdlkeys[i][1]; |
|
260 |
} |
|
261 |
||
262 |
quint16 widind = 0, i = 0; |
|
263 |
while (i < BINDS_NUMBER) { |
|
264 |
quint16 num = 0; |
|
1389 | 265 |
QWidget * curW = BindsBox->widget(widind); |
266 |
QGridLayout * pagelayout = new QGridLayout(curW); |
|
184 | 267 |
do { |
1389 | 268 |
LBind[i] = new QLabel(curW); |
184 | 269 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name)); |
270 |
LBind[i]->setAlignment(Qt::AlignRight); |
|
271 |
pagelayout->addWidget(LBind[i], num, 0); |
|
1389 | 272 |
CBBind[i] = new QComboBox(curW); |
184 | 273 |
CBBind[i]->addItems(binds); |
274 |
pagelayout->addWidget(CBBind[i], num, 1); |
|
275 |
num++; |
|
276 |
} while (!cbinds[i++].chwidget); |
|
1389 | 277 |
pagelayout->addWidget(new QWidget(curW), num, 0, 1, 2); |
184 | 278 |
widind++; |
279 |
} |
|
280 |
} |
|
281 |
||
282 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
283 |
{ |
|
284 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
|
285 |
FortPreview->setPixmap(pix); |
|
286 |
} |
|
287 |
||
1684 | 288 |
void PageEditTeam::testSound() |
289 |
{ |
|
2194
1597710c6118
koda adds threading for fadein/out. Untested under windows, but works beautifully under Linux (and presumably OSX, right koda?)
nemo
parents:
2191
diff
changeset
|
290 |
int sound; |
1684 | 291 |
QDir tmpdir; |
2402
edd12b259e7c
revert to manual startup of frontend's OpenAL session (keeping voices' bug fixed)
koda
parents:
2395
diff
changeset
|
292 |
|
edd12b259e7c
revert to manual startup of frontend's OpenAL session (keeping voices' bug fixed)
koda
parents:
2395
diff
changeset
|
293 |
OpenAL_Init(); |
edd12b259e7c
revert to manual startup of frontend's OpenAL session (keeping voices' bug fixed)
koda
parents:
2395
diff
changeset
|
294 |
|
1684 | 295 |
tmpdir.cd(datadir->absolutePath()); |
296 |
tmpdir.cd("Sounds/voices"); |
|
297 |
tmpdir.cd(CBVoicepack->currentText()); |
|
2191 | 298 |
QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files); |
299 |
if (list.size()) { |
|
2194
1597710c6118
koda adds threading for fadein/out. Untested under windows, but works beautifully under Linux (and presumably OSX, right koda?)
nemo
parents:
2191
diff
changeset
|
300 |
sound = openal_loadfile(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData()); |
2377 | 301 |
openal_playsound(sound); |
2191 | 302 |
} |
1684 | 303 |
} |
304 |
||
1287 | 305 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : |
692 | 306 |
AbstractPage(parent) |
184 | 307 |
{ |
308 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
309 |
||
1218 | 310 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
187 | 311 |
|
184 | 312 |
gameCFG = new GameCFGWidget(this); |
313 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2); |
|
696 | 314 |
|
1218 | 315 |
pageLayout->setRowStretch(1, 1); |
316 |
||
184 | 317 |
teamsSelect = new TeamSelWidget(this); |
1218 | 318 |
pageLayout->addWidget(teamsSelect, 0, 2, 2, 2); |
184 | 319 |
|
1218 | 320 |
BtnStartMPGame = addButton(tr("Start"), pageLayout, 2, 3); |
184 | 321 |
} |
322 |
||
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
|
323 |
PageOptions::PageOptions(QWidget* parent) : |
692 | 324 |
AbstractPage(parent) |
184 | 325 |
{ |
326 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
427 | 327 |
pageLayout->setColumnStretch(0, 100); |
328 |
pageLayout->setColumnStretch(1, 100); |
|
329 |
pageLayout->setColumnStretch(2, 100); |
|
330 |
pageLayout->setRowStretch(0, 0); |
|
1644 | 331 |
pageLayout->setRowStretch(1, 100); |
719 | 332 |
pageLayout->setRowStretch(2, 0); |
1644 | 333 |
pageLayout->setContentsMargins(7, 7, 7, 0); |
334 |
pageLayout->setSpacing(0); |
|
427 | 335 |
|
1198 | 336 |
|
337 |
QGroupBox * gbTwoBoxes = new QGroupBox(this); |
|
338 |
pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
|
1644 | 339 |
QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes); |
340 |
gbTBLayout->setMargin(0); |
|
341 |
gbTBLayout->setSpacing(0); |
|
1198 | 342 |
{ |
2395 | 343 |
teamsBox = new IconedGroupBox(this); |
344 |
//teamsBox->setAttribute(Qt::WA_PaintOnScreen, true); |
|
345 |
teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
|
346 |
teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
347 |
teamsBox->setTitle(QGroupBox::tr("Teams")); |
|
1198 | 348 |
|
2395 | 349 |
QVBoxLayout * GBTlayout = new QVBoxLayout(teamsBox); |
184 | 350 |
|
2395 | 351 |
CBTeamName = new QComboBox(teamsBox); |
352 |
GBTlayout->addWidget(CBTeamName); |
|
2377 | 353 |
|
2395 | 354 |
QHBoxLayout * layout1 = new QHBoxLayout; |
355 |
GBTlayout->addLayout(layout1); |
|
356 |
BtnNewTeam = addButton(tr("New team"), layout1, 0); |
|
357 |
BtnEditTeam = addButton(tr("Edit team"), layout1, 1); |
|
358 |
layout1->setStretchFactor(BtnNewTeam, 100); |
|
359 |
layout1->setStretchFactor(BtnEditTeam, 100); |
|
1199 | 360 |
|
2395 | 361 |
QHBoxLayout * layout2 = new QHBoxLayout; |
362 |
GBTlayout->addLayout(layout2); |
|
184 | 363 |
|
2395 | 364 |
labelNN = new QLabel(teamsBox); |
365 |
labelNN->setText(QLabel::tr("Net nick")); |
|
366 |
layout2->addWidget(labelNN); |
|
184 | 367 |
|
2395 | 368 |
editNetNick = new QLineEdit(teamsBox); |
369 |
editNetNick->setMaxLength(20); |
|
370 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
|
371 |
layout2->addWidget(editNetNick); |
|
372 |
||
373 |
gbTBLayout->addWidget(teamsBox, 0, 0); |
|
1198 | 374 |
} |
184 | 375 |
|
2395 | 376 |
{ |
377 |
IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
|
378 |
groupWeapons->setContentTopPadding(0); |
|
379 |
groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
380 |
groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
|
381 |
//groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
382 |
groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
|
383 |
QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
|
184 | 384 |
|
2395 | 385 |
WeaponsButt = addButton(tr("Weapons set"), WeaponsLayout, 1, 0); |
386 |
WeaponsName = new QComboBox(this); |
|
387 |
WeaponsLayout->addWidget(WeaponsName, 0, 0, 1, 2); |
|
388 |
WeaponEdit = addButton(tr("Edit"), WeaponsLayout, 1, 1); |
|
389 |
gbTBLayout->addWidget(groupWeapons, 1, 0); |
|
390 |
} |
|
2377 | 391 |
|
2395 | 392 |
{ |
393 |
AGGroupBox = new IconedGroupBox(this); |
|
394 |
AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png")); |
|
395 |
AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
396 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
427 | 397 |
|
2395 | 398 |
QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
399 |
QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
|
184 | 400 |
|
2395 | 401 |
QLabel * resolution = new QLabel(AGGroupBox); |
402 |
resolution->setText(QLabel::tr("Resolution")); |
|
403 |
GBAreslayout->addWidget(resolution); |
|
404 |
||
405 |
CBResolution = new QComboBox(AGGroupBox); |
|
406 |
GBAreslayout->addWidget(CBResolution); |
|
407 |
GBAlayout->addLayout(GBAreslayout); |
|
1812 | 408 |
|
2395 | 409 |
QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
410 |
QLabel * maxfps = new QLabel(AGGroupBox); |
|
411 |
maxfps->setText(QLabel::tr("FPS limit")); |
|
412 |
GBAfpslayout->addWidget(maxfps); |
|
413 |
GBAlayout->addLayout(GBAfpslayout); |
|
2098
c977d7f2aa09
Toggle for stars ("frontend effects") - also turns off optimisations for stars that were causing problems onone machine
nemo
parents:
2093
diff
changeset
|
414 |
|
2395 | 415 |
CBReduceQuality = new QCheckBox(AGGroupBox); |
416 |
CBReduceQuality->setText(QCheckBox::tr("Reduce Quality")); |
|
417 |
GBAlayout->addWidget(CBReduceQuality); |
|
184 | 418 |
|
2395 | 419 |
CBFrontendEffects = new QCheckBox(AGGroupBox); |
420 |
CBFrontendEffects->setText(QCheckBox::tr("Frontend Effects (Requires Restart)")); |
|
421 |
GBAlayout->addWidget(CBFrontendEffects); |
|
1162 | 422 |
|
2395 | 423 |
CBFullscreen = new QCheckBox(AGGroupBox); |
424 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
425 |
GBAlayout->addWidget(CBFullscreen); |
|
426 |
||
427 |
CBFrontendFullscreen = new QCheckBox(AGGroupBox); |
|
428 |
CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen")); |
|
429 |
GBAlayout->addWidget(CBFrontendFullscreen); |
|
2392
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2377
diff
changeset
|
430 |
|
2395 | 431 |
CBHardwareSound = new QCheckBox(AGGroupBox); |
432 |
CBHardwareSound->setText(QCheckBox::tr("Use hardware sound (if available; requires restart)")); |
|
433 |
//CBHardwareSound->setEnabled(openal_ready()); |
|
434 |
GBAlayout->addWidget(CBHardwareSound); |
|
184 | 435 |
|
2395 | 436 |
CBEnableSound = new QCheckBox(AGGroupBox); |
437 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
|
438 |
//CBEnableSound->setEnabled(openal_ready()); |
|
439 |
GBAlayout->addWidget(CBEnableSound); |
|
440 |
CBEnableMusic = new QCheckBox(AGGroupBox); |
|
441 |
CBEnableMusic->setText(QCheckBox::tr("Enable music")); |
|
442 |
//CBEnableMusic->setEnabled(openal_ready()); |
|
443 |
GBAlayout->addWidget(CBEnableMusic); |
|
1129 | 444 |
|
2395 | 445 |
QHBoxLayout * GBAvollayout = new QHBoxLayout(0); |
446 |
QLabel * vol = new QLabel(AGGroupBox); |
|
447 |
vol->setText(QLabel::tr("Initial sound volume")); |
|
448 |
GBAvollayout->addWidget(vol); |
|
449 |
GBAlayout->addLayout(GBAvollayout); |
|
450 |
volumeBox = new QSpinBox(AGGroupBox); |
|
451 |
volumeBox->setRange(0, 100); |
|
452 |
volumeBox->setSingleStep(5); |
|
453 |
//volumeBox->setEnabled(openal_ready()); |
|
454 |
GBAvollayout->addWidget(volumeBox); |
|
1777 | 455 |
|
2395 | 456 |
CBShowFPS = new QCheckBox(AGGroupBox); |
457 |
CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
458 |
GBAlayout->addWidget(CBShowFPS); |
|
297 | 459 |
|
2395 | 460 |
CBAltDamage = new QCheckBox(AGGroupBox); |
461 |
CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
462 |
GBAlayout->addWidget(CBAltDamage); |
|
529 | 463 |
|
2395 | 464 |
CBNameWithDate = new QCheckBox(AGGroupBox); |
465 |
CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
|
466 |
GBAlayout->addWidget(CBNameWithDate); |
|
1487
b4cc59a6d50a
Add an option to name records with current date and time
unc0rr
parents:
1457
diff
changeset
|
467 |
|
2395 | 468 |
#ifdef SPARKLE_ENABLED |
469 |
CBAutoUpdate = new QCheckBox(AGGroupBox); |
|
470 |
CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup")); |
|
471 |
GBAlayout->addWidget(CBAutoUpdate); |
|
2261 | 472 |
#endif |
2377 | 473 |
|
2261 | 474 |
fpsedit = new FPSEdit(AGGroupBox); |
475 |
GBAfpslayout->addWidget(fpsedit); |
|
476 |
gbTBLayout->addWidget(AGGroupBox, 0, 1, 2, 1); |
|
2395 | 477 |
} |
184 | 478 |
|
1644 | 479 |
BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 2, 2, true); |
1443 | 480 |
BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); |
184 | 481 |
|
1644 | 482 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
184 | 483 |
} |
484 |
||
1153 | 485 |
PageNet::PageNet(QWidget* parent) : AbstractPage(parent) |
184 | 486 |
{ |
487 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
488 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
489 |
pageLayout->setColumnStretch(0, 1); |
|
490 |
pageLayout->setColumnStretch(1, 1); |
|
617 | 491 |
pageLayout->setColumnStretch(2, 1); |
421 | 492 |
|
493 |
BtnNetSvrStart = new QPushButton(this); |
|
494 |
BtnNetSvrStart->setFont(*font14); |
|
495 |
BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
|
1415
6fbfee0e113a
Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents:
1409
diff
changeset
|
496 |
BtnNetSvrStart->setVisible(haveServer); |
1395 | 497 |
pageLayout->addWidget(BtnNetSvrStart, 4, 2); |
498 |
||
499 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); |
|
2377 | 500 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
501 |
ConnGroupBox = new QGroupBox(this); |
421 | 502 |
ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
503 |
pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
504 |
GBClayout = new QGridLayout(ConnGroupBox); |
646 | 505 |
GBClayout->setColumnStretch(0, 1); |
421 | 506 |
GBClayout->setColumnStretch(1, 1); |
507 |
GBClayout->setColumnStretch(2, 1); |
|
184 | 508 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
509 |
BtnNetConnect = new QPushButton(ConnGroupBox); |
184 | 510 |
BtnNetConnect->setFont(*font14); |
511 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
646 | 512 |
GBClayout->addWidget(BtnNetConnect, 2, 2); |
416 | 513 |
|
665 | 514 |
tvServersList = new QTableView(ConnGroupBox); |
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
515 |
tvServersList->setSelectionBehavior(QAbstractItemView::SelectRows); |
665 | 516 |
GBClayout->addWidget(tvServersList, 1, 0, 1, 3); |
421 | 517 |
|
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
518 |
BtnUpdateSList = new QPushButton(ConnGroupBox); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
519 |
BtnUpdateSList->setFont(*font14); |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
520 |
BtnUpdateSList->setText(QPushButton::tr("Update")); |
646 | 521 |
GBClayout->addWidget(BtnUpdateSList, 2, 0); |
314 | 522 |
|
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
523 |
BtnSpecifyServer = new QPushButton(ConnGroupBox); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
524 |
BtnSpecifyServer->setFont(*font14); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
525 |
BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
526 |
GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
647
diff
changeset
|
527 |
|
668 | 528 |
connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
184 | 529 |
} |
530 |
||
646 | 531 |
void PageNet::updateServersList() |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
532 |
{ |
1310 | 533 |
tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
659 | 534 |
|
673 | 535 |
tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
536 |
||
665 | 537 |
static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
538 |
|
665 | 539 |
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
|
540 |
connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect())); |
646 | 541 |
} |
542 |
||
543 |
void PageNet::slotConnect() |
|
544 |
{ |
|
671
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
545 |
HWNetServersModel * model = static_cast<HWNetServersModel *>(tvServersList->model()); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
546 |
QModelIndex mi = tvServersList->currentIndex(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
547 |
if(!mi.isValid()) |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
548 |
{ |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
549 |
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
|
550 |
return; |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
551 |
} |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
552 |
QString host = model->index(mi.row(), 1).data().toString(); |
a8970859f50e
Actually pass host and port values to NetConnect method
unc0rr
parents:
668
diff
changeset
|
553 |
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
|
554 |
|
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
|
555 |
emit connectClicked(host, port); |
646 | 556 |
} |
557 |
||
1153 | 558 |
PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent) |
646 | 559 |
{ |
560 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
561 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
562 |
pageLayout->setColumnStretch(0, 1); |
|
563 |
pageLayout->setColumnStretch(1, 1); |
|
564 |
pageLayout->setColumnStretch(2, 1); |
|
565 |
||
675 | 566 |
pageLayout->setRowStretch(0, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
567 |
pageLayout->setRowStretch(1, 0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
568 |
|
1153 | 569 |
BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
646 | 570 |
|
571 |
BtnStart = new QPushButton(this); |
|
572 |
BtnStart->setFont(*font14); |
|
573 |
BtnStart->setText(QPushButton::tr("Start")); |
|
675 | 574 |
pageLayout->addWidget(BtnStart, 1, 2); |
575 |
||
576 |
QWidget * wg = new QWidget(this); |
|
577 |
pageLayout->addWidget(wg, 0, 0, 1, 3); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
578 |
|
675 | 579 |
QGridLayout * wgLayout = new QGridLayout(wg); |
580 |
wgLayout->setColumnStretch(0, 1); |
|
581 |
wgLayout->setColumnStretch(1, 3); |
|
582 |
wgLayout->setColumnStretch(2, 1); |
|
583 |
||
584 |
wgLayout->setRowStretch(0, 0); |
|
585 |
wgLayout->setRowStretch(1, 1); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
586 |
|
675 | 587 |
QGroupBox * gb = new QGroupBox(wg); |
588 |
wgLayout->addWidget(gb, 0, 1); |
|
589 |
||
590 |
QGridLayout * gbLayout = new QGridLayout(gb); |
|
591 |
||
592 |
labelSD = new QLabel(gb); |
|
593 |
labelSD->setText(QLabel::tr("Server name:")); |
|
594 |
gbLayout->addWidget(labelSD, 0, 0); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
595 |
|
675 | 596 |
leServerDescr = new QLineEdit(gb); |
597 |
gbLayout->addWidget(leServerDescr, 0, 1); |
|
598 |
||
599 |
labelPort = new QLabel(gb); |
|
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
600 |
labelPort->setText(QLabel::tr("Server port:")); |
675 | 601 |
gbLayout->addWidget(labelPort, 1, 0); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
602 |
|
675 | 603 |
sbPort = new QSpinBox(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
604 |
sbPort->setMinimum(0); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
605 |
sbPort->setMaximum(65535); |
675 | 606 |
gbLayout->addWidget(sbPort, 1, 1); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
607 |
|
675 | 608 |
BtnDefault = new QPushButton(gb); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
609 |
BtnDefault->setText(QPushButton::tr("default")); |
675 | 610 |
gbLayout->addWidget(BtnDefault, 1, 2); |
657
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
611 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
612 |
connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort())); |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
613 |
} |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
614 |
|
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
615 |
void PageNetServer::setDefaultPort() |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
616 |
{ |
b34fc518a48a
Basic concept for net server options page (subject to change)
unc0rr
parents:
653
diff
changeset
|
617 |
sbPort->setValue(46631); |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
618 |
} |
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
617
diff
changeset
|
619 |
|
1153 | 620 |
PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent) |
184 | 621 |
{ |
622 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
452 | 623 |
pageLayout->setSizeConstraint(QLayout::SetMinimumSize); |
461 | 624 |
//pageLayout->setSpacing(1); |
463 | 625 |
pageLayout->setColumnStretch(0, 50); |
626 |
pageLayout->setColumnStretch(1, 50); |
|
322 | 627 |
|
461 | 628 |
// chatwidget |
629 |
pChatWidget = new HWChatWidget(this); |
|
1647 | 630 |
pageLayout->addWidget(pChatWidget, 1, 0, 1, 2); |
464 | 631 |
pageLayout->setRowStretch(1, 100); |
453 | 632 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
633 |
pGameCFG = new GameCFGWidget(this); |
322 | 634 |
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
|
635 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
323
diff
changeset
|
636 |
pNetTeamsWidget = new TeamSelWidget(this); |
373 | 637 |
pNetTeamsWidget->setAcceptOuter(true); |
1647 | 638 |
pageLayout->addWidget(pNetTeamsWidget, 0, 1); |
184 | 639 |
|
1649 | 640 |
|
641 |
QHBoxLayout * bottomLayout = new QHBoxLayout; |
|
642 |
pageLayout->addLayout(bottomLayout, 3, 0, 1, 2); |
|
643 |
||
644 |
BtnBack = addButton(":/res/Exit.png", bottomLayout, 0, true); |
|
2377 | 645 |
|
646 | 646 |
BtnGo = new QPushButton(this); |
1677 | 647 |
BtnGo->setToolTip(QPushButton::tr("Ready")); |
1648 | 648 |
BtnGo->setIcon(QIcon(":/res/lightbulb_off.png")); |
649 |
BtnGo->setIconSize(QSize(25, 34)); |
|
1649 | 650 |
BtnGo->setMinimumWidth(50); |
651 |
BtnGo->setMinimumHeight(50); |
|
1951 | 652 |
bottomLayout->addWidget(BtnGo, 4); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
653 |
|
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
654 |
|
1951 | 655 |
BtnMaster = addButton(tr("Control"), bottomLayout, 2); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
656 |
QMenu * menu = new QMenu(BtnMaster); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
657 |
restrictJoins = new QAction(QAction::tr("Restrict Joins"), menu); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
658 |
restrictJoins->setCheckable(true); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
659 |
restrictTeamAdds = new QAction(QAction::tr("Restrict Team Additions"), menu); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
660 |
restrictTeamAdds->setCheckable(true); |
1951 | 661 |
//menu->addAction(startGame); |
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
662 |
menu->addAction(restrictJoins); |
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
663 |
menu->addAction(restrictTeamAdds); |
2377 | 664 |
|
1409
d1cbe4a57ebf
Add button for controlling room options (no usefull yet)
unc0rr
parents:
1404
diff
changeset
|
665 |
BtnMaster->setMenu(menu); |
1649 | 666 |
|
1951 | 667 |
BtnStart = addButton(QAction::tr("Start"), bottomLayout, 3); |
668 |
||
1649 | 669 |
bottomLayout->insertStretch(1, 100); |
184 | 670 |
} |
187 | 671 |
|
1648 | 672 |
void PageNetGame::setReadyStatus(bool isReady) |
673 |
{ |
|
674 |
if(isReady) |
|
675 |
BtnGo->setIcon(QIcon(":/res/lightbulb_on.png")); |
|
676 |
else |
|
677 |
BtnGo->setIcon(QIcon(":/res/lightbulb_off.png")); |
|
678 |
} |
|
679 |
||
1649 | 680 |
void PageNetGame::setMasterMode(bool isMaster) |
681 |
{ |
|
682 |
BtnMaster->setVisible(isMaster); |
|
1951 | 683 |
BtnStart->setVisible(isMaster); |
1649 | 684 |
} |
685 |
||
1153 | 686 |
PageInfo::PageInfo(QWidget* parent) : AbstractPage(parent) |
187 | 687 |
{ |
688 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
689 |
pageLayout->setColumnStretch(0, 1); |
|
690 |
pageLayout->setColumnStretch(1, 1); |
|
691 |
pageLayout->setColumnStretch(2, 1); |
|
692 |
||
1153 | 693 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
187 | 694 |
|
695 |
about = new About(this); |
|
696 |
pageLayout->addWidget(about, 0, 0, 1, 3); |
|
697 |
} |
|
306 | 698 |
|
1150 | 699 |
PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent) |
586 | 700 |
{ |
1443 | 701 |
QVBoxLayout * vLayout = new QVBoxLayout(this); |
702 |
QHBoxLayout * topLine = new QHBoxLayout(); |
|
703 |
QHBoxLayout * middleLine = new QHBoxLayout(); |
|
704 |
QHBoxLayout * bottomLine = new QHBoxLayout(); |
|
1444 | 705 |
vLayout->addStretch(); |
1443 | 706 |
vLayout->addLayout(topLine); |
1457 | 707 |
vLayout->addSpacing(30); |
1443 | 708 |
vLayout->addLayout(middleLine); |
1444 | 709 |
vLayout->addStretch(); |
1443 | 710 |
vLayout->addLayout(bottomLine); |
586 | 711 |
|
1457 | 712 |
topLine->addStretch(); |
1443 | 713 |
BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true); |
1450 | 714 |
BtnSimpleGamePage->setToolTip(tr("Simple Game (a quick game against the computer, settings are chosen for you)")); |
1457 | 715 |
topLine->addSpacing(60); |
1443 | 716 |
BtnMultiplayer = addButton(":/res/Multiplayer.png", topLine, 1, true); |
1450 | 717 |
BtnMultiplayer->setToolTip(tr("Multiplayer (play a hotseat game against your friends, or AI teams)")); |
1457 | 718 |
topLine->addStretch(); |
2377 | 719 |
|
1457 | 720 |
|
1443 | 721 |
BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 0, true); |
1450 | 722 |
BtnTrainPage->setToolTip(tr("Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT")); |
2377 | 723 |
|
1443 | 724 |
BtnBack = addButton(":/res/Exit.png", bottomLine, 0, true); |
1444 | 725 |
bottomLine->addStretch(); |
726 |
||
1447 | 727 |
BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true); |
1450 | 728 |
BtnDemos->setToolTip(tr("Demos (Watch recorded demos)")); |
1443 | 729 |
BtnLoad = addButton(":/res/Save.png", bottomLine, 2, true); |
730 |
BtnLoad->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); |
|
1450 | 731 |
BtnLoad->setToolTip(tr("Load (Load a previously saved game)")); |
586 | 732 |
} |
733 |
||
1153 | 734 |
PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent) |
587 | 735 |
{ |
736 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
737 |
pageLayout->setColumnStretch(0, 1); |
|
738 |
pageLayout->setColumnStretch(1, 2); |
|
739 |
pageLayout->setColumnStretch(2, 1); |
|
740 |
||
741 |
BtnStartTrain = new QPushButton(this); |
|
742 |
BtnStartTrain->setFont(*font14); |
|
743 |
BtnStartTrain->setText(QPushButton::tr("Go!")); |
|
744 |
pageLayout->addWidget(BtnStartTrain, 1, 2); |
|
745 |
||
1153 | 746 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
587 | 747 |
} |
748 |
||
923
b3d097097b54
Use default ammostore string size for weapons number instead of predefined const
unc0rr
parents:
788
diff
changeset
|
749 |
PageSelectWeapon::PageSelectWeapon(QWidget* parent) : |
684 | 750 |
AbstractPage(parent) |
600 | 751 |
{ |
752 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
2377 | 753 |
|
2369
c3eb11f1ab3a
Implement probability editor for weapon schemes (engine doesn't support that yet)
unc0rr
parents:
2368
diff
changeset
|
754 |
pWeapons = new SelWeaponWidget(cAmmoNumber, this); |
718 | 755 |
pageLayout->addWidget(pWeapons, 0, 0, 1, 4); |
600 | 756 |
|
1168 | 757 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
730 | 758 |
BtnDefault = addButton(tr("Default"), pageLayout, 1, 1); |
759 |
BtnDelete = addButton(tr("Delete"), pageLayout, 1, 2); |
|
1168 | 760 |
BtnSave = addButton(":/res/Save.png", pageLayout, 1, 3, true); |
2368 | 761 |
BtnSave->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); |
762 |
||
763 |
connect(BtnDefault, SIGNAL(clicked()), pWeapons, SLOT(setDefault())); |
|
764 |
connect(BtnSave, SIGNAL(clicked()), pWeapons, SLOT(save())); |
|
600 | 765 |
} |
766 |
||
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
|
767 |
PageInGame::PageInGame(QWidget* parent) : |
686 | 768 |
AbstractPage(parent) |
769 |
{ |
|
770 |
QLabel * label = new QLabel(this); |
|
771 |
label->setText("In game..."); |
|
772 |
} |
|
1311 | 773 |
|
774 |
PageRoomsList::PageRoomsList(QWidget* parent) : |
|
775 |
AbstractPage(parent) |
|
776 |
{ |
|
1312 | 777 |
QGridLayout * pageLayout = new QGridLayout(this); |
1314 | 778 |
|
779 |
roomName = new QLineEdit(this); |
|
1334
b58afaadf7ae
Send team removal message to others in room when client disconnects
unc0rr
parents:
1315
diff
changeset
|
780 |
roomName->setMaxLength(60); |
1314 | 781 |
pageLayout->addWidget(roomName, 0, 0); |
2377 | 782 |
|
1399 | 783 |
roomsList = new QTableWidget(this); |
784 |
roomsList->setColumnCount(3); |
|
785 |
roomsList->setSelectionBehavior(QAbstractItemView::SelectRows); |
|
786 |
roomsList->verticalHeader()->setVisible(false); |
|
787 |
roomsList->horizontalHeader()->setResizeMode(QHeaderView::Interactive); |
|
1894 | 788 |
roomsList->setAlternatingRowColors(true); |
1522 | 789 |
pageLayout->addWidget(roomsList, 1, 0, 3, 1); |
1584
90f6a5abad17
Save much space for chat widget on lobby page by removing server message widget (now this messages goes to chat)
unc0rr
parents:
1576
diff
changeset
|
790 |
pageLayout->setRowStretch(2, 100); |
2377 | 791 |
|
1584
90f6a5abad17
Save much space for chat widget on lobby page by removing server message widget (now this messages goes to chat)
unc0rr
parents:
1576
diff
changeset
|
792 |
chatWidget = new HWChatWidget(this); |
90f6a5abad17
Save much space for chat widget on lobby page by removing server message widget (now this messages goes to chat)
unc0rr
parents:
1576
diff
changeset
|
793 |
pageLayout->addWidget(chatWidget, 4, 0, 1, 2); |
90f6a5abad17
Save much space for chat widget on lobby page by removing server message widget (now this messages goes to chat)
unc0rr
parents:
1576
diff
changeset
|
794 |
pageLayout->setRowStretch(4, 350); |
1522 | 795 |
|
1312 | 796 |
BtnCreate = addButton(tr("Create"), pageLayout, 0, 1); |
797 |
BtnJoin = addButton(tr("Join"), pageLayout, 1, 1); |
|
1522 | 798 |
BtnRefresh = addButton(tr("Refresh"), pageLayout, 3, 1); |
2377 | 799 |
|
1856
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
800 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 5, 0, true); |
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
801 |
BtnAdmin = addButton(tr("Admin features"), pageLayout, 5, 1); |
1314 | 802 |
|
803 |
connect(BtnCreate, SIGNAL(clicked()), this, SLOT(onCreateClick())); |
|
804 |
connect(BtnJoin, SIGNAL(clicked()), this, SLOT(onJoinClick())); |
|
1315 | 805 |
connect(BtnRefresh, SIGNAL(clicked()), this, SLOT(onRefreshClick())); |
1314 | 806 |
connect(roomsList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(onJoinClick())); |
1311 | 807 |
} |
1313
f4c54e9e1b8c
- Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents:
1312
diff
changeset
|
808 |
|
1856
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
809 |
void PageRoomsList::setAdmin(bool flag) |
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
810 |
{ |
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
811 |
BtnAdmin->setVisible(flag); |
e71dbf958c87
Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents:
1840
diff
changeset
|
812 |
} |
1377 | 813 |
|
1313
f4c54e9e1b8c
- Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents:
1312
diff
changeset
|
814 |
void PageRoomsList::setRoomsList(const QStringList & list) |
f4c54e9e1b8c
- Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents:
1312
diff
changeset
|
815 |
{ |
f4c54e9e1b8c
- Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents:
1312
diff
changeset
|
816 |
roomsList->clear(); |
1399 | 817 |
roomsList->setHorizontalHeaderLabels( |
818 |
QStringList() << |
|
819 |
QTableWidget::tr("Room name") << |
|
820 |
QTableWidget::tr("Players number") << |
|
821 |
QTableWidget::tr("Round in progress") |
|
822 |
); |
|
1893 | 823 |
|
824 |
roomsList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
|
825 |
roomsList->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents); |
|
826 |
roomsList->horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents); |
|
827 |
||
2377 | 828 |
|
1399 | 829 |
if (list.size() % 3) |
830 |
return; |
|
831 |
||
832 |
roomsList->setRowCount(list.size() / 3); |
|
833 |
for(int i = 0; i < list.size(); i += 3) |
|
834 |
for(int t = 0; t < 3; t++) |
|
835 |
{ |
|
836 |
QTableWidgetItem * item = new QTableWidgetItem(list[i + t]); |
|
1891 | 837 |
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
1400 | 838 |
roomsList->setItem(i / 3, t, item); |
1399 | 839 |
} |
840 |
//roomsList->resizeColumnsToContents(); |
|
1313
f4c54e9e1b8c
- Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents:
1312
diff
changeset
|
841 |
} |
1314 | 842 |
|
843 |
void PageRoomsList::onCreateClick() |
|
844 |
{ |
|
845 |
if (roomName->text().size()) |
|
846 |
emit askForCreateRoom(roomName->text()); |
|
847 |
else |
|
848 |
QMessageBox::critical(this, |
|
849 |
tr("Error"), |
|
1315 | 850 |
tr("Please, enter room name"), |
1314 | 851 |
tr("OK")); |
852 |
} |
|
853 |
||
854 |
void PageRoomsList::onJoinClick() |
|
855 |
{ |
|
1399 | 856 |
QTableWidgetItem * curritem = roomsList->item(roomsList->currentRow(), 0); |
1314 | 857 |
if (!curritem) |
858 |
{ |
|
859 |
QMessageBox::critical(this, |
|
860 |
tr("Error"), |
|
861 |
tr("Please, select room from the list"), |
|
862 |
tr("OK")); |
|
863 |
return ; |
|
864 |
} |
|
865 |
emit askForJoinRoom(curritem->data(Qt::DisplayRole).toString()); |
|
866 |
} |
|
867 |
||
1315 | 868 |
void PageRoomsList::onRefreshClick() |
869 |
{ |
|
870 |
emit askForRoomList(); |
|
871 |
} |
|
872 |
||
1800 | 873 |
|
874 |
PageConnecting::PageConnecting(QWidget* parent) : |
|
875 |
AbstractPage(parent) |
|
876 |
{ |
|
877 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1904 | 878 |
|
879 |
QLabel * lblConnecting = new QLabel(this); |
|
880 |
lblConnecting->setText(tr("Connecting...")); |
|
881 |
pageLayout->addWidget(lblConnecting); |
|
1800 | 882 |
} |
1884 | 883 |
|
884 |
PageScheme::PageScheme(QWidget* parent) : |
|
885 |
AbstractPage(parent) |
|
886 |
{ |
|
887 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1943 | 888 |
QGroupBox * gb = new QGroupBox(this); |
2377 | 889 |
|
1932 | 890 |
QGridLayout * gl = new QGridLayout(); |
891 |
gb->setLayout(gl); |
|
1943 | 892 |
QSizePolicy sp; |
893 |
sp.setVerticalPolicy(QSizePolicy::MinimumExpanding); |
|
894 |
sp.setHorizontalPolicy(QSizePolicy::Expanding); |
|
1885 | 895 |
|
1932 | 896 |
pageLayout->addWidget(gb, 1,0,13,4); |
2377 | 897 |
|
1984 | 898 |
gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb); |
899 |
gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb); |
|
1943 | 900 |
|
901 |
gbGameModes->setStyleSheet(".QGroupBox {" |
|
902 |
"background-color: #130f2c; background-image:url();" |
|
903 |
"}"); |
|
904 |
gbBasicSettings->setStyleSheet(".QGroupBox {" |
|
905 |
"background-color: #130f2c; background-image:url();" |
|
906 |
"}"); |
|
907 |
||
908 |
gbGameModes->setSizePolicy(sp); |
|
909 |
gbBasicSettings->setSizePolicy(sp); |
|
910 |
gl->addWidget(gbGameModes,0,0,1,3,Qt::AlignTop); |
|
911 |
gl->addWidget(gbBasicSettings,0,3,1,3,Qt::AlignTop); |
|
2377 | 912 |
|
1932 | 913 |
QGridLayout * glGMLayout = new QGridLayout(gbGameModes); |
914 |
QGridLayout * glBSLayout = new QGridLayout(gbBasicSettings); |
|
915 |
gbGameModes->setLayout(glGMLayout); |
|
916 |
gbBasicSettings->setLayout(glBSLayout); |
|
917 |
// Left |
|
2377 | 918 |
|
1932 | 919 |
TBW_mode_Forts = new ToggleButtonWidget(gbGameModes, ":/res/btnForts.png"); |
920 |
TBW_mode_Forts->setText(ToggleButtonWidget::tr("Fort Mode")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
921 |
TBW_mode_Forts->setToolTip(tr("Defend your fort and destroy the opponents, two team colours max!")); |
1932 | 922 |
glGMLayout->addWidget(TBW_mode_Forts,0,0,1,1); |
1885 | 923 |
|
1932 | 924 |
TBW_teamsDivide = new ToggleButtonWidget(gbGameModes, ":/res/btnTeamsDivide.png"); |
925 |
TBW_teamsDivide->setText(ToggleButtonWidget::tr("Divide Teams")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
926 |
TBW_teamsDivide->setToolTip(tr("Teams will start on opposite sides of the terrain, two team colours max!")); |
1932 | 927 |
glGMLayout->addWidget(TBW_teamsDivide,0,1,1,1); |
1885 | 928 |
|
1932 | 929 |
TBW_solid = new ToggleButtonWidget(gbGameModes, ":/res/btnSolid.png"); |
930 |
TBW_solid->setText(ToggleButtonWidget::tr("Solid Land")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
931 |
TBW_solid->setToolTip(tr("Land can not be destroyed!")); |
1932 | 932 |
glGMLayout->addWidget(TBW_solid,0,2,1,1); |
1885 | 933 |
|
1932 | 934 |
TBW_border = new ToggleButtonWidget(gbGameModes, ":/res/btnBorder.png"); |
935 |
TBW_border->setText(ToggleButtonWidget::tr("Add Border")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
936 |
TBW_border->setToolTip(tr("Add an indestructable border around the terrain")); |
1932 | 937 |
glGMLayout->addWidget(TBW_border,0,3,1,1); |
1895 | 938 |
|
1932 | 939 |
TBW_lowGravity = new ToggleButtonWidget(gbGameModes, ":/res/btnLowGravity.png"); |
940 |
TBW_lowGravity->setText(ToggleButtonWidget::tr("Low Gravity")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
941 |
TBW_lowGravity->setToolTip(tr("Lower gravity")); |
1932 | 942 |
glGMLayout->addWidget(TBW_lowGravity,1,0,1,1); |
943 |
||
944 |
TBW_laserSight = new ToggleButtonWidget(gbGameModes, ":/res/btnLaserSight.png"); |
|
945 |
TBW_laserSight->setText(ToggleButtonWidget::tr("Laser Sight")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
946 |
TBW_laserSight->setToolTip(tr("Assisted aiming with laser sight")); |
1932 | 947 |
glGMLayout->addWidget(TBW_laserSight,1,1,1,1); |
1895 | 948 |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
949 |
TBW_invulnerable = new ToggleButtonWidget(gbGameModes, ":/res/btnInvulnerable.png"); |
1932 | 950 |
TBW_invulnerable->setText(ToggleButtonWidget::tr("Invulnerable")); |
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
951 |
TBW_invulnerable->setToolTip(tr("All hogs have a personal forcefield")); |
1932 | 952 |
glGMLayout->addWidget(TBW_invulnerable,1,2,1,1); |
953 |
||
954 |
TBW_mines = new ToggleButtonWidget(gbGameModes, ":/res/btnMines.png"); |
|
955 |
TBW_mines->setText(ToggleButtonWidget::tr("Add Mines")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
956 |
TBW_mines->setToolTip(tr("Enable random mines")); |
1932 | 957 |
glGMLayout->addWidget(TBW_mines,1,3,1,1); |
1895 | 958 |
|
2017 | 959 |
TBW_vampiric = new ToggleButtonWidget(gbGameModes, ":/res/btnVampiric.png"); |
960 |
TBW_vampiric->setText(ToggleButtonWidget::tr("Vampirism")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
961 |
TBW_vampiric->setToolTip(tr("Gain 80% of the damage you do back in health")); |
2017 | 962 |
glGMLayout->addWidget(TBW_vampiric,2,0,1,1); |
963 |
||
964 |
TBW_karma = new ToggleButtonWidget(gbGameModes, ":/res/btnKarma.png"); |
|
965 |
TBW_karma->setText(ToggleButtonWidget::tr("Karma")); |
|
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
966 |
TBW_karma->setToolTip(tr("Share your opponents pain, share their damage")); |
2017 | 967 |
glGMLayout->addWidget(TBW_karma,2,1,1,1); |
968 |
||
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
969 |
TBW_artillery = new ToggleButtonWidget(gbGameModes, ":/res/btnArtillery.png"); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
970 |
TBW_artillery->setText(ToggleButtonWidget::tr("Artillery")); |
2026
21c986c528ba
Descriptions for the tooltip buttons. Rename btnInvurnable to btnInvulnerable
nemo
parents:
2023
diff
changeset
|
971 |
TBW_artillery->setToolTip(tr("Your hogs are unable to move, put your artillery skills to the test")); |
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
972 |
glGMLayout->addWidget(TBW_artillery,2,2,1,1); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
973 |
|
1932 | 974 |
// Right |
975 |
QLabel * l; |
|
2377 | 976 |
|
1932 | 977 |
l = new QLabel(gbBasicSettings); |
978 |
l->setText(QLabel::tr("Damage Modifier")); |
|
1933 | 979 |
l->setWordWrap(true); |
1932 | 980 |
glBSLayout->addWidget(l,0,0,1,1); |
981 |
l = new QLabel(gbBasicSettings); |
|
982 |
l->setFixedSize(32,32); |
|
983 |
l->setPixmap(QPixmap(":/res/iconDamage.png")); |
|
1943 | 984 |
glBSLayout->addWidget(l,0,1,1,1); |
2377 | 985 |
|
1932 | 986 |
SB_DamageModifier = new QSpinBox(gbBasicSettings); |
1895 | 987 |
SB_DamageModifier->setRange(10, 300); |
988 |
SB_DamageModifier->setValue(100); |
|
989 |
SB_DamageModifier->setSingleStep(25); |
|
1943 | 990 |
glBSLayout->addWidget(SB_DamageModifier,0,2,1,1); |
1932 | 991 |
|
992 |
l = new QLabel(gbBasicSettings); |
|
993 |
l->setText(QLabel::tr("Turn Time")); |
|
1933 | 994 |
l->setWordWrap(true); |
1932 | 995 |
glBSLayout->addWidget(l,1,0,1,1); |
996 |
l = new QLabel(gbBasicSettings); |
|
997 |
l->setFixedSize(32,32); |
|
998 |
l->setPixmap(QPixmap(":/res/iconTime.png")); |
|
1943 | 999 |
glBSLayout->addWidget(l,1,1,1,1); |
2377 | 1000 |
|
1932 | 1001 |
SB_TurnTime = new QSpinBox(gbBasicSettings); |
1885 | 1002 |
SB_TurnTime->setRange(1, 99); |
1003 |
SB_TurnTime->setValue(45); |
|
1004 |
SB_TurnTime->setSingleStep(15); |
|
1943 | 1005 |
glBSLayout->addWidget(SB_TurnTime,1,2,1,1); |
2377 | 1006 |
|
1932 | 1007 |
l = new QLabel(gbBasicSettings); |
1008 |
l->setText(QLabel::tr("Initial Health")); |
|
1933 | 1009 |
l->setWordWrap(true); |
1932 | 1010 |
glBSLayout->addWidget(l,2,0,1,1); |
1011 |
l = new QLabel(gbBasicSettings); |
|
1012 |
l->setFixedSize(32,32); |
|
1013 |
l->setPixmap(QPixmap(":/res/iconHealth.png")); |
|
1943 | 1014 |
glBSLayout->addWidget(l,2,1,1,1); |
2377 | 1015 |
|
1932 | 1016 |
SB_InitHealth = new QSpinBox(gbBasicSettings); |
1885 | 1017 |
SB_InitHealth->setRange(50, 200); |
1018 |
SB_InitHealth->setValue(100); |
|
1019 |
SB_InitHealth->setSingleStep(25); |
|
1943 | 1020 |
glBSLayout->addWidget(SB_InitHealth,2,2,1,1); |
2377 | 1021 |
|
1932 | 1022 |
l = new QLabel(gbBasicSettings); |
1023 |
l->setText(QLabel::tr("Sudden Death Timeout")); |
|
1933 | 1024 |
l->setWordWrap(true); |
1932 | 1025 |
glBSLayout->addWidget(l,3,0,1,1); |
1026 |
l = new QLabel(gbBasicSettings); |
|
1027 |
l->setFixedSize(32,32); |
|
1028 |
l->setPixmap(QPixmap(":/res/iconSuddenDeath.png")); |
|
1943 | 1029 |
glBSLayout->addWidget(l,3,1,1,1); |
1932 | 1030 |
|
1031 |
SB_SuddenDeath = new QSpinBox(gbBasicSettings); |
|
1885 | 1032 |
SB_SuddenDeath->setRange(0, 50); |
1033 |
SB_SuddenDeath->setValue(15); |
|
1034 |
SB_SuddenDeath->setSingleStep(3); |
|
1943 | 1035 |
glBSLayout->addWidget(SB_SuddenDeath,3,2,1,1); |
2377 | 1036 |
|
1932 | 1037 |
l = new QLabel(gbBasicSettings); |
1943 | 1038 |
l->setText(QLabel::tr("Crate Drops")); |
1933 | 1039 |
l->setWordWrap(true); |
1932 | 1040 |
glBSLayout->addWidget(l,4,0,1,1); |
1041 |
l = new QLabel(gbBasicSettings); |
|
1042 |
l->setFixedSize(32,32); |
|
1043 |
l->setPixmap(QPixmap(":/res/iconBox.png")); |
|
1943 | 1044 |
glBSLayout->addWidget(l,4,1,1,1); |
1932 | 1045 |
|
1046 |
SB_CaseProb = new FreqSpinBox(gbBasicSettings); |
|
1885 | 1047 |
SB_CaseProb->setRange(0, 9); |
1048 |
SB_CaseProb->setValue(5); |
|
1943 | 1049 |
glBSLayout->addWidget(SB_CaseProb,4,2,1,1); |
1932 | 1050 |
|
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1051 |
l = new QLabel(gbBasicSettings); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1052 |
l->setText(QLabel::tr("Mines Time")); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1053 |
l->setWordWrap(true); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1054 |
glBSLayout->addWidget(l,5,0,1,1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1055 |
l = new QLabel(gbBasicSettings); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1056 |
l->setFixedSize(32,32); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1057 |
l->setPixmap(QPixmap(":/res/iconTime.png")); // TODO: icon |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1058 |
glBSLayout->addWidget(l,5,1,1,1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1059 |
SB_MinesTime = new QSpinBox(gbBasicSettings); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1060 |
SB_MinesTime->setRange(-1, 3); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1061 |
SB_MinesTime->setValue(3); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1062 |
SB_MinesTime->setSingleStep(1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1063 |
SB_MinesTime->setSpecialValueText(tr("Random")); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1064 |
SB_MinesTime->setSuffix(" "+ tr("Seconds")); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1065 |
glBSLayout->addWidget(SB_MinesTime,5,2,1,1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1066 |
|
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1067 |
l = new QLabel(gbBasicSettings); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1068 |
l->setText(QLabel::tr("Mines")); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1069 |
l->setWordWrap(true); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1070 |
glBSLayout->addWidget(l,6,0,1,1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1071 |
l = new QLabel(gbBasicSettings); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1072 |
l->setFixedSize(32,32); |
2036 | 1073 |
l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1074 |
glBSLayout->addWidget(l,6,1,1,1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1075 |
SB_Mines = new QSpinBox(gbBasicSettings); |
2076
aa3263e57b8f
increase # of mines to 50, limit max depth of drowning damage tag
nemo
parents:
2072
diff
changeset
|
1076 |
SB_Mines->setRange(1, 50); |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1077 |
SB_Mines->setValue(1); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1078 |
SB_Mines->setSingleStep(5); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1079 |
glBSLayout->addWidget(SB_Mines,6,2,1,1); |
1932 | 1080 |
|
1081 |
l = new QLabel(gbBasicSettings); |
|
1082 |
l->setText(QLabel::tr("Scheme Name:")); |
|
1885 | 1083 |
|
1084 |
LE_name = new QLineEdit(this); |
|
2377 | 1085 |
|
1943 | 1086 |
gl->addWidget(LE_name,14,1,1,5); |
1932 | 1087 |
gl->addWidget(l,14,0,1,1); |
1885 | 1088 |
|
1089 |
mapper = new QDataWidgetMapper(this); |
|
1887 | 1090 |
|
1895 | 1091 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 15, 0, true); |
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1092 |
BtnNew = addButton(tr("New"), pageLayout, 15, 2); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1093 |
BtnDelete = addButton(tr("Delete"), pageLayout, 15, 3); |
1887 | 1094 |
|
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1095 |
selectScheme = new QComboBox(this); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1096 |
pageLayout->addWidget(selectScheme, 15, 1); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1097 |
|
1889 | 1098 |
connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow())); |
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1099 |
connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow())); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1100 |
connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int))); |
1984 | 1101 |
connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int))); |
1887 | 1102 |
} |
1103 |
||
1104 |
void PageScheme::setModel(QAbstractItemModel * model) |
|
1105 |
{ |
|
1106 |
mapper->setModel(model); |
|
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1107 |
selectScheme->setModel(model); |
2377 | 1108 |
|
1885 | 1109 |
mapper->addMapping(LE_name, 0); |
1932 | 1110 |
mapper->addMapping(TBW_mode_Forts->button(), 1); |
1111 |
mapper->addMapping(TBW_teamsDivide->button(), 2); |
|
1112 |
mapper->addMapping(TBW_solid->button(), 3); |
|
1113 |
mapper->addMapping(TBW_border->button(), 4); |
|
1114 |
mapper->addMapping(TBW_lowGravity->button(), 5); |
|
1115 |
mapper->addMapping(TBW_laserSight->button(), 6); |
|
1116 |
mapper->addMapping(TBW_invulnerable->button(), 7); |
|
1117 |
mapper->addMapping(TBW_mines->button(), 8); |
|
2017 | 1118 |
mapper->addMapping(TBW_vampiric->button(), 9); |
1119 |
mapper->addMapping(TBW_karma->button(), 10); |
|
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1120 |
mapper->addMapping(TBW_artillery->button(), 11); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1121 |
mapper->addMapping(SB_DamageModifier, 12); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1122 |
mapper->addMapping(SB_TurnTime, 13); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1123 |
mapper->addMapping(SB_InitHealth, 14); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1124 |
mapper->addMapping(SB_SuddenDeath, 15); |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
1125 |
mapper->addMapping(SB_CaseProb, 16); |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1126 |
mapper->addMapping(SB_MinesTime, 17); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2026
diff
changeset
|
1127 |
mapper->addMapping(SB_Mines, 18); |
1887 | 1128 |
|
1129 |
mapper->toFirst(); |
|
1884 | 1130 |
} |
1889 | 1131 |
|
1132 |
void PageScheme::newRow() |
|
1133 |
{ |
|
1134 |
QAbstractItemModel * model = mapper->model(); |
|
1135 |
model->insertRow(model->rowCount()); |
|
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1136 |
selectScheme->setCurrentIndex(model->rowCount() - 1); |
1889 | 1137 |
} |
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1138 |
|
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1139 |
void PageScheme::deleteRow() |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1140 |
{ |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1141 |
QAbstractItemModel * model = mapper->model(); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1142 |
model->removeRow(selectScheme->currentIndex()); |
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1895
diff
changeset
|
1143 |
} |
1905 | 1144 |
|
1984 | 1145 |
void PageScheme::schemeSelected(int n) |
1146 |
{ |
|
2093
485e084cedc4
Portugese (european) translation, Tiy's "minefield" scheme/wepset, disable vampirism, update translations
nemo
parents:
2076
diff
changeset
|
1147 |
gbGameModes->setEnabled(n >= 5); // FIXME: derive number from model |
485e084cedc4
Portugese (european) translation, Tiy's "minefield" scheme/wepset, disable vampirism, update translations
nemo
parents:
2076
diff
changeset
|
1148 |
gbBasicSettings->setEnabled(n >= 5); |
485e084cedc4
Portugese (european) translation, Tiy's "minefield" scheme/wepset, disable vampirism, update translations
nemo
parents:
2076
diff
changeset
|
1149 |
LE_name->setEnabled(n >= 5); |
1984 | 1150 |
} |
1151 |
||
1905 | 1152 |
///////////////////////////////////////////////// |
1153 |
||
1154 |
PageAdmin::PageAdmin(QWidget* parent) : |
|
1155 |
AbstractPage(parent) |
|
1156 |
{ |
|
1157 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1158 |
||
1924 | 1159 |
QLabel * lblSM = new QLabel(this); |
1160 |
lblSM->setText(tr("Server message:")); |
|
1161 |
pageLayout->addWidget(lblSM, 0, 0); |
|
1162 |
||
1163 |
leServerMessage = new QLineEdit(this); |
|
1164 |
pageLayout->addWidget(leServerMessage, 0, 1); |
|
1165 |
||
1166 |
pbSetSM = addButton(tr("Set message"), pageLayout, 0, 2); |
|
2155
d897222d3339
Implement ability for server admin to clear accounts cache
unc0rr
parents:
2098
diff
changeset
|
1167 |
pbClearAccountsCache = addButton(tr("Clear Accounts Cache"), pageLayout, 1, 0); |
d897222d3339
Implement ability for server admin to clear accounts cache
unc0rr
parents:
2098
diff
changeset
|
1168 |
|
d897222d3339
Implement ability for server admin to clear accounts cache
unc0rr
parents:
2098
diff
changeset
|
1169 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
1924 | 1170 |
|
1171 |
connect(pbSetSM, SIGNAL(clicked()), this, SLOT(smChanged())); |
|
1905 | 1172 |
} |
1924 | 1173 |
|
1174 |
void PageAdmin::smChanged() |
|
1175 |
{ |
|
1176 |
emit setServerMessage(leServerMessage->text()); |
|
1177 |
} |
|
1178 |
||
1179 |
void PageAdmin::serverMessage(const QString & str) |
|
1180 |
{ |
|
1181 |
leServerMessage->setText(str); |
|
1182 |
} |
|
1950 | 1183 |
|
1184 |
///////////////////////////////////////////////// |
|
1185 |
||
1186 |
PageNetType::PageNetType(QWidget* parent) : AbstractPage(parent) |
|
1187 |
{ |
|
1188 |
QGridLayout * pageLayout = new QGridLayout(this); |
|
1189 |
pageLayout->setRowStretch(0, 10); |
|
1977 | 1190 |
pageLayout->setRowStretch(3, 10); |
1191 |
||
1192 |
pageLayout->setColumnStretch(1, 10); |
|
1193 |
pageLayout->setColumnStretch(2, 20); |
|
1194 |
pageLayout->setColumnStretch(3, 10); |
|
1950 | 1195 |
|
1977 | 1196 |
BtnLAN = addButton(tr("LAN game"), pageLayout, 1, 2); |
1197 |
BtnOfficialServer = addButton(tr("Official server"), pageLayout, 2, 2); |
|
1950 | 1198 |
|
1977 | 1199 |
BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); |
1950 | 1200 |
} |