diff options
author | yexo <yexo@openttd.org> | 2010-07-31 21:24:59 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-07-31 21:24:59 +0000 |
commit | b65a9eb85629006336e16db707bbc2a8a84c8593 (patch) | |
tree | 54fd4534f44ed2db6fa04ba60403ca26a67d86a6 /src | |
parent | a825b4fa5f159604f9f61bafa21b75a22d8944f5 (diff) | |
download | openttd-b65a9eb85629006336e16db707bbc2a8a84c8593.tar.xz |
(svn r20268) -Add: append 'On'/'Off' after the name for boolean NewGRF settings
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_gui.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 516b5dbda..32d683e8b 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -233,12 +233,20 @@ struct NewGRFParametersWindow : public Window { } } + int left = max(rtl ? 0U : x + 3, text_left); + int right = min(rtl ? x - 3 : r.right, text_right); const char *name = GetGRFStringFromGRFText(par_info->name); if (name != NULL) { - DrawString(max(rtl ? 0U : x + 3, text_left), min(rtl ? x - 3 : r.right, text_right), y + WD_MATRIX_TOP, name, selected ? TC_WHITE : TC_LIGHT_BLUE); + x = DrawString(left, right, y + WD_MATRIX_TOP, name, selected ? TC_WHITE : TC_LIGHT_BLUE); } else { SetDParam(0, i + 1); - DrawString(max(rtl ? 0U : x + 3, text_left), min(rtl ? x - 3 : r.right, text_right), y + WD_MATRIX_TOP, STR_NEWGRF_PARAMETERS_DEFAULT_NAME, selected ? TC_WHITE : TC_LIGHT_BLUE); + x = DrawString(left, right, y + WD_MATRIX_TOP, STR_NEWGRF_PARAMETERS_DEFAULT_NAME, selected ? TC_WHITE : TC_LIGHT_BLUE); + } + if (par_info->type == PTYPE_BOOL) { + left = max(rtl ? 0U : x + 3, text_left); + right = min(rtl ? x - 3 : r.right, text_right); + StringID str = par_info->GetValue(this->grf_config) == 0 ? STR_CONFIG_SETTING_OFF : STR_CONFIG_SETTING_ON; + DrawString(left, right, y + WD_MATRIX_TOP, str, selected ? TC_WHITE : TC_LIGHT_BLUE); } y += this->line_height; } |