diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 56e0495424..03b2c4c734 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2258,8 +2258,13 @@ struct GameSettingsWindow : Window { if (sd->desc.flags & SGF_CURRENCY) value *= _currency->rate; this->valuewindow_entry = pe; - SetDParam(0, value); - ShowQueryString(STR_JUST_INT, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL, QSF_ENABLE_DEFAULT); + if (sd->desc.flags & SGF_DECIMAL1) { + SetDParam(0, value); + ShowQueryString(STR_JUST_DECIMAL1, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL_DECIMAL, QSF_ENABLE_DEFAULT); + } else { + SetDParam(0, value); + ShowQueryString(STR_JUST_INT, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL, QSF_ENABLE_DEFAULT); + } } this->SetDisplayedHelpText(pe); } @@ -2284,7 +2289,11 @@ struct GameSettingsWindow : Window { int32 value; if (!StrEmpty(str)) { - value = atoi(str); + if (sd->desc.flags & SGF_DECIMAL1) { + value = atof(str) * 10; + } else { + value = atoi(str); + } /* Save the correct currency-translated value */ if (sd->desc.flags & SGF_CURRENCY) value /= _currency->rate; diff --git a/src/settings_internal.h b/src/settings_internal.h index 2f0021392f..6aa3ee5067 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -48,6 +48,7 @@ enum SettingGuiFlagLong { SGF_NEWGAME_ONLY = 1 << 6, ///< this setting cannot be changed in a game SGF_SCENEDIT_TOO = 1 << 7, ///< this setting can be changed in the scenario editor (only makes sense when SGF_NEWGAME_ONLY is set) SGF_PER_COMPANY = 1 << 8, ///< this setting can be different for each company (saved in company struct) + SGF_DECIMAL1 = 1 << 9, ///< display a decimal representation of the setting value divided by 10 }; DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong) typedef SimpleTinyEnumT SettingGuiFlag;