Fixed build tools leaving random uncloseable station dialogs

This commit is contained in:
Sergii Pylypenko
2016-07-01 22:49:23 +03:00
parent 1d04aef406
commit 7a0d500529
4 changed files with 3 additions and 6 deletions

View File

@@ -288,7 +288,7 @@ struct BuildDocksToolbarWindow : Window {
MoveAllHiddenWindowsBackToScreen();
this->RaiseButtons();
if (ConfirmationWindowShown()) return;
if (ConfirmationWindowShown() && _ctrl_pressed) return;
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_WATER);
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_WATER);
DeleteWindowById(WC_SELECT_STATION, 0);

View File

@@ -771,7 +771,7 @@ struct BuildRailToolbarWindow : Window {
this->DisableWidget(WID_RAT_REMOVE);
this->SetWidgetDirty(WID_RAT_REMOVE);
if (ConfirmationWindowShown()) return;
if (ConfirmationWindowShown() && (this->last_user_action == WID_RAT_BUILD_BRIDGE || _ctrl_pressed)) return;
DeleteWindowById(WC_BUILD_SIGNAL, TRANSPORT_RAIL);
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_RAIL);
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_RAIL);
@@ -935,7 +935,6 @@ static void HandleStationPlacement(TileIndex start, TileIndex end)
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" };
printf("Rail station ctrl pressed %d\n", _ctrl_pressed);
ShowSelectStationIfNeeded(cmdcont, ta);
}

View File

@@ -547,7 +547,7 @@ struct BuildRoadToolbarWindow : Window {
this->SetWidgetDirty(WID_ROT_REMOVE);
this->SetWidgetDirty(WID_ROT_ONE_WAY);
if (ConfirmationWindowShown()) return;
if (ConfirmationWindowShown() && (this->last_started_action == WID_ROT_BUILD_BRIDGE || _ctrl_pressed)) return;
DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);