Index: src/ai/ai_gui.cpp =================================================================== --- src/ai/ai_gui.cpp (revision 27548) +++ src/ai/ai_gui.cpp (working copy) @@ -685,7 +685,10 @@ EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP), - NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP), + NWidget(NWID_SELECTION, INVALID_COLOUR, WID_AIC_SELECT_CONFIGURE), + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_SETTINGS), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_DEBUG_SETTINGS, STR_AI_DEBUG_SETTINGS_TOOLTIP), + EndContainer(), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7), @@ -751,6 +754,34 @@ break; } break; + case WID_AIC_CONFIGURE: + switch (selected_slot) { + case OWNER_DEITY: + SetDParam(0, _game_mode == GM_NORMAL ? IsEditable(this->selected_slot) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE : STR_AI_CONFIG_CONFIGURE); + break; + + case INVALID_COMPANY: + SetDParam(0, STR_AI_CONFIG_CONFIGURE); + break; + + default: + SetDParam(0, (_game_mode == GM_NORMAL && IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead()) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE); + break; + } + case WID_AIC_SETTINGS: + switch (selected_slot) { + case OWNER_DEITY: + SetDParam(0, _game_mode == GM_NORMAL ? IsEditable(this->selected_slot) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE : STR_AI_CONFIG_CONFIGURE); + break; + + case INVALID_COMPANY: + SetDParam(0, STR_AI_DEBUG_SETTINGS); + break; + + default: + SetDParam(0, (_game_mode == GM_NORMAL && IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead()) ? STR_AI_DEBUG_SETTINGS : STR_AI_CONFIG_CONFIGURE); + break; + } } } Index: src/widgets/ai_widget.h =================================================================== --- src/widgets/ai_widget.h (revision 27548) +++ src/widgets/ai_widget.h (working copy) @@ -46,7 +46,11 @@ WID_AIC_MOVE_UP, ///< Move up button. WID_AIC_MOVE_DOWN, ///< Move down button. WID_AIC_CHANGE, ///< Select another AI button. - WID_AIC_CONFIGURE, ///< Change AI settings button. + + WID_AIC_SELECT_CONFIGURE, ///< Change AI settings button. + WID_AIC_CONFIGURE, ///< Configure button. + WID_AIC_SETTINGS, ///< Settings button. + WID_AIC_CLOSE, ///< Close window button. WID_AIC_TEXTFILE, ///< Open AI readme, changelog (+1) or license (+2). WID_AIC_CONTENT_DOWNLOAD = WID_AIC_TEXTFILE + TFT_END, ///< Download content button.