(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

@@ -384,7 +384,7 @@ struct AISettingsWindow : public Window {
}
if ((config_item.flags & SCRIPTCONFIG_BOOLEAN) != 0) {
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, editable);
SetDParam(idx++, current_value == 0 ? STR_CONFIG_SETTING_OFF : STR_CONFIG_SETTING_ON);
} else {
DrawArrowButtons(buttons_left, y + 2, COLOUR_YELLOW, (this->clicked_button == i) ? 1 + (this->clicked_increase != rtl) : 0, editable && current_value > config_item.min_value, editable && current_value < config_item.max_value);