From 86eae807be8d93680e0adcb92fea2cc4d80972d6 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 12 Mar 2017 18:19:01 +0000 Subject: (svn r27787) -Fix: Update scrollbar when rebuilding AI/GS setting list. --- src/ai/ai_gui.cpp | 5 +++-- 1 file 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) -- cgit v1.2.3-70-g09d2