| 804 | } |
| 805 | |
| 806 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 807 | { |
| 808 | if (widget != WID_SCRD_NAME_TEXT) return this->Window::GetWidgetString(widget, stringid); |
| 809 | |
| 810 | if (this->filter.script_debug_company == OWNER_DEITY) { |
| 811 | const GameInfo *info = Game::GetInfo(); |
| 812 | assert(info != nullptr); |
| 813 | return GetString(STR_AI_DEBUG_NAME_AND_VERSION, info->GetName(), info->GetVersion()); |
| 814 | } |
| 815 | if (this->filter.script_debug_company == CompanyID::Invalid() || !Company::IsValidAiID(this->filter.script_debug_company)) { |
| 816 | return {}; |
| 817 | } |
| 818 | |
| 819 | const AIInfo *info = Company::Get(this->filter.script_debug_company)->ai_info; |
| 820 | return GetString(STR_AI_DEBUG_NAME_AND_VERSION, info->GetName(), info->GetVersion()); |
| 821 | } |
| 822 | |
| 823 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 824 | { |
nothing calls this directly
no test coverage detected