summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-27 14:15:48 +0000
committerrubidium <rubidium@openttd.org>2007-06-27 14:15:48 +0000
commit1cff4725010b20d39cbf5781dd3251112a004e8c (patch)
treeeaa49e95c6bd9507f25d0920157782b69f1e373f /src/dock_gui.cpp
parentf603383eb9a11b6b951910933fcab305c6c1fe68 (diff)
downloadopenttd-1cff4725010b20d39cbf5781dd3251112a004e8c.tar.xz
(svn r10353) -Fix/Feature [FS#669]: disallow (in the GUI) the building of infrastructure you do not have available vehicles for. This means that the airport building button is disabled till you can actually build aircraft. The game itself will not disallow you to build the infrastructure and this "new" behaviour can be overriden with a patch setting.
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index aad7bae54..2e608af55 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -94,16 +94,19 @@ static void BuildDocksClick_Demolish(Window *w)
static void BuildDocksClick_Depot(Window *w)
{
+ if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return;
if (HandlePlacePushButton(w, DTW_DEPOT, SPR_CURSOR_SHIP_DEPOT, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker();
}
static void BuildDocksClick_Dock(Window *w)
{
+ if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return;
if (HandlePlacePushButton(w, DTW_STATION, SPR_CURSOR_DOCK, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker();
}
static void BuildDocksClick_Buoy(Window *w)
{
+ if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return;
HandlePlacePushButton(w, DTW_BUOY, SPR_CURSOR_BOUY, 1, PlaceDocks_Buoy);
}
@@ -124,6 +127,7 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_PAINT:
DrawWindowWidgets(w);
+ SetWindowWidgetsDisabledState(w, !CanBuildVehicleInfrastructure(VEH_SHIP), 7, 8, 9, WIDGET_LIST_END);
break;
case WE_CLICK: