(svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88)

This commit is contained in:
frosch
2015-02-22 15:26:27 +00:00
parent 8d04567343
commit 6cb930168f
6 changed files with 51 additions and 6 deletions

View File

@@ -434,6 +434,18 @@ struct BuildRailToolbarWindow : 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_TRAIN)) delete this;
}
/**
* Configures the rail toolbar for railtype given
* @param railtype the railtype to display