From 7e5309a28a530d1c534dfee837d83469a1be0ea2 Mon Sep 17 00:00:00 2001 From: frosch Date: Fri, 13 Aug 2010 07:34:28 +0000 Subject: (svn r20479) -Change: Use 'Buttons Name: Value' layout for AI and NewGRF parameter GUI. --- src/ai/ai_gui.cpp | 19 ++++++++++--------- src/ai/ai_info.cpp | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/ai') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 5d7e5f3bd..3cf882451 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -294,10 +294,8 @@ struct AISettingsWindow : public Window { bool rtl = _dynlang.text_dir == TD_RTL; uint buttons_left = rtl ? r.right - 23 : r.left + 4; - uint value_left = r.left + (rtl ? WD_FRAMERECT_LEFT : 28); - uint value_right = r.right - (rtl ? 28 : WD_FRAMERECT_RIGHT); - uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : 54); - uint text_right = r.right - (rtl ? 54 : WD_FRAMERECT_RIGHT); + uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : 28); + uint text_right = r.right - (rtl ? 28 : WD_FRAMERECT_RIGHT); int y = r.top; @@ -305,20 +303,23 @@ struct AISettingsWindow : public Window { int current_value = config->GetSetting((*it).name); bool editable = (_game_mode == GM_MENU) || ((it->flags & AICONFIG_INGAME) != 0); - uint x = rtl ? r.right : r.left; + SetDParamStr(0, (*it).description); + if (((*it).flags & AICONFIG_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); + SetDParam(1, 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 > (*it).min_value, editable && current_value < (*it).max_value); if (it->labels != NULL && it->labels->Find(current_value) != it->labels->End()) { - x = DrawString(value_left, value_right, y + WD_MATRIX_TOP, it->labels->Find(current_value)->second, TC_ORANGE); + SetDParam(1, STR_JUST_RAW_STRING); + SetDParamStr(2, it->labels->Find(current_value)->second); } else { - SetDParam(0, current_value); - x = DrawString(value_left, value_right, y + WD_MATRIX_TOP, STR_JUST_INT, TC_ORANGE); + SetDParam(1, STR_JUST_INT); + SetDParam(2, current_value); } } - DrawString(max(rtl ? 0U : x + 3, text_left), min(rtl ? x - 3 : r.right, text_right), y + WD_MATRIX_TOP, (*it).description, TC_LIGHT_BLUE); + DrawString(text_left, text_right, y + WD_MATRIX_TOP, STR_AI_SETTINGS_SETTING, TC_LIGHT_BLUE); y += this->line_height; } } diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 5ccd934fd..8ee4d4499 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -24,7 +24,7 @@ /** Configuration for AI start date, every AI has this setting. */ AIConfigItem _start_date_config = { "start_date", - "The amount of days after the start of the last AI, this AI will start (give or take).", + "Number of days to start this AI after the previous one (give or take)", AI::START_NEXT_MIN, AI::START_NEXT_MAX, AI::START_NEXT_MEDIUM, -- cgit v1.2.3-70-g09d2