(svn r23757) -Codechange: Unify the drawing of toggle buttons for boolean settings.

This commit is contained in:
frosch
2012-01-05 19:32:51 +00:00
parent 2fb393fcd0
commit 69e197c87f
5 changed files with 18 additions and 5 deletions

View File

@@ -247,7 +247,7 @@ struct NewGRFParametersWindow : public Window {
bool selected = (i == this->clicked_row);
if (par_info->type == PTYPE_BOOL) {
DrawFrameRect(buttons_left, y + 2, buttons_left + 19, y + 10, (current_value != 0) ? COLOUR_GREEN : COLOUR_RED, (current_value != 0) ? FR_LOWERED : FR_NONE);
DrawBoolButton(buttons_left, y + 2, current_value != 0, true);
SetDParam(2, par_info->GetValue(this->grf_config) == 0 ? STR_CONFIG_SETTING_OFF : STR_CONFIG_SETTING_ON);
} else if (par_info->type == PTYPE_UINT_ENUM) {
DrawArrowButtons(buttons_left, y + 2, COLOUR_YELLOW, (this->clicked_button == i) ? 1 + (this->clicked_increase != rtl) : 0, current_value > par_info->min_value, current_value < par_info->max_value);