Allow changing industry event rate setting at any time

This commit is contained in:
Jonathan G Rennison 2024-08-01 22:43:32 +01:00
parent f30338e73b
commit 94caf0f407
2 changed files with 7 additions and 1 deletions

View File

@ -2052,6 +2052,11 @@ static void DayLengthChanged(int32_t new_value)
MarkWholeScreenDirty();
}
static void IndustryEventRateChanged(int32_t new_value)
{
if (_game_mode != GM_MENU) StartupIndustryDailyChanges(false);
}
static void TownZoneModeChanged(int32_t new_value)
{
InvalidateWindowClassesData(WC_GAME_OPTIONS);

View File

@ -13,6 +13,7 @@ static void ChangeTimekeepingUnits(int32_t new_value);
static void ChangeMinutesPerYear(int32_t new_value);
static void InvalidateCompanyWindow(int32_t new_value);
static void DayLengthChanged(int32_t new_value);
static void IndustryEventRateChanged(int32_t new_value);
static bool CheckSharingRail(int32_t &new_value);
static void SharingRailChanged(int32_t new_value);
static bool CheckSharingRoad(int32_t &new_value);
@ -255,7 +256,6 @@ strhelp = STR_CONFIG_SETTING_SPAWN_PRIMARY_INDUSTRY_ONLY_HELPTEXT
[SDT_VAR]
var = economy.industry_event_rate
type = SLE_UINT8
flags = SF_NEWGAME_ONLY
def = 100
min = 1
max = 250
@ -263,6 +263,7 @@ str = STR_CONFIG_SETTING_INDUSTRY_EVENT_RATE
strhelp = STR_CONFIG_SETTING_INDUSTRY_EVENT_RATE_HELPTEXT
strval = STR_CONFIG_SETTING_PERCENTAGE
cat = SC_EXPERT
post_cb = IndustryEventRateChanged
[SDT_BOOL]
var = economy.bribe