mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r24210) -Feature: Split the renew-months setting text in two string values (one before life time and one after).
This commit is contained in:
parent
8c585e5ad6
commit
88224d001d
@ -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_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_NEVER_EXPIRE_VEHICLES :Vehicles never expire: {STRING2}
|
||||||
STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Autorenew vehicle when it gets old: {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_AUTORENEW_MONEY :Autorenew minimum needed money for renew: {STRING2}
|
||||||
STR_CONFIG_SETTING_ERRMSG_DURATION :Duration of error message: {STRING2}
|
STR_CONFIG_SETTING_ERRMSG_DURATION :Duration of error message: {STRING2}
|
||||||
STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE :{COMMA} second{P 0 "" s}
|
STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE :{COMMA} second{P 0 "" s}
|
||||||
|
@ -1289,6 +1289,9 @@ void SettingEntry::DrawSetting(GameSettings *settings_ptr, const SettingDesc *sd
|
|||||||
|
|
||||||
if ((sdb->flags & SGF_MULTISTRING) != 0) {
|
if ((sdb->flags & SGF_MULTISTRING) != 0) {
|
||||||
SetDParam(1, sdb->val_str - sdb->min + value);
|
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 {
|
} else {
|
||||||
SetDParam(1, sdb->val_str + ((value == 0 && (sdb->flags & SGF_0ISDISABLED) != 0) ? 1 : 0));
|
SetDParam(1, sdb->val_str + ((value == 0 && (sdb->flags & SGF_0ISDISABLED) != 0) ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ enum SettingGuiFlagLong {
|
|||||||
* Flags directing saving/loading of a variable */
|
* Flags directing saving/loading of a variable */
|
||||||
SGF_NONE = 0,
|
SGF_NONE = 0,
|
||||||
SGF_0ISDISABLED = 1 << 0, ///< a value of zero means the feature is disabled
|
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_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_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
|
SGF_CURRENCY = 1 << 4, ///< the number represents money, so when reading value multiply by exchange rate
|
||||||
|
@ -41,11 +41,12 @@ str = STR_CONFIG_SETTING_AUTORENEW_VEHICLE
|
|||||||
base = CompanySettings
|
base = CompanySettings
|
||||||
var = engine_renew_months
|
var = engine_renew_months
|
||||||
type = SLE_INT16
|
type = SLE_INT16
|
||||||
|
guiflags = SGF_PER_COMPANY | SGF_DISPLAY_ABS
|
||||||
def = 6
|
def = 6
|
||||||
min = -12
|
min = -12
|
||||||
max = 12
|
max = 12
|
||||||
str = STR_CONFIG_SETTING_AUTORENEW_MONTHS
|
str = STR_CONFIG_SETTING_AUTORENEW_MONTHS
|
||||||
strval = STR_JUST_COMMA
|
strval = STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALUE_BEFORE
|
||||||
|
|
||||||
[SDT_VAR]
|
[SDT_VAR]
|
||||||
base = CompanySettings
|
base = CompanySettings
|
||||||
|
Loading…
Reference in New Issue
Block a user