author | Henek |
Fri, 12 Nov 2010 21:37:12 +0100 | |
changeset 4269 | 945f2d104268 |
parent 4250 | d83b53997e0b |
child 4303 | 9057d4d85830 |
permissions | -rw-r--r-- |
1881 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
3236
4ab3917d7d44
Update (c) lines to 2010 as unc0rr requested - they all had varying values so I just took the first year mentioned, then tacked on -2010
nemo
parents:
3172
diff
changeset
|
3 |
* Copyright (c) 2010 Andrey Korotaev <unC0Rr@gmail.com> |
1881 | 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 |
||
1885 | 19 |
#include <QDebug> |
1881 | 20 |
#include <QModelIndex> |
1897 | 21 |
|
1881 | 22 |
#include "ammoSchemeModel.h" |
1897 | 23 |
#include "hwconsts.h" |
1881 | 24 |
|
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1899
diff
changeset
|
25 |
QList<QVariant> defaultScheme = QList<QVariant>() |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
26 |
<< QVariant("Default") // name 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
27 |
<< QVariant(false) // fortsmode 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
28 |
<< QVariant(false) // team divide 2 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
29 |
<< QVariant(false) // solid land 3 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
30 |
<< QVariant(false) // border 4 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
31 |
<< QVariant(false) // low gravity 5 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
32 |
<< QVariant(false) // laser sight 6 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
33 |
<< QVariant(false) // invulnerable 7 |
4099 | 34 |
<< QVariant(false) // reset health 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
35 |
<< QVariant(false) // vampiric 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
36 |
<< QVariant(false) // karma 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
37 |
<< QVariant(false) // artillery 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
38 |
<< QVariant(true) // random order 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
39 |
<< QVariant(false) // king 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
40 |
<< QVariant(false) // place hog 14 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
41 |
<< QVariant(false) // shared ammo 15 |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
42 |
<< QVariant(false) // disable girders 16 |
3287 | 43 |
<< QVariant(false) // disable land objects 17 |
3743 | 44 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
45 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
46 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
47 |
<< QVariant(false) // per hog ammo 21 |
4250 | 48 |
<< QVariant(false) // no wind 22 |
49 |
<< QVariant(100) // damage modfier 23 |
|
50 |
<< QVariant(45) // turn time 24 |
|
51 |
<< QVariant(100) // init health 25 |
|
52 |
<< QVariant(15) // sudden death 26 |
|
53 |
<< QVariant(5) // case prob 27 |
|
54 |
<< QVariant(3) // mines time 28 |
|
55 |
<< QVariant(4) // mines number 29 |
|
56 |
<< QVariant(0) // mine dud pct 30 |
|
57 |
<< QVariant(2) // explosives 31 |
|
58 |
<< QVariant(35) // health case pct 32 |
|
59 |
<< QVariant(25) // health case amt 33 |
|
60 |
<< QVariant(47) // water rise amt 34 |
|
61 |
<< QVariant(5) // health dec amt 35 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
62 |
; |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
63 |
|
1897 | 64 |
AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) : |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
65 |
QAbstractTableModel(parent), |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
66 |
fileConfig(fileName, QSettings::IniFormat) |
1881 | 67 |
{ |
4232
3a7862405c36
tweak interface, there is no need to manually add new weapons and schemes to the filter list
koda
parents:
4231
diff
changeset
|
68 |
predefSchemesNames = QStringList() |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
69 |
<< "Default" |
3172 | 70 |
<< "Pro Mode" |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
71 |
<< "Shoppa" |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
72 |
<< "Clean Slate" |
3172 | 73 |
<< "Minefield" |
74 |
<< "Barrel Mayhem" |
|
4151
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
75 |
<< "Tunnel Hogs" |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
76 |
<< "Fort Mode" |
4231 | 77 |
<< "Timeless" |
78 |
<< "Thinking with Portals" |
|
79 |
<< "King Mode" |
|
80 |
; |
|
3172 | 81 |
|
82 |
numberOfDefaultSchemes = predefSchemesNames.size(); |
|
2377 | 83 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
84 |
spNames = QStringList() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
85 |
<< "name" // 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
86 |
<< "fortsmode" // 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
87 |
<< "divteams" // 2 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
88 |
<< "solidland" // 3 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
89 |
<< "border" // 4 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
90 |
<< "lowgrav" // 5 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
91 |
<< "laser" // 6 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
92 |
<< "invulnerability" // 7 |
4099 | 93 |
<< "resethealth" // 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
94 |
<< "vampiric" // 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
95 |
<< "karma" // 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
96 |
<< "artillery" // 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
97 |
<< "randomorder" // 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
98 |
<< "king" // 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
99 |
<< "placehog" // 14 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
100 |
<< "sharedammo" // 15 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
101 |
<< "disablegirders" // 16 |
3287 | 102 |
<< "disablelandobjects" // 17 |
3743 | 103 |
<< "aisurvival" // 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
104 |
<< "infattack" // 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
105 |
<< "resetweps" // 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
106 |
<< "perhogammo" // 21 |
4250 | 107 |
<< "disablewind" // 22 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
108 |
<< "damagefactor" // 22 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
109 |
<< "turntime" // 23 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
110 |
<< "health" // 24 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
111 |
<< "suddendeath" // 25 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
112 |
<< "caseprobability" // 26 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
113 |
<< "minestime" // 27 |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
114 |
<< "minesnum" // 28 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
115 |
<< "minedudpct" // 29 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
116 |
<< "explosives" // 30 |
4143
eb7981f34800
Remove the last vestiges of the shoppa hack by adding 2 spinners for percentage health and amount of health in crate, also update translations and increase SD spinner (some users have requested it)
henek
parents:
4130
diff
changeset
|
117 |
<< "healthprobability" // 31 |
eb7981f34800
Remove the last vestiges of the shoppa hack by adding 2 spinners for percentage health and amount of health in crate, also update translations and increase SD spinner (some users have requested it)
henek
parents:
4130
diff
changeset
|
118 |
<< "healthcaseamount" // 32 |
4153
6bd94e4c5d65
2 more variables to control water rise and health loss during sudden death.
henek
parents:
4151
diff
changeset
|
119 |
<< "waterrise" // 33 |
6bd94e4c5d65
2 more variables to control water rise and health loss during sudden death.
henek
parents:
4151
diff
changeset
|
120 |
<< "healthdecrease" // 34 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
121 |
; |
1897 | 122 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
123 |
QList<QVariant> proMode; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
124 |
proMode |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
125 |
<< predefSchemesNames[1] // name 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
126 |
<< QVariant(false) // fortsmode 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
127 |
<< QVariant(false) // team divide 2 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
128 |
<< QVariant(false) // solid land 3 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
129 |
<< QVariant(false) // border 4 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
130 |
<< QVariant(false) // low gravity 5 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
131 |
<< QVariant(false) // laser sight 6 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
132 |
<< QVariant(false) // invulnerable 7 |
4099 | 133 |
<< QVariant(false) // reset health 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
134 |
<< QVariant(false) // vampiric 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
135 |
<< QVariant(false) // karma 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
136 |
<< QVariant(false) // artillery 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
137 |
<< QVariant(true) // random order 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
138 |
<< QVariant(false) // king 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
139 |
<< QVariant(false) // place hog 14 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
140 |
<< QVariant(true) // shared ammo 15 |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
141 |
<< QVariant(false) // disable girders 16 |
3287 | 142 |
<< QVariant(false) // disable land objects 17 |
3743 | 143 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
144 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
145 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
146 |
<< QVariant(false) // per hog ammo 21 |
4250 | 147 |
<< QVariant(false) // no wind 22 |
148 |
<< QVariant(100) // damage modfier 23 |
|
149 |
<< QVariant(15) // turn time 24 |
|
150 |
<< QVariant(100) // init health 25 |
|
151 |
<< QVariant(15) // sudden death 26 |
|
152 |
<< QVariant(0) // case prob 27 |
|
153 |
<< QVariant(3) // mines time 28 |
|
154 |
<< QVariant(0) // mines number 29 |
|
155 |
<< QVariant(0) // mine dud pct 30 |
|
156 |
<< QVariant(2) // explosives 31 |
|
157 |
<< QVariant(35) // health case pct 32 |
|
158 |
<< QVariant(25) // health case amt 33 |
|
159 |
<< QVariant(47) // water rise amt 34 |
|
160 |
<< QVariant(5) // health dec amt 35 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
161 |
; |
1897 | 162 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
163 |
QList<QVariant> shoppa; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
164 |
shoppa |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
165 |
<< predefSchemesNames[2] // name 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
166 |
<< QVariant(false) // fortsmode 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
167 |
<< QVariant(false) // team divide 2 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
168 |
<< QVariant(true) // solid land 3 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
169 |
<< QVariant(true) // border 4 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
170 |
<< QVariant(false) // low gravity 5 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
171 |
<< QVariant(false) // laser sight 6 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
172 |
<< QVariant(false) // invulnerable 7 |
4099 | 173 |
<< QVariant(false) // reset health 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
174 |
<< QVariant(false) // vampiric 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
175 |
<< QVariant(false) // karma 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
176 |
<< QVariant(false) // artillery 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
177 |
<< QVariant(true) // random order 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
178 |
<< QVariant(false) // king 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
179 |
<< QVariant(false) // place hog 14 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
180 |
<< QVariant(true) // shared ammo 15 |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
181 |
<< QVariant(true) // disable girders 16 |
3287 | 182 |
<< QVariant(false) // disable land objects 17 |
3743 | 183 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
184 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
185 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
186 |
<< QVariant(false) // per hog ammo 21 |
4250 | 187 |
<< QVariant(false) // no wind 22 |
188 |
<< QVariant(100) // damage modfier 23 |
|
189 |
<< QVariant(30) // turn time 24 |
|
190 |
<< QVariant(100) // init health 25 |
|
191 |
<< QVariant(50) // sudden death 26 |
|
192 |
<< QVariant(1) // case prob 27 |
|
193 |
<< QVariant(3) // mines time 28 |
|
194 |
<< QVariant(0) // mines number 29 |
|
195 |
<< QVariant(0) // mine dud pct 30 |
|
196 |
<< QVariant(0) // explosives 31 |
|
197 |
<< QVariant(0) // health case pct 32 |
|
198 |
<< QVariant(25) // health case amt 33 |
|
199 |
<< QVariant(47) // water rise amt 34 |
|
200 |
<< QVariant(5) // health dec amt 35 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
201 |
; |
1974 | 202 |
|
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
203 |
QList<QVariant> cleanslate; |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
204 |
cleanslate |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
205 |
<< predefSchemesNames[3] // name 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
206 |
<< QVariant(false) // fortsmode 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
207 |
<< QVariant(false) // team divide 2 |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
208 |
<< QVariant(false) // solid land 3 |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
209 |
<< QVariant(false) // border 4 |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
210 |
<< QVariant(false) // low gravity 5 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
211 |
<< QVariant(false) // laser sight 6 |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
212 |
<< QVariant(false) // invulnerable 7 |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
213 |
<< QVariant(true) // reset health 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
214 |
<< QVariant(false) // vampiric 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
215 |
<< QVariant(false) // karma 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
216 |
<< QVariant(false) // artillery 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
217 |
<< QVariant(true) // random order 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
218 |
<< QVariant(false) // king 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
219 |
<< QVariant(false) // place hog 14 |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
220 |
<< QVariant(false) // shared ammo 15 |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
221 |
<< QVariant(false) // disable girders 16 |
3287 | 222 |
<< QVariant(false) // disable land objects 17 |
3743 | 223 |
<< QVariant(false) // AI survival 18 |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
224 |
<< QVariant(true) // inf. attack 19 |
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
225 |
<< QVariant(true) // reset weps 20 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
226 |
<< QVariant(false) // per hog ammo 21 |
4250 | 227 |
<< QVariant(false) // no wind 22 |
228 |
<< QVariant(100) // damage modfier 23 |
|
229 |
<< QVariant(45) // turn time 24 |
|
230 |
<< QVariant(100) // init health 25 |
|
231 |
<< QVariant(15) // sudden death 26 |
|
232 |
<< QVariant(5) // case prob 27 |
|
233 |
<< QVariant(3) // mines time 28 |
|
234 |
<< QVariant(4) // mines number 29 |
|
235 |
<< QVariant(0) // mine dud pct 30 |
|
236 |
<< QVariant(2) // explosives 31 |
|
237 |
<< QVariant(35) // health case pct 32 |
|
238 |
<< QVariant(25) // health case amt 33 |
|
239 |
<< QVariant(47) // water rise amt 34 |
|
240 |
<< QVariant(5) // health dec amt 35 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
241 |
; |
1968 | 242 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
243 |
QList<QVariant> minefield; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
244 |
minefield |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
245 |
<< predefSchemesNames[4] // name 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
246 |
<< QVariant(false) // fortsmode 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
247 |
<< QVariant(false) // team divide 2 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
248 |
<< QVariant(false) // solid land 3 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
249 |
<< QVariant(false) // border 4 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
250 |
<< QVariant(false) // low gravity 5 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
251 |
<< QVariant(false) // laser sight 6 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
252 |
<< QVariant(false) // invulnerable 7 |
4099 | 253 |
<< QVariant(false) // reset health 8 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
254 |
<< QVariant(false) // vampiric 9 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
255 |
<< QVariant(false) // karma 10 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
256 |
<< QVariant(false) // artillery 11 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
257 |
<< QVariant(true) // random order 12 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
258 |
<< QVariant(false) // king 13 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
259 |
<< QVariant(false) // place hog 14 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
260 |
<< QVariant(true) // shared ammo 15 |
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
261 |
<< QVariant(true) // disable girders 16 |
3287 | 262 |
<< QVariant(false) // disable land objects 17 |
3743 | 263 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
264 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
265 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
266 |
<< QVariant(false) // per hog ammo 21 |
4250 | 267 |
<< QVariant(false) // no wind 22 |
268 |
<< QVariant(150) // damage modfier 23 |
|
269 |
<< QVariant(30) // turn time 24 |
|
270 |
<< QVariant(50) // init health 25 |
|
271 |
<< QVariant(15) // sudden death 26 |
|
272 |
<< QVariant(0) // case prob 27 |
|
273 |
<< QVariant(0) // mines time 28 |
|
274 |
<< QVariant(80) // mines number 29 |
|
275 |
<< QVariant(0) // mine dud pct 30 |
|
276 |
<< QVariant(0) // explosives 31 |
|
277 |
<< QVariant(35) // health case pct 32 |
|
278 |
<< QVariant(25) // health case amt 33 |
|
279 |
<< QVariant(47) // water rise amt 34 |
|
280 |
<< QVariant(5) // health dec amt 35 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
281 |
; |
2093
485e084cedc4
Portugese (european) translation, Tiy's "minefield" scheme/wepset, disable vampirism, update translations
nemo
parents:
2031
diff
changeset
|
282 |
|
3172 | 283 |
QList<QVariant> barrelmayhem; |
284 |
barrelmayhem |
|
285 |
<< predefSchemesNames[5] // name 0 |
|
286 |
<< QVariant(false) // fortsmode 1 |
|
287 |
<< QVariant(false) // team divide 2 |
|
288 |
<< QVariant(false) // solid land 3 |
|
289 |
<< QVariant(false) // border 4 |
|
290 |
<< QVariant(false) // low gravity 5 |
|
291 |
<< QVariant(false) // laser sight 6 |
|
292 |
<< QVariant(false) // invulnerable 7 |
|
4099 | 293 |
<< QVariant(false) // reset health 8 |
3172 | 294 |
<< QVariant(false) // vampiric 9 |
295 |
<< QVariant(false) // karma 10 |
|
296 |
<< QVariant(false) // artillery 11 |
|
297 |
<< QVariant(true) // random order 12 |
|
298 |
<< QVariant(false) // king 13 |
|
299 |
<< QVariant(false) // place hog 14 |
|
300 |
<< QVariant(true) // shared ammo 15 |
|
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
301 |
<< QVariant(false) // disable girders 16 |
3287 | 302 |
<< QVariant(false) // disable land objects 17 |
3743 | 303 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
304 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
305 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
306 |
<< QVariant(false) // per hog ammo 21 |
4250 | 307 |
<< QVariant(false) // no wind 22 |
308 |
<< QVariant(100) // damage modfier 23 |
|
309 |
<< QVariant(30) // turn time 24 |
|
310 |
<< QVariant(100) // init health 25 |
|
311 |
<< QVariant(15) // sudden death 26 |
|
312 |
<< QVariant(0) // case prob 27 |
|
313 |
<< QVariant(0) // mines time 28 |
|
314 |
<< QVariant(0) // mines number 29 |
|
315 |
<< QVariant(0) // mine dud pct 30 |
|
316 |
<< QVariant(80) // explosives 31 |
|
317 |
<< QVariant(35) // health case pct 32 |
|
318 |
<< QVariant(25) // health case amt 33 |
|
319 |
<< QVariant(47) // water rise amt 34 |
|
320 |
<< QVariant(5) // health dec amt 35 |
|
3172 | 321 |
; |
322 |
||
323 |
QList<QVariant> tunnelhogs; |
|
324 |
tunnelhogs |
|
325 |
<< predefSchemesNames[6] // name 0 |
|
326 |
<< QVariant(false) // fortsmode 1 |
|
327 |
<< QVariant(false) // team divide 2 |
|
328 |
<< QVariant(false) // solid land 3 |
|
329 |
<< QVariant(true) // border 4 |
|
330 |
<< QVariant(false) // low gravity 5 |
|
331 |
<< QVariant(false) // laser sight 6 |
|
332 |
<< QVariant(false) // invulnerable 7 |
|
4099 | 333 |
<< QVariant(false) // reset health 8 |
3172 | 334 |
<< QVariant(false) // vampiric 9 |
335 |
<< QVariant(false) // karma 10 |
|
336 |
<< QVariant(false) // artillery 11 |
|
337 |
<< QVariant(true) // random order 12 |
|
338 |
<< QVariant(false) // king 13 |
|
339 |
<< QVariant(false) // place hog 14 |
|
340 |
<< QVariant(true) // shared ammo 15 |
|
4003
ca0600ab38bf
disable gfMines and update variable names (landadds -> minesnum, cLandAdditions -> cLandMines)
koda
parents:
3943
diff
changeset
|
341 |
<< QVariant(true) // disable girders 16 |
3287 | 342 |
<< QVariant(true) // disable land objects 17 |
3743 | 343 |
<< QVariant(false) // AI survival 18 |
3943
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
344 |
<< QVariant(false) // inf. attack 19 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
345 |
<< QVariant(false) // reset weps 20 |
9835060e5c01
Add per-hog ammo option, initial stubs for infinite attack and weapon reset, fix a bug in ammo switching
nemo
parents:
3743
diff
changeset
|
346 |
<< QVariant(false) // per hog ammo 21 |
4250 | 347 |
<< QVariant(false) // no wind 22 |
348 |
<< QVariant(100) // damage modfier 23 |
|
349 |
<< QVariant(30) // turn time 24 |
|
350 |
<< QVariant(100) // init health 25 |
|
351 |
<< QVariant(15) // sudden death 26 |
|
352 |
<< QVariant(5) // case prob 27 |
|
353 |
<< QVariant(3) // mines time 28 |
|
354 |
<< QVariant(10) // mines number 29 |
|
355 |
<< QVariant(10) // mine dud pct 30 |
|
356 |
<< QVariant(10) // explosives 31 |
|
357 |
<< QVariant(35) // health case pct 32 |
|
358 |
<< QVariant(25) // health case amt 33 |
|
359 |
<< QVariant(47) // water rise amt 34 |
|
360 |
<< QVariant(5) // health dec amt 35 |
|
3172 | 361 |
; |
362 |
||
4151
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
363 |
QList<QVariant> forts; |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
364 |
forts |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
365 |
<< predefSchemesNames[7] // name 0 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
366 |
<< QVariant(true) // fortsmode 1 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
367 |
<< QVariant(true) // team divide 2 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
368 |
<< QVariant(false) // solid land 3 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
369 |
<< QVariant(false) // border 4 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
370 |
<< QVariant(true) // low gravity 5 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
371 |
<< QVariant(false) // laser sight 6 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
372 |
<< QVariant(false) // invulnerable 7 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
373 |
<< QVariant(false) // reset health 8 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
374 |
<< QVariant(false) // vampiric 9 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
375 |
<< QVariant(false) // karma 10 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
376 |
<< QVariant(false) // artillery 11 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
377 |
<< QVariant(true) // random order 12 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
378 |
<< QVariant(false) // king 13 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
379 |
<< QVariant(false) // place hog 14 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
380 |
<< QVariant(false) // shared ammo 15 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
381 |
<< QVariant(false) // disable girders 16 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
382 |
<< QVariant(false) // disable land objects 17 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
383 |
<< QVariant(false) // AI survival 18 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
384 |
<< QVariant(false) // inf. attack 19 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
385 |
<< QVariant(false) // reset weps 20 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
386 |
<< QVariant(false) // per hog ammo 21 |
4250 | 387 |
<< QVariant(false) // no wind 22 |
388 |
<< QVariant(100) // damage modfier 23 |
|
389 |
<< QVariant(45) // turn time 24 |
|
390 |
<< QVariant(100) // init health 25 |
|
391 |
<< QVariant(15) // sudden death 26 |
|
392 |
<< QVariant(5) // case prob 27 |
|
393 |
<< QVariant(3) // mines time 28 |
|
394 |
<< QVariant(0) // mines number 29 |
|
395 |
<< QVariant(0) // mine dud pct 30 |
|
396 |
<< QVariant(0) // explosives 31 |
|
397 |
<< QVariant(35) // health case pct 32 |
|
398 |
<< QVariant(25) // health case amt 33 |
|
399 |
<< QVariant(47) // water rise amt 34 |
|
400 |
<< QVariant(5) // health dec amt 35 |
|
4151
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
401 |
; |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
402 |
|
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
403 |
QList<QVariant> timeless; |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
404 |
timeless |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
405 |
<< predefSchemesNames[8] // name 0 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
406 |
<< QVariant(false) // fortsmode 1 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
407 |
<< QVariant(false) // team divide 2 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
408 |
<< QVariant(false) // solid land 3 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
409 |
<< QVariant(false) // border 4 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
410 |
<< QVariant(false) // low gravity 5 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
411 |
<< QVariant(false) // laser sight 6 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
412 |
<< QVariant(false) // invulnerable 7 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
413 |
<< QVariant(false) // reset health 8 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
414 |
<< QVariant(false) // vampiric 9 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
415 |
<< QVariant(false) // karma 10 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
416 |
<< QVariant(false) // artillery 11 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
417 |
<< QVariant(true) // random order 12 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
418 |
<< QVariant(false) // king 13 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
419 |
<< QVariant(false) // place hog 14 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
420 |
<< QVariant(false) // shared ammo 15 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
421 |
<< QVariant(false) // disable girders 16 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
422 |
<< QVariant(false) // disable land objects 17 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
423 |
<< QVariant(false) // AI survival 18 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
424 |
<< QVariant(false) // inf. attack 19 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
425 |
<< QVariant(false) // reset weps 20 |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
426 |
<< QVariant(true) // per hog ammo 21 |
4250 | 427 |
<< QVariant(false) // no wind 22 |
428 |
<< QVariant(100) // damage modfier 23 |
|
429 |
<< QVariant(9999) // turn time 24 |
|
430 |
<< QVariant(100) // init health 25 |
|
431 |
<< QVariant(15) // sudden death 26 |
|
432 |
<< QVariant(5) // case prob 27 |
|
433 |
<< QVariant(3) // mines time 28 |
|
434 |
<< QVariant(5) // mines number 29 |
|
435 |
<< QVariant(10) // mine dud pct 30 |
|
436 |
<< QVariant(2) // explosives 31 |
|
437 |
<< QVariant(35) // health case pct 32 |
|
438 |
<< QVariant(30) // health case amt 33 |
|
439 |
<< QVariant(0) // water rise amt 34 |
|
440 |
<< QVariant(0) // health dec amt 35 |
|
4151
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
441 |
; |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
442 |
|
4231 | 443 |
QList<QVariant> thinkingportals; |
444 |
thinkingportals |
|
445 |
<< predefSchemesNames[9] // name 0 |
|
446 |
<< QVariant(false) // fortsmode 1 |
|
447 |
<< QVariant(false) // team divide 2 |
|
448 |
<< QVariant(false) // solid land 3 |
|
449 |
<< QVariant(false) // border 4 |
|
450 |
<< QVariant(false) // low gravity 5 |
|
451 |
<< QVariant(false) // laser sight 6 |
|
452 |
<< QVariant(false) // invulnerable 7 |
|
453 |
<< QVariant(false) // reset health 8 |
|
454 |
<< QVariant(false) // vampiric 9 |
|
455 |
<< QVariant(false) // karma 10 |
|
456 |
<< QVariant(true) // artillery 11 |
|
457 |
<< QVariant(true) // random order 12 |
|
458 |
<< QVariant(false) // king 13 |
|
459 |
<< QVariant(false) // place hog 14 |
|
460 |
<< QVariant(false) // shared ammo 15 |
|
461 |
<< QVariant(false) // disable girders 16 |
|
462 |
<< QVariant(false) // disable land objects 17 |
|
463 |
<< QVariant(false) // AI survival 18 |
|
464 |
<< QVariant(false) // inf. attack 19 |
|
465 |
<< QVariant(false) // reset weps 20 |
|
466 |
<< QVariant(false) // per hog ammo 21 |
|
4250 | 467 |
<< QVariant(false) // no wind 22 |
468 |
<< QVariant(100) // damage modfier 23 |
|
469 |
<< QVariant(45) // turn time 24 |
|
470 |
<< QVariant(100) // init health 25 |
|
471 |
<< QVariant(15) // sudden death 26 |
|
472 |
<< QVariant(2) // case prob 27 |
|
473 |
<< QVariant(3) // mines time 28 |
|
474 |
<< QVariant(5) // mines number 29 |
|
475 |
<< QVariant(0) // mine dud pct 30 |
|
476 |
<< QVariant(5) // explosives 31 |
|
477 |
<< QVariant(25) // health case pct 32 |
|
478 |
<< QVariant(25) // health case amt 33 |
|
479 |
<< QVariant(47) // water rise amt 34 |
|
480 |
<< QVariant(5) // health dec amt 35 |
|
4231 | 481 |
; |
482 |
||
483 |
QList<QVariant> kingmode; |
|
484 |
kingmode |
|
4232
3a7862405c36
tweak interface, there is no need to manually add new weapons and schemes to the filter list
koda
parents:
4231
diff
changeset
|
485 |
<< predefSchemesNames[10] // name 0 |
4231 | 486 |
<< QVariant(false) // fortsmode 1 |
487 |
<< QVariant(false) // team divide 2 |
|
488 |
<< QVariant(false) // solid land 3 |
|
489 |
<< QVariant(false) // border 4 |
|
490 |
<< QVariant(false) // low gravity 5 |
|
491 |
<< QVariant(false) // laser sight 6 |
|
492 |
<< QVariant(false) // invulnerable 7 |
|
493 |
<< QVariant(false) // reset health 8 |
|
494 |
<< QVariant(false) // vampiric 9 |
|
495 |
<< QVariant(false) // karma 10 |
|
496 |
<< QVariant(false) // artillery 11 |
|
497 |
<< QVariant(true) // random order 12 |
|
498 |
<< QVariant(true) // king 13 |
|
499 |
<< QVariant(true) // place hog 14 |
|
500 |
<< QVariant(true) // shared ammo 15 |
|
501 |
<< QVariant(false) // disable girders 16 |
|
502 |
<< QVariant(false) // disable land objects 17 |
|
503 |
<< QVariant(false) // AI survival 18 |
|
504 |
<< QVariant(false) // inf. attack 19 |
|
505 |
<< QVariant(false) // reset weps 20 |
|
506 |
<< QVariant(false) // per hog ammo 21 |
|
4250 | 507 |
<< QVariant(false) // no wind 22 |
508 |
<< QVariant(100) // damage modfier 23 |
|
509 |
<< QVariant(45) // turn time 24 |
|
510 |
<< QVariant(100) // init health 25 |
|
511 |
<< QVariant(15) // sudden death 26 |
|
512 |
<< QVariant(5) // case prob 27 |
|
513 |
<< QVariant(3) // mines time 28 |
|
514 |
<< QVariant(3) // mines number 29 |
|
515 |
<< QVariant(20) // mine dud pct 30 |
|
516 |
<< QVariant(3) // explosives 31 |
|
517 |
<< QVariant(35) // health case pct 32 |
|
518 |
<< QVariant(30) // health case amt 33 |
|
519 |
<< QVariant(30) // water rise amt 34 |
|
520 |
<< QVariant(5) // health dec amt 35 |
|
4231 | 521 |
; |
522 |
||
523 |
||
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
524 |
schemes.append(defaultScheme); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
525 |
schemes.append(proMode); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
526 |
schemes.append(shoppa); |
4130
f437909ac9d4
Replace the deprecated Basketball mode with Clean Slate mode which uses a few of the new scheme options
nemo
parents:
4100
diff
changeset
|
527 |
schemes.append(cleanslate); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
528 |
schemes.append(minefield); |
3172 | 529 |
schemes.append(barrelmayhem); |
530 |
schemes.append(tunnelhogs); |
|
4151
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
531 |
schemes.append(forts); |
08b95ec1bfdf
add Timeless and Fort game modes, tweaks to other modes
koda
parents:
4143
diff
changeset
|
532 |
schemes.append(timeless); |
4231 | 533 |
schemes.append(thinkingportals); |
534 |
schemes.append(kingmode); |
|
1897 | 535 |
|
536 |
||
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
537 |
int size = fileConfig.beginReadArray("schemes"); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
538 |
for (int i = 0; i < size; ++i) { |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
539 |
fileConfig.setArrayIndex(i); |
1897 | 540 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
541 |
if (!predefSchemesNames.contains(fileConfig.value(spNames[0]).toString())) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
542 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
543 |
QList<QVariant> scheme; |
1897 | 544 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
545 |
for (int k = 0; k < spNames.size(); ++k) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
546 |
scheme << fileConfig.value(spNames[k], defaultScheme[k]); |
1897 | 547 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
548 |
schemes.append(scheme); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
549 |
} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
550 |
} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
551 |
fileConfig.endArray(); |
1881 | 552 |
} |
553 |
||
554 |
QVariant AmmoSchemeModel::headerData(int section, Qt::Orientation orientation, int role) const |
|
555 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
556 |
return QVariant(); |
1881 | 557 |
} |
558 |
||
559 |
int AmmoSchemeModel::rowCount(const QModelIndex &parent) const |
|
560 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
561 |
if (parent.isValid()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
562 |
return 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
563 |
else |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
564 |
return schemes.size(); |
1881 | 565 |
} |
566 |
||
567 |
int AmmoSchemeModel::columnCount(const QModelIndex & parent) const |
|
568 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
569 |
if (parent.isValid()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
570 |
return 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
571 |
else |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
572 |
return defaultScheme.size(); |
1881 | 573 |
} |
574 |
||
575 |
Qt::ItemFlags AmmoSchemeModel::flags(const QModelIndex & index) const |
|
576 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
577 |
return |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
578 |
Qt::ItemIsEnabled |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
579 |
| Qt::ItemIsSelectable |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
580 |
| Qt::ItemIsEditable; |
1881 | 581 |
} |
582 |
||
583 |
bool AmmoSchemeModel::setData(const QModelIndex & index, const QVariant & value, int role) |
|
584 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
585 |
if (!index.isValid() || index.row() < numberOfDefaultSchemes |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
586 |
|| index.row() >= schemes.size() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
587 |
|| index.column() >= defaultScheme.size() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
588 |
|| role != Qt::EditRole) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
589 |
return false; |
1884 | 590 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
591 |
schemes[index.row()][index.column()] = value; |
1885 | 592 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
593 |
emit dataChanged(index, index); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
594 |
return true; |
1881 | 595 |
} |
1884 | 596 |
|
597 |
bool AmmoSchemeModel::insertRows(int row, int count, const QModelIndex & parent) |
|
598 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
599 |
beginInsertRows(parent, row, row); |
1884 | 600 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
601 |
QList<QVariant> newScheme = defaultScheme; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
602 |
newScheme[0] = QVariant(tr("new")); |
2377 | 603 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
604 |
schemes.insert(row, newScheme); |
1884 | 605 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
606 |
endInsertRows(); |
2377 | 607 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
608 |
return true; |
1884 | 609 |
} |
610 |
||
611 |
bool AmmoSchemeModel::removeRows(int row, int count, const QModelIndex & parent) |
|
612 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
613 |
if(count != 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
614 |
|| row < numberOfDefaultSchemes |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
615 |
|| row >= schemes.size()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
616 |
return false; |
2377 | 617 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
618 |
beginRemoveRows(parent, row, row); |
1884 | 619 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
620 |
schemes.removeAt(row); |
1884 | 621 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
622 |
endRemoveRows(); |
1902
aeadb10c2d77
Add delete button and scheme selection combobox to scheme edit page
unc0rr
parents:
1899
diff
changeset
|
623 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
624 |
return true; |
1884 | 625 |
} |
626 |
||
627 |
QVariant AmmoSchemeModel::data(const QModelIndex &index, int role) const |
|
628 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
629 |
if (!index.isValid() || index.row() < 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
630 |
|| index.row() >= schemes.size() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
631 |
|| index.column() >= defaultScheme.size() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
632 |
|| (role != Qt::EditRole && role != Qt::DisplayRole) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
633 |
) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
634 |
return QVariant(); |
1884 | 635 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
636 |
return schemes[index.row()][index.column()]; |
1884 | 637 |
} |
1897 | 638 |
|
639 |
void AmmoSchemeModel::Save() |
|
640 |
{ |
|
3494 | 641 |
fileConfig.beginWriteArray("schemes", schemes.size() - numberOfDefaultSchemes); |
2377 | 642 |
|
3494 | 643 |
for (int i = 0; i < schemes.size() - numberOfDefaultSchemes; ++i) { |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
644 |
fileConfig.setArrayIndex(i); |
1897 | 645 |
|
3494 | 646 |
QList<QVariant> scheme = schemes[i + numberOfDefaultSchemes]; |
2377 | 647 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
648 |
for (int k = 0; k < scheme.size(); ++k) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
649 |
fileConfig.setValue(spNames[k], scheme[k]); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
650 |
} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
651 |
fileConfig.endArray(); |
1897 | 652 |
} |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
653 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
654 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
655 |
NetAmmoSchemeModel::NetAmmoSchemeModel(QObject * parent) : |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
656 |
QAbstractTableModel(parent) |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
657 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
658 |
netScheme = defaultScheme; |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
659 |
} |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
660 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
661 |
QVariant NetAmmoSchemeModel::headerData(int section, Qt::Orientation orientation, int role) const |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
662 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
663 |
return QVariant(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
664 |
} |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
665 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
666 |
int NetAmmoSchemeModel::rowCount(const QModelIndex & parent) const |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
667 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
668 |
if (parent.isValid()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
669 |
return 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
670 |
else |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
671 |
return 1; |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
672 |
} |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
673 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
674 |
int NetAmmoSchemeModel::columnCount(const QModelIndex & parent) const |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
675 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
676 |
if (parent.isValid()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
677 |
return 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
678 |
else |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
679 |
return defaultScheme.size(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
680 |
} |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
681 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
682 |
QVariant NetAmmoSchemeModel::data(const QModelIndex &index, int role) const |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
683 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
684 |
if (!index.isValid() || index.row() < 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
685 |
|| index.row() > 1 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
686 |
|| index.column() >= defaultScheme.size() |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
687 |
|| (role != Qt::EditRole && role != Qt::DisplayRole) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
688 |
) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
689 |
return QVariant(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
690 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
691 |
return netScheme[index.column()]; |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
692 |
} |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
693 |
|
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
694 |
void NetAmmoSchemeModel::setNetSchemeConfig(QStringList & cfg) |
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
695 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
696 |
if(cfg.size() != netScheme.size()) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
697 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
698 |
qWarning("Incorrect scheme cfg size"); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
699 |
return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
700 |
} |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
701 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
702 |
for(int i = 0; i < cfg.size(); ++i) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
703 |
netScheme[i] = QVariant(cfg[i]); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
704 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
705 |
reset(); |
1899
5763f46d7486
Sync schemes config over net should work now (untested)
unc0rr
parents:
1897
diff
changeset
|
706 |
} |