Simplify texts and GUI behaviour for cargo scaling mode settings

This commit is contained in:
Jonathan G Rennison 2024-08-13 01:17:04 +01:00
parent 4c3072e719
commit fbfb752b1c
9 changed files with 18 additions and 96 deletions

View File

@ -258,7 +258,7 @@ enum TickRateMode : uint8_t {
enum CargoScalingMode : uint8_t {
CSM_BEGIN = 0, ///< Used for iterations and limit testing
CSM_MONTHLY = 0, ///< Traditional cargo scaling
CSM_NORMAL = 0, ///< Normal cargo scaling
CSM_DAYLENGTH, ///< Also scale by day length
CSM_END, ///< Used for iterations and limit testing
};

View File

@ -590,21 +590,15 @@ STR_CONFIG_SETTING_ALLOW_TOWN_BRIDGES_HELPTEXT :Enabling this s
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_HELPTEXT_EXTRA :{STRING}{}This excludes tree-cutting industries.{}This is not guaranteed to be fully compatible with all industry NewGRFs.
STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE :Time interval for town cargo production scaling: {STRING2}
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE :Time interval for industry cargo production scaling: {STRING2}
STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE :Town cargo production scaling mode: {STRING2}
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE :Industry cargo production scaling mode: {STRING2}
STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT :Monthly/per production interval: The cargo production per month or production interval is scaled.{}{}Game-time: The cargo production per unit of game time is scaled, (the cargo production per month or production interval is also scaled by the economy speed reduction factor). Very high scaling factors may not be achievable.
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE_HELPTEXT_EXTRA :{STRING}{}Game-time mode is not guaranteed to be fully compatible with all industry NewGRFs.
STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT :The scaling factor for cargo production per month/production interval may optionally be multiplied by the economy speed reduction factor.
STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY :Monthly
STR_CONFIG_SETTING_CARGO_SCALE_MODE_GAME_TIME :Game-time
STR_CONFIG_SETTING_CARGO_SCALE_MODE_NORMAL :Normal
STR_CONFIG_SETTING_CARGO_SCALE_MODE_ECON_SPEED_REDUCTION_MULT :Multiply by economy speed reduction factor
STR_CONFIG_SETTING_CARGO_SCALE_MODE_PER_PRODUCTION_INTERVAL :Per production interval
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY :{NUM}% (monthly)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME :{NUM}% (game-time)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL :{NUM}% (per production interval)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_ECON_SPEED_REDUCTION_MULT :{NUM}% x economy speed reduction factor
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT :No towns above height level: {STRING2}
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT_HELPTEXT :No towns above the specified height level are built during map creation.

View File

@ -547,17 +547,6 @@ STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE :Intervalo de te
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE :Intervalo de tempo para o escalado da produción de carga da industria: {STRING}
STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT :Mensual: A produción de carga por mes é escalada.{}{}Tempo de xogo: A produción de carga por unidade de tempo de xogo é escalada (a produción de carga por mes tamén é escalada polo factor de lonxitude do día). Pode non ser posible alcanzar factores de escalado moi altos.
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE_HELPTEXT_EXTRA :{STRING}{}O modo de tempo de xogo non se garante que sexa totalmente compatible con todos os NewGRFs de industria.
STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY :Mensualmente
STR_CONFIG_SETTING_CARGO_SCALE_MODE_GAME_TIME :Tempo de xogo
STR_CONFIG_SETTING_CARGO_SCALE_MODE_PER_PRODUCTION_INTERVAL :Por intervalo de produción
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY :{NUM}% (mensualmente)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME :{NUM}% (tempo de xogo)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL :{NUM}% (por intervalo de produción)
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT :Sen vilas por enriba da altitude: {STRING}
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT_HELPTEXT :Non se constrúen vilas por enriba da altitude especificada durante a creación do mapa.

View File

@ -547,17 +547,6 @@ STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE :도시 화물
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE :산업시설 화물 생성 조정에 적용할 시간 간격: {STRING}
STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT :월별: 1개월당 화물 생산량이 조정됩니다.{}{}게임 시간: 게임 시간의 단위 당 화물 생산량이 조정됩니다. (또한 1개월당 화물 생산량은 1일의 길이 조절 설정에 의해 조정되기도 합니다.) 매우 높은 값은 적용되지 않을 수도 있습니다.
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE_HELPTEXT_EXTRA :{STRING}{}게임 시간 모드는 모든 산업시설 관련 NewGRF에 적용되지 않을 수도 있습니다.
STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY :월별
STR_CONFIG_SETTING_CARGO_SCALE_MODE_GAME_TIME :게임 시간
STR_CONFIG_SETTING_CARGO_SCALE_MODE_PER_PRODUCTION_INTERVAL :생산기간 당
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY :{NUM}% (월별)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME :{NUM}% (게임 시간)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL :{NUM}% (생산기간당)
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT :이 고도 위에는 도시를 생성하지 않음: {STRING}
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT_HELPTEXT :지도를 생성할 때 특정 고도 위에는 도시를 만들지 않도록 만듭니다.

View File

@ -547,17 +547,6 @@ STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE :Временн
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE :Временной интервал для умножения производства грузов предприятиями: {STRING}
STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT :Ежемесячно/каждый производственный интервал: производство груза за месяц или производственный интервал изменяется.{}{}Игровое время: производство груза за единицу игрового времени изменяется, (производство груза за месяц или производственный интервал также изменяется коэффициентом уменьшения скорости экономики). Очень высокие коэффициенты умножения могут быть недостижимы.
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE_HELPTEXT_EXTRA :{STRING}{}Не гарантируется, что режим игрового времени будет полностью совместим со всеми NewGRF предприятиями.
STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY :Ежемесячно
STR_CONFIG_SETTING_CARGO_SCALE_MODE_GAME_TIME :Игровое время
STR_CONFIG_SETTING_CARGO_SCALE_MODE_PER_PRODUCTION_INTERVAL :Каждый производственный интервал
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY :{NUM}% (ежемесячно)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME :{NUM}% (игровое время)
STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL :{NUM}% (каждый производственный интервал)
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT :Никаких городов выше уровня: {STRING}
STR_CONFIG_SETTING_TOWN_ABOVE_HEIGHT_HELPTEXT :Во время создания карты не строятся города выше указанного уровня высоты.

View File

@ -4063,7 +4063,7 @@ bool AfterLoadGame()
_settings_game.economy.town_cargo_scale = ScaleQuantity(100, _settings_game.old_economy.town_cargo_scale_factor);
}
if (!SlXvIsFeaturePresent(XSLFI_TOWN_CARGO_ADJ, 3)) {
_settings_game.economy.town_cargo_scale_mode = CSM_MONTHLY;
_settings_game.economy.town_cargo_scale_mode = CSM_NORMAL;
}
if (SlXvIsFeatureMissing(XSLFI_INDUSTRY_CARGO_ADJ)) {
@ -4072,7 +4072,7 @@ bool AfterLoadGame()
_settings_game.economy.industry_cargo_scale = ScaleQuantity(100, _settings_game.old_economy.industry_cargo_scale_factor);
}
if (!SlXvIsFeaturePresent(XSLFI_INDUSTRY_CARGO_ADJ, 2)) {
_settings_game.economy.industry_cargo_scale_mode = CSM_MONTHLY;
_settings_game.economy.industry_cargo_scale_mode = CSM_NORMAL;
}
}

View File

@ -40,7 +40,7 @@ struct CargoScalingProxy {
CargoScalingMode mode = this->is_industry ? _settings_game.economy.industry_cargo_scale_mode : _settings_game.economy.town_cargo_scale_mode;
if (mode == CSM_DAYLENGTH) {
/* Asynchronous free command, don't bother halting the script or saving the result */
::DoCommandPScript(0, 0, (uint32_t)CSM_MONTHLY, 0, CMD_CHANGE_SETTING, nullptr,
::DoCommandPScript(0, 0, (uint32_t)CSM_NORMAL, 0, CMD_CHANGE_SETTING, nullptr,
this->is_industry ? "economy.industry_cargo_scale_mode" : "economy.town_cargo_scale_mode", false, false, true, nullptr);
}

View File

@ -2340,12 +2340,8 @@ static bool TownCargoScaleGUI(SettingOnGuiCtrlData &data)
{
switch (data.type) {
case SOGCT_VALUE_DPARAMS:
if (GetGameSettings().economy.day_length_factor > 1) {
if (GetGameSettings().economy.town_cargo_scale_mode == CSM_DAYLENGTH) {
SetDParam(data.offset, STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME);
} else {
SetDParam(data.offset, EconTime::UsingWallclockUnits(_game_mode == GM_MENU) ? STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL : STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY);
}
if (GetGameSettings().economy.day_length_factor > 1 && GetGameSettings().economy.town_cargo_scale_mode == CSM_DAYLENGTH) {
SetDParam(data.offset, STR_CONFIG_SETTING_CARGO_SCALE_VALUE_ECON_SPEED_REDUCTION_MULT);
}
return true;
@ -2363,12 +2359,8 @@ static bool IndustryCargoScaleGUI(SettingOnGuiCtrlData &data)
return true;
case SOGCT_VALUE_DPARAMS:
if (GetGameSettings().economy.day_length_factor > 1) {
if (GetGameSettings().economy.industry_cargo_scale_mode == CSM_DAYLENGTH) {
SetDParam(data.offset, STR_CONFIG_SETTING_CARGO_SCALE_VALUE_REAL_TIME);
} else {
SetDParam(data.offset, EconTime::UsingWallclockUnits(_game_mode == GM_MENU) ? STR_CONFIG_SETTING_CARGO_SCALE_VALUE_PER_PRODUCTION_INTERVAL : STR_CONFIG_SETTING_CARGO_SCALE_VALUE_MONTHLY);
}
if (GetGameSettings().economy.day_length_factor > 1 && GetGameSettings().economy.industry_cargo_scale_mode == CSM_DAYLENGTH) {
SetDParam(data.offset, STR_CONFIG_SETTING_CARGO_SCALE_VALUE_ECON_SPEED_REDUCTION_MULT);
}
return true;
@ -2377,33 +2369,6 @@ static bool IndustryCargoScaleGUI(SettingOnGuiCtrlData &data)
}
}
static bool TownCargoScaleModeGUI(SettingOnGuiCtrlData &data)
{
switch (data.type) {
case SOGCT_VALUE_DPARAMS:
if (data.text == STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY && EconTime::UsingWallclockUnits(_game_mode == GM_MENU)) {
data.text = STR_CONFIG_SETTING_CARGO_SCALE_MODE_PER_PRODUCTION_INTERVAL;
}
return true;
default:
return false;
}
}
static bool IndustryCargoScaleModeGUI(SettingOnGuiCtrlData &data)
{
switch (data.type) {
case SOGCT_DESCRIPTION_TEXT:
SetDParam(0, data.text);
data.text = STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE_HELPTEXT_EXTRA;
return true;
default:
return TownCargoScaleModeGUI(data);
}
}
static bool CalendarModeDisabledGUI(SettingOnGuiCtrlData &data)
{
switch (data.type) {

View File

@ -25,8 +25,6 @@ static void TownZoneCustomValueChanged(int32_t new_value);
static bool OrderTownGrowthRate(SettingOnGuiCtrlData &data);
static bool TownCargoScaleGUI(SettingOnGuiCtrlData &data);
static bool IndustryCargoScaleGUI(SettingOnGuiCtrlData &data);
static bool TownCargoScaleModeGUI(SettingOnGuiCtrlData &data);
static bool IndustryCargoScaleModeGUI(SettingOnGuiCtrlData &data);
static bool CalendarModeDisabledGUI(SettingOnGuiCtrlData &data);
static bool WallclockModeDisabledGUI(SettingOnGuiCtrlData &data);
@ -794,31 +792,29 @@ guiproc = IndustryCargoScaleGUI
var = economy.town_cargo_scale_mode
type = SLE_UINT8
flags = SF_GUI_DROPDOWN | SF_PATCH
def = CSM_MONTHLY
def = CSM_NORMAL
min = CSM_BEGIN
max = CSM_END - 1
interval = 1
str = STR_CONFIG_SETTING_TOWN_CARGO_SCALE_MODE
strhelp = STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT
strval = STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY
strval = STR_CONFIG_SETTING_CARGO_SCALE_MODE_NORMAL
cat = SC_BASIC
post_cb = [](auto) { InvalidateWindowClassesData(WC_GAME_OPTIONS); UpdateCargoScalers(); }
guiproc = TownCargoScaleModeGUI
[SDT_VAR]
var = economy.industry_cargo_scale_mode
type = SLE_UINT8
flags = SF_GUI_DROPDOWN | SF_PATCH
def = CSM_MONTHLY
def = CSM_NORMAL
min = CSM_BEGIN
max = CSM_END - 1
interval = 1
str = STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_MODE
strhelp = STR_CONFIG_SETTING_CARGO_SCALE_MODE_HELPTEXT
strval = STR_CONFIG_SETTING_CARGO_SCALE_MODE_MONTHLY
strval = STR_CONFIG_SETTING_CARGO_SCALE_MODE_NORMAL
cat = SC_BASIC
post_cb = [](auto) { InvalidateWindowClassesData(WC_GAME_OPTIONS); UpdateCargoScalers(); }
guiproc = IndustryCargoScaleModeGUI
[SDT_VAR]
var = economy.random_road_reconstruction