summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2017-03-12 18:19:01 +0000
committerpeter1138 <peter1138@openttd.org>2017-03-12 18:19:01 +0000
commit86eae807be8d93680e0adcb92fea2cc4d80972d6 (patch)
tree466cdd9e8db56548436d18473209feefc78ebcee
parentc55f586df8ea121ee02f4d7a8e3d9aec6aaabec0 (diff)
downloadopenttd-86eae807be8d93680e0adcb92fea2cc4d80972d6.tar.xz
(svn r27787) -Fix: Update scrollbar when rebuilding AI/GS setting list.
-rw-r--r--src/ai/ai_gui.cpp5
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)