summaryrefslogtreecommitdiff
path: root/src/airport_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-02-22 15:26:27 +0000
committerfrosch <frosch@openttd.org>2015-02-22 15:26:27 +0000
commitc639fb0d8eb0371a95c39027a986636f1ca8f764 (patch)
tree65de5e1182f4e5f05a6bd7394e4b71a57a783a32 /src/airport_gui.cpp
parentf26e9bf59dd953ab76bf816ba7aad87638c22c21 (diff)
downloadopenttd-c639fb0d8eb0371a95c39027a986636f1ca8f764.tar.xz
(svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88)
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r--src/airport_gui.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index 29a0d83ad..6437f236c 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -82,6 +82,18 @@ struct BuildAirToolbarWindow : Window {
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}
+ /**
+ * Some data on this window has become invalid.
+ * @param data Information about the changed data.
+ * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
+ */
+ virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
+ {
+ if (!gui_scope) return;
+
+ if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) delete this;
+ }
+
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (widget) {