diff options
author | dominik <dominik@openttd.org> | 2005-01-08 20:55:21 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2005-01-08 20:55:21 +0000 |
commit | bfc670b4d98cde9a6e397769e259b43381bb7089 (patch) | |
tree | 36cb008fcecb4e0072ca91647b8df5307f614a82 | |
parent | 4b6a846d9cfc3619a4477bbfa8bca9bbe2c5baa1 (diff) | |
download | openttd-bfc670b4d98cde9a6e397769e259b43381bb7089.tar.xz |
(svn r1435) Fix: [ 1094092 ] Toolbars accessible via keyboard in spectator mode
-rw-r--r-- | airport_gui.c | 1 | ||||
-rw-r--r-- | dock_gui.c | 1 | ||||
-rw-r--r-- | rail_gui.c | 2 | ||||
-rw-r--r-- | road_gui.c | 1 | ||||
-rw-r--r-- | terraform_gui.c | 1 |
5 files changed, 6 insertions, 0 deletions
diff --git a/airport_gui.c b/airport_gui.c index d0194c529..b38e19057 100644 --- a/airport_gui.c +++ b/airport_gui.c @@ -126,6 +126,7 @@ static const WindowDesc _air_toolbar_desc = { void ShowBuildAirToolbar() { + if (_current_player == OWNER_SPECTATOR) return; DeleteWindowById(WC_BUILD_TOOLBAR, 0); AllocateWindowDescFront(&_air_toolbar_desc, 0); } diff --git a/dock_gui.c b/dock_gui.c index f7fd23af4..d84547635 100644 --- a/dock_gui.c +++ b/dock_gui.c @@ -204,6 +204,7 @@ static const WindowDesc _build_docks_toolbar_desc = { void ShowBuildDocksToolbar() { + if (_current_player == OWNER_SPECTATOR) return; DeleteWindowById(WC_BUILD_TOOLBAR, 0); AllocateWindowDesc(&_build_docks_toolbar_desc); } diff --git a/rail_gui.c b/rail_gui.c index 7958f9f82..34900d604 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -803,6 +803,8 @@ void ShowBuildRailToolbar(int index, int button) { Window *w; + if (_current_player == OWNER_SPECTATOR) return; + // don't recreate the window if we're clicking on a button and the window exists. if (button < 0 || !(w = FindWindowById(WC_BUILD_TOOLBAR, 0)) || w->wndproc != BuildRailToolbWndProc) { DeleteWindowById(WC_BUILD_TOOLBAR, 0); diff --git a/road_gui.c b/road_gui.c index c87b692a2..263acb168 100644 --- a/road_gui.c +++ b/road_gui.c @@ -304,6 +304,7 @@ static const WindowDesc _build_road_desc = { void ShowBuildRoadToolbar() { + if (_current_player == OWNER_SPECTATOR) return; DeleteWindowById(WC_BUILD_TOOLBAR, 0); AllocateWindowDesc(&_build_road_desc); } diff --git a/terraform_gui.c b/terraform_gui.c index 661815779..90773869e 100644 --- a/terraform_gui.c +++ b/terraform_gui.c @@ -211,5 +211,6 @@ static const WindowDesc _terraform_desc = { void ShowTerraformToolbar() { + if (_current_player == OWNER_SPECTATOR) return; AllocateWindowDescFront(&_terraform_desc, 0); } |