author | unc0rr |
Wed, 11 Mar 2009 14:32:28 +0000 | |
changeset 1884 | 40e59e9f82ce |
parent 1878 | b3b277d2b891 |
child 1885 | 75489216b5b0 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1877
diff
changeset
|
3 |
* Copyright (c) 2006, 2007, 2009 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 <QResizeEvent> |
|
218 | 20 |
#include <QGroupBox> |
311 | 21 |
#include <QCheckBox> |
22 |
#include <QGridLayout> |
|
23 |
#include <QSpinBox> |
|
24 |
#include <QLabel> |
|
1517 | 25 |
#include <QMessageBox> |
1884 | 26 |
#include <QTableView> |
1217 | 27 |
|
184 | 28 |
#include "gamecfgwidget.h" |
1217 | 29 |
#include "igbox.h" |
1517 | 30 |
#include "hwconsts.h" |
1884 | 31 |
#include "ammoSchemeModel.h" |
184 | 32 |
|
349 | 33 |
GameCFGWidget::GameCFGWidget(QWidget* parent, bool externalControl) : |
1217 | 34 |
QGroupBox(parent), mainLayout(this) |
184 | 35 |
{ |
240 | 36 |
mainLayout.setMargin(0); |
1217 | 37 |
// mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |
218 | 38 |
|
1217 | 39 |
pMapContainer = new HWMapContainer(this); |
40 |
mainLayout.addWidget(pMapContainer, 0, 0); |
|
218 | 41 |
|
1217 | 42 |
IconedGroupBox *GBoxOptions = new IconedGroupBox(this); |
218 | 43 |
GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
44 |
mainLayout.addWidget(GBoxOptions); |
|
45 |
||
311 | 46 |
QGridLayout *GBoxOptionsLayout = new QGridLayout(GBoxOptions); |
1884 | 47 |
|
48 |
QTableView * tv = new QTableView(this); |
|
49 |
tv->setModel(new AmmoSchemeModel); |
|
50 |
GBoxOptionsLayout->addWidget(tv, 0, 0, 1, 2); |
|
1427 | 51 |
|
218 | 52 |
CB_mode_Forts = new QCheckBox(GBoxOptions); |
184 | 53 |
CB_mode_Forts->setText(QCheckBox::tr("Forts mode")); |
1884 | 54 |
GBoxOptionsLayout->addWidget(CB_mode_Forts, 9, 0, 1, 2); |
311 | 55 |
|
1427 | 56 |
CB_teamsDivide = new QCheckBox(GBoxOptions); |
57 |
CB_teamsDivide->setText(QCheckBox::tr("Divide teams")); |
|
58 |
GBoxOptionsLayout->addWidget(CB_teamsDivide, 1, 0, 1, 2); |
|
59 |
||
1530 | 60 |
CB_solid = new QCheckBox(GBoxOptions); |
61 |
CB_solid->setText(QCheckBox::tr("Solid land")); |
|
62 |
GBoxOptionsLayout->addWidget(CB_solid, 2, 0, 1, 2); |
|
63 |
||
1784 | 64 |
CB_border = new QCheckBox(GBoxOptions); |
65 |
CB_border->setText(QCheckBox::tr("Add Border")); |
|
66 |
GBoxOptionsLayout->addWidget(CB_border, 3, 0, 1, 2); |
|
67 |
||
311 | 68 |
L_TurnTime = new QLabel(QLabel::tr("Turn time"), GBoxOptions); |
69 |
L_InitHealth = new QLabel(QLabel::tr("Initial health"), GBoxOptions); |
|
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
70 |
L_SuddenDeath = new QLabel(QLabel::tr("Turns before SD"), GBoxOptions); |
1797 | 71 |
L_CaseProb = new QLabel(QLabel::tr("Crate drops"), GBoxOptions); |
1784 | 72 |
GBoxOptionsLayout->addWidget(L_TurnTime, 4, 0); |
73 |
GBoxOptionsLayout->addWidget(L_InitHealth, 5, 0); |
|
74 |
GBoxOptionsLayout->addWidget(L_SuddenDeath, 6, 0); |
|
75 |
GBoxOptionsLayout->addWidget(L_CaseProb, 7, 0); |
|
76 |
GBoxOptionsLayout->addWidget(new QLabel(QLabel::tr("Weapons"), GBoxOptions), 8, 0); |
|
311 | 77 |
|
78 |
SB_TurnTime = new QSpinBox(GBoxOptions); |
|
1479 | 79 |
SB_TurnTime->setRange(1, 99); |
311 | 80 |
SB_TurnTime->setValue(45); |
81 |
SB_TurnTime->setSingleStep(15); |
|
1427 | 82 |
|
311 | 83 |
SB_InitHealth = new QSpinBox(GBoxOptions); |
84 |
SB_InitHealth->setRange(50, 200); |
|
312 | 85 |
SB_InitHealth->setValue(100); |
311 | 86 |
SB_InitHealth->setSingleStep(25); |
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
87 |
|
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
88 |
SB_SuddenDeath = new QSpinBox(GBoxOptions); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
89 |
SB_SuddenDeath->setRange(0, 50); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
90 |
SB_SuddenDeath->setValue(15); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
91 |
SB_SuddenDeath->setSingleStep(3); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
92 |
|
1783 | 93 |
SB_CaseProb = new FreqSpinBox(GBoxOptions); |
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
94 |
SB_CaseProb->setRange(0, 9); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
95 |
SB_CaseProb->setValue(5); |
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
96 |
|
1784 | 97 |
GBoxOptionsLayout->addWidget(SB_TurnTime, 4, 1); |
98 |
GBoxOptionsLayout->addWidget(SB_InitHealth, 5, 1); |
|
99 |
GBoxOptionsLayout->addWidget(SB_SuddenDeath, 6, 1); |
|
100 |
GBoxOptionsLayout->addWidget(SB_CaseProb, 7, 1); |
|
1427 | 101 |
|
697 | 102 |
WeaponsName = new QComboBox(GBoxOptions); |
1784 | 103 |
GBoxOptionsLayout->addWidget(WeaponsName, 8, 1); |
1874 | 104 |
|
105 |
connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(initHealthChanged(int))); |
|
106 |
connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(turnTimeChanged(int))); |
|
107 |
connect(SB_SuddenDeath, SIGNAL(valueChanged(int)), this, SLOT(suddenDeathTurnsChanged(int))); |
|
108 |
connect(SB_CaseProb, SIGNAL(valueChanged(int)), this, SLOT(caseProbabilityChanged(int))); |
|
109 |
connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(fortsModeChanged(bool))); |
|
110 |
connect(CB_teamsDivide, SIGNAL(toggled(bool)), this, SLOT(teamsDivideChanged(bool))); |
|
111 |
connect(CB_solid, SIGNAL(toggled(bool)), this, SLOT(solidChanged(bool))); |
|
112 |
connect(CB_border, SIGNAL(toggled(bool)), this, SLOT(borderChanged(bool))); |
|
1531 | 113 |
connect(WeaponsName, SIGNAL(currentIndexChanged(int)), this, SLOT(ammoChanged(int))); |
486 | 114 |
|
1874 | 115 |
connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &))); |
116 |
connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &))); |
|
117 |
connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &))); |
|
1876 | 118 |
connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int))); |
184 | 119 |
} |
120 |
||
318 | 121 |
quint32 GameCFGWidget::getGameFlags() const |
184 | 122 |
{ |
123 |
quint32 result = 0; |
|
1427 | 124 |
|
184 | 125 |
if (CB_mode_Forts->isChecked()) |
1428 | 126 |
result |= 0x01; |
1427 | 127 |
if (CB_teamsDivide->isChecked()) |
1428 | 128 |
result |= 0x10; |
1530 | 129 |
if (CB_solid->isChecked()) |
130 |
result |= 0x04; |
|
1784 | 131 |
if (CB_border->isChecked()) |
132 |
result |= 0x08; |
|
1427 | 133 |
|
184 | 134 |
return result; |
135 |
} |
|
136 |
||
312 | 137 |
quint32 GameCFGWidget::getInitHealth() const |
138 |
{ |
|
139 |
return SB_InitHealth->value(); |
|
140 |
} |
|
141 |
||
318 | 142 |
QStringList GameCFGWidget::getFullConfig() const |
143 |
{ |
|
144 |
QStringList sl; |
|
1875 | 145 |
sl.append("eseed " + pMapContainer->getCurrentSeed()); |
318 | 146 |
sl.append(QString("e$gmflags %1").arg(getGameFlags())); |
1875 | 147 |
sl.append(QString("e$turntime %1").arg(SB_TurnTime->value() * 1000)); |
148 |
sl.append(QString("e$sd_turns %1").arg(SB_SuddenDeath->value())); |
|
149 |
sl.append(QString("e$casefreq %1").arg(SB_CaseProb->value())); |
|
1802 | 150 |
sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter())); |
1782
e7589e37a6d6
Options for bonus box probability tuning and number of turn until sudden death
unc0rr
parents:
1628
diff
changeset
|
151 |
|
1875 | 152 |
QString currentMap = pMapContainer->getCurrentMap(); |
320 | 153 |
if (currentMap.size() > 0) |
318 | 154 |
sl.append("emap " + currentMap); |
1875 | 155 |
sl.append("etheme " + pMapContainer->getCurrentTheme()); |
318 | 156 |
return sl; |
157 |
} |
|
320 | 158 |
|
703 | 159 |
void GameCFGWidget::setNetAmmo(const QString& name, const QString& ammo) |
697 | 160 |
{ |
1576
a02353129a41
Check for deprecated ammo schemes at startup and delete them
unc0rr
parents:
1532
diff
changeset
|
161 |
if (ammo.size() != cDefaultAmmoStore->size()) |
1517 | 162 |
QMessageBox::critical(this, tr("Error"), tr("Illegal ammo scheme")); |
703 | 163 |
|
1517 | 164 |
int pos = WeaponsName->findText(name); |
165 |
if (pos == -1) { |
|
166 |
WeaponsName->addItem(name, ammo); |
|
167 |
WeaponsName->setCurrentIndex(WeaponsName->count() - 1); |
|
168 |
} else { |
|
169 |
WeaponsName->setItemData(pos, ammo); |
|
170 |
WeaponsName->setCurrentIndex(pos); |
|
171 |
} |
|
1530 | 172 |
} |
1531 | 173 |
|
1875 | 174 |
void GameCFGWidget::fullNetConfig() |
175 |
{ |
|
176 |
ammoChanged(WeaponsName->currentIndex()); |
|
177 |
||
178 |
borderChanged(CB_border->isChecked()); |
|
179 |
caseProbabilityChanged(SB_CaseProb->value()); |
|
180 |
fortsModeChanged(CB_mode_Forts->isChecked()); |
|
1877 | 181 |
initHealthChanged(SB_InitHealth->value()); |
1875 | 182 |
seedChanged(pMapContainer->getCurrentSeed()); |
183 |
solidChanged(CB_solid->isChecked()); |
|
184 |
suddenDeathTurnsChanged(SB_SuddenDeath->value()); |
|
185 |
teamsDivideChanged(CB_teamsDivide->isChecked()); |
|
1876 | 186 |
templateFilterChanged(pMapContainer->getTemplateFilter()); |
1875 | 187 |
themeChanged(pMapContainer->getCurrentTheme()); |
188 |
turnTimeChanged(SB_TurnTime->value()); |
|
189 |
||
190 |
// map must be the last |
|
191 |
QString map = pMapContainer->getCurrentMap(); |
|
192 |
if (map.size()) |
|
193 |
mapChanged(map); |
|
194 |
} |
|
195 |
||
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
196 |
void GameCFGWidget::setParam(const QString & param, const QStringList & slValue) |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
197 |
{ |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
198 |
if (slValue.size() == 1) |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
199 |
{ |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
200 |
QString value = slValue[0]; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
201 |
if (param == "MAP") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
202 |
pMapContainer->setMap(value); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
203 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
204 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
205 |
if (param == "SEED") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
206 |
pMapContainer->setSeed(value); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
207 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
208 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
209 |
if (param == "THEME") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
210 |
pMapContainer->setTheme(value); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
211 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
212 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
213 |
if (param == "HEALTH") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
214 |
SB_InitHealth->setValue(value.toUInt()); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
215 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
216 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
217 |
if (param == "TURNTIME") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
218 |
SB_TurnTime->setValue(value.toUInt()); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
219 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
220 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
221 |
if (param == "SD_TURNS") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
222 |
SB_SuddenDeath->setValue(value.toUInt()); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
223 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
224 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
225 |
if (param == "CASEFACTOR") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
226 |
SB_CaseProb->setValue(value.toUInt()); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
227 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
228 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
229 |
if (param == "FORTSMODE") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
230 |
CB_mode_Forts->setChecked(value.toUInt() != 0); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
231 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
232 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
233 |
if (param == "DIVIDETEAMS") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
234 |
CB_teamsDivide->setChecked(value.toUInt() != 0); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
235 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
236 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
237 |
if (param == "SOLIDLAND") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
238 |
CB_solid->setChecked(value.toUInt() != 0); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
239 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
240 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
241 |
if (param == "BORDER") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
242 |
CB_border->setChecked(value.toUInt() != 0); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
243 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
244 |
} |
1876 | 245 |
if (param == "TEMPLATE") { |
246 |
pMapContainer->setTemplateFilter(value.toUInt()); |
|
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
247 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
248 |
} |
1876 | 249 |
} |
1873
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
250 |
|
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
251 |
if (slValue.size() == 2) |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
252 |
{ |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
253 |
if (param == "AMMO") { |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
254 |
setNetAmmo(slValue[0], slValue[1]); |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
255 |
return; |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
256 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
257 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
258 |
} |
815a3ff1fe4b
Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents:
1802
diff
changeset
|
259 |
|
1874 | 260 |
void GameCFGWidget::ammoChanged(int index) |
261 |
{ |
|
262 |
if (index >= 0) |
|
263 |
emit paramChanged( |
|
264 |
"AMMO", |
|
265 |
QStringList() << WeaponsName->itemText(index) << WeaponsName->itemData(index).toString() |
|
266 |
); |
|
267 |
} |
|
268 |
||
269 |
void GameCFGWidget::borderChanged(bool value) |
|
270 |
{ |
|
271 |
emit paramChanged("BORDER", QStringList(value ? "1" : "0")); |
|
272 |
} |
|
273 |
||
274 |
void GameCFGWidget::caseProbabilityChanged(int value) |
|
275 |
{ |
|
276 |
emit paramChanged("CASEFACTOR", QStringList(QString::number(value))); |
|
277 |
} |
|
278 |
||
279 |
void GameCFGWidget::fortsModeChanged(bool value) |
|
280 |
{ |
|
281 |
emit paramChanged("FORTSMODE", QStringList(value ? "1" : "0")); |
|
282 |
} |
|
283 |
||
284 |
void GameCFGWidget::initHealthChanged(int value) |
|
285 |
{ |
|
286 |
emit paramChanged("HEALTH", QStringList(QString::number(value))); |
|
287 |
} |
|
288 |
||
289 |
void GameCFGWidget::mapChanged(const QString & value) |
|
290 |
{ |
|
291 |
emit paramChanged("MAP", QStringList(value)); |
|
292 |
} |
|
293 |
||
1876 | 294 |
void GameCFGWidget::templateFilterChanged(int value) |
295 |
{ |
|
296 |
emit paramChanged("TEMPLATE", QStringList(QString::number(value))); |
|
297 |
} |
|
298 |
||
1874 | 299 |
void GameCFGWidget::seedChanged(const QString & value) |
300 |
{ |
|
301 |
emit paramChanged("SEED", QStringList(value)); |
|
302 |
} |
|
303 |
||
304 |
void GameCFGWidget::solidChanged(bool value) |
|
305 |
{ |
|
306 |
emit paramChanged("SOLIDLAND", QStringList(value ? "1" : "0")); |
|
307 |
} |
|
308 |
||
309 |
void GameCFGWidget::suddenDeathTurnsChanged(int value) |
|
310 |
{ |
|
311 |
emit paramChanged("SD_TURNS", QStringList(QString::number(value))); |
|
312 |
} |
|
313 |
||
314 |
void GameCFGWidget::teamsDivideChanged(bool value) |
|
315 |
{ |
|
316 |
emit paramChanged("DIVIDETEAMS", QStringList(value ? "1" : "0")); |
|
317 |
} |
|
318 |
||
319 |
void GameCFGWidget::themeChanged(const QString & value) |
|
320 |
{ |
|
321 |
emit paramChanged("THEME", QStringList(value)); |
|
322 |
} |
|
323 |
||
324 |
void GameCFGWidget::turnTimeChanged(int value) |
|
325 |
{ |
|
326 |
emit paramChanged("TURNTIME", QStringList(QString::number(value))); |
|
327 |
} |