From b65a9eb85629006336e16db707bbc2a8a84c8593 Mon Sep 17 00:00:00 2001 From: yexo Date: Sat, 31 Jul 2010 21:24:59 +0000 Subject: (svn r20268) -Add: append 'On'/'Off' after the name for boolean NewGRF settings --- src/newgrf_gui.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2