From 88224d001d640eb6bf3f4a0215a63b44dbe34cb9 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 6 May 2012 15:03:45 +0000 Subject: (svn r24210) -Feature: Split the renew-months setting text in two string values (one before life time and one after). --- src/lang/english.txt | 4 +++- src/settings_gui.cpp | 3 +++ src/settings_internal.h | 1 + src/table/company_settings.ini | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lang/english.txt b/src/lang/english.txt index 2986e6f56..53904e266 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1185,7 +1185,9 @@ STR_CONFIG_SETTING_ORDER_REVIEW_ON :of all vehicles STR_CONFIG_SETTING_WARN_INCOME_LESS :Warn if a vehicle's income is negative: {STRING2} STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Vehicles never expire: {STRING2} STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Autorenew vehicle when it gets old: {STRING2} -STR_CONFIG_SETTING_AUTORENEW_MONTHS :Autorenew when vehicle is {STRING2} month{P 0:2 "" s} before/after max age +STR_CONFIG_SETTING_AUTORENEW_MONTHS :Autorenew when vehicle is {STRING2} max age +STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALUE_BEFORE :{COMMA} month{P 0 "" s} before +STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALUE_AFTER :{COMMA} month{P 0 "" s} after STR_CONFIG_SETTING_AUTORENEW_MONEY :Autorenew minimum needed money for renew: {STRING2} STR_CONFIG_SETTING_ERRMSG_DURATION :Duration of error message: {STRING2} STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE :{COMMA} second{P 0 "" s} diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index a0529b05d..dbf80d7a7 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1289,6 +1289,9 @@ void SettingEntry::DrawSetting(GameSettings *settings_ptr, const SettingDesc *sd if ((sdb->flags & SGF_MULTISTRING) != 0) { SetDParam(1, sdb->val_str - sdb->min + value); + } else if ((sdb->flags & SGF_DISPLAY_ABS) != 0) { + SetDParam(1, sdb->val_str + ((value >= 0) ? 1 : 0)); + value = abs(value); } else { SetDParam(1, sdb->val_str + ((value == 0 && (sdb->flags & SGF_0ISDISABLED) != 0) ? 1 : 0)); } diff --git a/src/settings_internal.h b/src/settings_internal.h index 587366f3d..b4f87f819 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -40,6 +40,7 @@ enum SettingGuiFlagLong { * Flags directing saving/loading of a variable */ SGF_NONE = 0, SGF_0ISDISABLED = 1 << 0, ///< a value of zero means the feature is disabled + SGF_DISPLAY_ABS = 1 << 1, ///< display absolute value of the setting SGF_MULTISTRING = 1 << 2, ///< the value represents a limited number of string-options (internally integer) SGF_NETWORK_ONLY = 1 << 3, ///< this setting only applies to network games SGF_CURRENCY = 1 << 4, ///< the number represents money, so when reading value multiply by exchange rate diff --git a/src/table/company_settings.ini b/src/table/company_settings.ini index e19004dd4..78d7579e5 100644 --- a/src/table/company_settings.ini +++ b/src/table/company_settings.ini @@ -41,11 +41,12 @@ str = STR_CONFIG_SETTING_AUTORENEW_VEHICLE base = CompanySettings var = engine_renew_months type = SLE_INT16 +guiflags = SGF_PER_COMPANY | SGF_DISPLAY_ABS def = 6 min = -12 max = 12 str = STR_CONFIG_SETTING_AUTORENEW_MONTHS -strval = STR_JUST_COMMA +strval = STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALUE_BEFORE [SDT_VAR] base = CompanySettings -- cgit v1.2.3-70-g09d2