diff options
Diffstat (limited to 'src/ai/ai_gui.cpp')
-rw-r--r-- | src/ai/ai_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index dd1de4dc2..101a97d0a 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -306,7 +306,6 @@ struct AISettingsWindow : public Window { timeout(0) { this->ai_config = GetConfig(slot); - this->RebuildVisibleSettings(); this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_AIS_SCROLLBAR); @@ -314,7 +313,7 @@ struct AISettingsWindow : public Window { this->SetWidgetDisabledState(WID_AIS_RESET, _game_mode != GM_MENU && Company::IsValidID(this->slot)); - this->vscroll->SetCount((int)this->visible_settings.size()); + this->RebuildVisibleSettings(); } virtual void SetStringParameters(int widget) const @@ -342,6 +341,8 @@ struct AISettingsWindow : public Window { visible_settings.push_back(&(*it)); } } + + this->vscroll->SetCount((int)this->visible_settings.size()); } virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) |