diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index aa56b3d83..495f1361f 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -322,6 +322,15 @@ struct AISettingsWindow : public Window { switch (widget) { case WID_AIS_CAPTION: SetDParam(0, (this->slot == OWNER_DEITY) ? STR_AI_SETTINGS_CAPTION_GAMESCRIPT : STR_AI_SETTINGS_CAPTION_AI); + + StringID text; + if (GetConfig(this->slot)->GetInfo() != NULL) { + SetDParamStr(2, GetConfig(this->slot)->GetInfo()->GetName()); + text = STR_JUST_RAW_STRING; + } else { + text = (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI; + } + SetDParam(1, text); break; } } @@ -629,7 +638,7 @@ static WindowDesc _ai_settings_desc( static void ShowAISettingsWindow(CompanyID slot) { DeleteWindowByClass(WC_AI_LIST); - DeleteWindowByClass(WC_AI_SETTINGS); + DeleteWindowById(WC_AI_SETTINGS, slot); new AISettingsWindow(&_ai_settings_desc, slot); } diff --git a/src/lang/english.txt b/src/lang/english.txt index 83406296c..0922697cf 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4095,7 +4095,7 @@ STR_AI_LIST_CANCEL :{BLACK}Cancel STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}Don't change the script # AI Parameters -STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parameters +STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parameters of {STRING1} STR_AI_SETTINGS_CAPTION_AI :AI STR_AI_SETTINGS_CAPTION_GAMESCRIPT :Game Script STR_AI_SETTINGS_CLOSE :{BLACK}Close