Files
@ r26911:c2c571bbaef9
Branch filter:
Location: cpp/openttd-patchpack/source/src/table/settings/economy_settings.ini
r26911:c2c571bbaef9
8.2 KiB
text/x-ini
Codechange: split large function into smaller steps and simplify logic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | ; This file is part of OpenTTD.
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
;
; Economy settings as stored in the main configuration file ("openttd.cfg")
; and in the savegame PATS chunk.
[pre-amble]
static void TownFoundingChanged(int32 new_value);
static const SettingVariant _economy_settings_table[] = {
[post-amble]
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
[defaults]
flags = SF_NONE
interval = 0
str = STR_NULL
strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT
strval = STR_NULL
pre_cb = nullptr
post_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION
cat = SC_ADVANCED
extra = 0
startup = false
[SDT_VAR]
var = economy.town_layout
type = SLE_UINT8
from = SLV_59
flags = SF_GUI_DROPDOWN
def = TL_ORIGINAL
min = TL_BEGIN
max = NUM_TLS - 1
interval = 1
str = STR_CONFIG_SETTING_TOWN_LAYOUT
strhelp = STR_CONFIG_SETTING_TOWN_LAYOUT_HELPTEXT
strval = STR_CONFIG_SETTING_TOWN_LAYOUT_DEFAULT
post_cb = TownFoundingChanged
[SDT_BOOL]
var = economy.allow_town_roads
from = SLV_113
flags = SF_NO_NETWORK
def = true
str = STR_CONFIG_SETTING_ALLOW_TOWN_ROADS
strhelp = STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT
[SDT_VAR]
var = economy.found_town
type = SLE_UINT8
from = SLV_128
flags = SF_GUI_DROPDOWN
def = TF_FORBIDDEN
min = TF_BEGIN
max = TF_END - 1
interval = 1
str = STR_CONFIG_SETTING_TOWN_FOUNDING
strhelp = STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT
strval = STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN
post_cb = TownFoundingChanged
cat = SC_BASIC
[SDT_BOOL]
var = economy.allow_town_level_crossings
from = SLV_143
flags = SF_NO_NETWORK
def = true
str = STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS
strhelp = STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT
[SDT_VAR]
var = economy.town_cargogen_mode
type = SLE_UINT8
from = SLV_TOWN_CARGOGEN
flags = SF_GUI_DROPDOWN
def = TCGM_BITCOUNT
min = TCGM_BEGIN
max = TCGM_END - 1
interval = 1
str = STR_CONFIG_SETTING_TOWN_CARGOGENMODE
strhelp = STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT
strval = STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL
cat = SC_ADVANCED
[SDT_BOOL]
var = economy.station_noise_level
from = SLV_96
flags = SF_NO_NETWORK
def = false
str = STR_CONFIG_SETTING_NOISE_LEVEL
strhelp = STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT
post_cb = [](auto new_value) { InvalidateWindowClassesData(WC_TOWN_VIEW, new_value); }
[SDT_BOOL]
var = economy.inflation
flags = SF_NO_NETWORK
def = false
str = STR_CONFIG_SETTING_INFLATION
strhelp = STR_CONFIG_SETTING_INFLATION_HELPTEXT
cat = SC_BASIC
[SDT_BOOL]
var = economy.multiple_industry_per_town
def = false
str = STR_CONFIG_SETTING_MULTIPINDTOWN
strhelp = STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT
[SDT_BOOL]
var = economy.bribe
def = true
str = STR_CONFIG_SETTING_BRIBE
strhelp = STR_CONFIG_SETTING_BRIBE_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
var = economy.exclusive_rights
from = SLV_79
def = true
str = STR_CONFIG_SETTING_ALLOW_EXCLUSIVE
strhelp = STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
var = economy.fund_buildings
from = SLV_165
def = true
str = STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS
strhelp = STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
var = economy.fund_roads
from = SLV_160
def = true
str = STR_CONFIG_SETTING_ALLOW_FUND_ROAD
strhelp = STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_TOWN_AUTHORITY); }
cat = SC_BASIC
[SDT_BOOL]
var = economy.give_money
from = SLV_79
def = true
str = STR_CONFIG_SETTING_ALLOW_GIVE_MONEY
strhelp = STR_CONFIG_SETTING_ALLOW_GIVE_MONEY_HELPTEXT
cat = SC_BASIC
[SDT_VAR]
var = economy.type
type = SLE_UINT8
flags = SF_GUI_DROPDOWN
def = ET_SMOOTH
min = ET_BEGIN
max = ET_END - 1
str = STR_CONFIG_SETTING_ECONOMY_TYPE
strhelp = STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT
strval = STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL
post_cb = [](auto) { InvalidateWindowClassesData(WC_INDUSTRY_VIEW); }
cat = SC_BASIC
[SDT_BOOL]
var = economy.allow_shares
def = false
str = STR_CONFIG_SETTING_ALLOW_SHARES
strhelp = STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_COMPANY); }
[SDT_VAR]
var = economy.min_years_for_shares
type = SLE_UINT8
from = SLV_TRADING_AGE
def = 6
min = 0
max = 255
interval = 1
str = STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES
strhelp = STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT
strval = STR_JUST_INT
cat = SC_EXPERT
[SDT_VAR]
var = economy.feeder_payment_share
type = SLE_UINT8
from = SLV_134
def = 75
min = 0
max = 100
str = STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE
strhelp = STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT
strval = STR_CONFIG_SETTING_PERCENTAGE
cat = SC_EXPERT
[SDT_VAR]
var = economy.town_growth_rate
type = SLE_UINT8
from = SLV_54
flags = SF_GUI_DROPDOWN
def = 2
min = 0
max = 4
str = STR_CONFIG_SETTING_TOWN_GROWTH
strhelp = STR_CONFIG_SETTING_TOWN_GROWTH_HELPTEXT
strval = STR_CONFIG_SETTING_TOWN_GROWTH_NONE
[SDT_VAR]
var = economy.larger_towns
type = SLE_UINT8
from = SLV_54
flags = SF_GUI_0_IS_SPECIAL
def = 4
min = 0
max = 255
interval = 1
str = STR_CONFIG_SETTING_LARGER_TOWNS
strhelp = STR_CONFIG_SETTING_LARGER_TOWNS_HELPTEXT
strval = STR_CONFIG_SETTING_LARGER_TOWNS_VALUE
[SDT_VAR]
var = economy.initial_city_size
type = SLE_UINT8
from = SLV_56
def = 2
min = 1
max = 10
interval = 1
str = STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER
strhelp = STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT
strval = STR_JUST_COMMA
[SDT_BOOL]
var = economy.mod_road_rebuild
from = SLV_77
def = true
cat = SC_EXPERT
[SDT_VAR]
var = economy.dist_local_authority
type = SLE_UINT8
def = 20
min = 5
max = 60
cat = SC_EXPERT
[SDT_VAR]
var = economy.town_noise_population[0]
type = SLE_UINT16
from = SLV_96
def = 800
min = 200
max = 65535
cat = SC_EXPERT
[SDT_VAR]
var = economy.town_noise_population[1]
type = SLE_UINT16
from = SLV_96
def = 2000
min = 400
max = 65535
cat = SC_EXPERT
[SDT_VAR]
var = economy.town_noise_population[2]
type = SLE_UINT16
from = SLV_96
def = 4000
min = 800
max = 65535
cat = SC_EXPERT
[SDT_VAR]
var = economy.town_noise_population[3]
type = SLE_UINT16
def = 400
min = 100
max = 65535
cat = SC_EXPERT
[SDT_BOOL]
var = economy.infrastructure_maintenance
from = SLV_166
def = false
str = STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE
strhelp = STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT
post_cb = [](auto) { InvalidateWindowClassesData(WC_COMPANY_INFRASTRUCTURE); }
cat = SC_BASIC
|