Codechange: Make GetDefaultValueCallback() more similar to other setting override callbacks (#13259)

This commit is contained in:
Loïc Guilloux
2025-01-04 00:17:47 +01:00
committed by GitHub
parent d38ecd6525
commit a52923b3b9
4 changed files with 16 additions and 31 deletions

View File

@@ -13,7 +13,7 @@ static bool CanUpdateServiceInterval(VehicleType type, int32_t &new_value);
static void UpdateServiceInterval(VehicleType type, int32_t new_value);
static void SettingsValueAbsolute(const IntSettingDesc &sd, uint first_param, int32_t value);
static void ServiceIntervalSettingsValueText(const IntSettingDesc &sd, uint first_param, int32_t value);
static int32_t GetDefaultServiceInterval(VehicleType type);
static int32_t GetDefaultServiceInterval(const IntSettingDesc &sd, VehicleType type);
static const SettingVariant _company_settings_table[] = {
[post-amble]
@@ -100,7 +100,7 @@ strhelp = STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_TRAIN, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_TRAIN, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_TRAIN); }
def_cb = [](auto &sd) { return GetDefaultServiceInterval(sd, VEH_TRAIN); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
@@ -116,7 +116,7 @@ strhelp = STR_CONFIG_SETTING_SERVINT_ROAD_VEHICLES_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_ROAD, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_ROAD, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_ROAD); }
def_cb = [](auto &sd) { return GetDefaultServiceInterval(sd, VEH_ROAD); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
@@ -132,7 +132,7 @@ strhelp = STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_SHIP, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_SHIP, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_SHIP); }
def_cb = [](auto &sd) { return GetDefaultServiceInterval(sd, VEH_SHIP); }
val_cb = ServiceIntervalSettingsValueText
[SDT_VAR]
@@ -148,5 +148,5 @@ strhelp = STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT
strval = STR_CONFIG_SETTING_SERVINT_VALUE_DAYS
pre_cb = [](auto &new_value) { return CanUpdateServiceInterval(VEH_AIRCRAFT, new_value); }
post_cb = [](auto new_value) { UpdateServiceInterval(VEH_AIRCRAFT, new_value); }
def_cb = []() { return GetDefaultServiceInterval(VEH_AIRCRAFT); }
def_cb = [](auto &sd) { return GetDefaultServiceInterval(sd, VEH_AIRCRAFT); }
val_cb = ServiceIntervalSettingsValueText