mirror of https://github.com/OpenTTD/OpenTTD
Add: Show version selected in the AI/GS slots as well
parent
6ee9712d49
commit
ae7903e71f
|
@ -169,8 +169,11 @@ struct AIConfigWindow : public Window {
|
||||||
std::string GetSlotText(CompanyID cid) const
|
std::string GetSlotText(CompanyID cid) const
|
||||||
{
|
{
|
||||||
if ((_game_mode != GM_NORMAL && cid == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(cid))) return GetString(STR_AI_CONFIG_HUMAN_PLAYER);
|
if ((_game_mode != GM_NORMAL && cid == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(cid))) return GetString(STR_AI_CONFIG_HUMAN_PLAYER);
|
||||||
if (const AIInfo *info = AIConfig::GetConfig(cid)->GetInfo(); info != nullptr) return info->GetName();
|
const AIConfig *config = AIConfig::GetConfig(cid);
|
||||||
return GetString(STR_AI_CONFIG_RANDOM_AI);
|
const AIInfo *info = config->GetInfo();
|
||||||
|
if (info == nullptr) return GetString(STR_AI_CONFIG_RANDOM_AI);
|
||||||
|
if (config->GetForceExactMatch()) return GetString(STR_AI_CONFIG_NAME_VERSION, info->GetName(), info->GetVersion());
|
||||||
|
return info->GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -167,8 +167,11 @@ struct GSConfigWindow : public Window {
|
||||||
*/
|
*/
|
||||||
std::string GetText() const
|
std::string GetText() const
|
||||||
{
|
{
|
||||||
if (const GameInfo *info = GameConfig::GetConfig()->GetInfo(); info != nullptr) return info->GetName();
|
const GameConfig *config = GameConfig::GetConfig();
|
||||||
return GetString(STR_AI_CONFIG_NONE);
|
const GameInfo *info = config->GetInfo();
|
||||||
|
if (info == nullptr) return GetString(STR_AI_CONFIG_NONE);
|
||||||
|
if (config->GetForceExactMatch()) return GetString(STR_AI_CONFIG_NAME_VERSION, info->GetName(), info->GetVersion());
|
||||||
|
return info->GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||||
|
|
Loading…
Reference in New Issue