mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r1435) Fix: [ 1094092 ] Toolbars accessible via keyboard in spectator mode
This commit is contained in:
parent
4b6a846d9c
commit
bfc670b4d9
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -211,5 +211,6 @@ static const WindowDesc _terraform_desc = {
|
||||
|
||||
void ShowTerraformToolbar()
|
||||
{
|
||||
if (_current_player == OWNER_SPECTATOR) return;
|
||||
AllocateWindowDescFront(&_terraform_desc, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user