Reset queued command when closing windows that can queue them.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "hotkeys.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "gui.h"
|
||||
#include "command_func.h"
|
||||
|
||||
#include "widgets/airport_widget.h"
|
||||
|
||||
@@ -142,7 +143,7 @@ struct BuildAirToolbarWindow : Window {
|
||||
|
||||
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_AIR);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
|
||||
EraseQueuedTouchCommand();
|
||||
ResetObjectToPlace();
|
||||
}
|
||||
|
||||
@@ -243,6 +244,7 @@ public:
|
||||
|
||||
virtual ~BuildAirportWindow()
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
|
||||
~BuildDocksToolbarWindow()
|
||||
{
|
||||
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
|
||||
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
||||
}
|
||||
|
||||
@@ -279,6 +280,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_WATER);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
DeleteWindowByClass(WC_BUILD_BRIDGE);
|
||||
EraseQueuedTouchCommand();
|
||||
}
|
||||
|
||||
virtual void OnPlacePresize(Point pt, TileIndex tile_from)
|
||||
@@ -551,6 +553,7 @@ public:
|
||||
this->LowerWidget(_ship_depot_direction + WID_BDD_X);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
UpdateDocksDirection();
|
||||
EraseQueuedTouchCommand();
|
||||
this->SetDirty();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
|
||||
~BuildRailToolbarWindow()
|
||||
{
|
||||
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
|
||||
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
||||
}
|
||||
|
||||
@@ -754,6 +755,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
DeleteWindowById(WC_BUILD_WAYPOINT, TRANSPORT_RAIL);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
DeleteWindowByClass(WC_BUILD_BRIDGE);
|
||||
EraseQueuedTouchCommand();
|
||||
}
|
||||
|
||||
virtual void OnPlacePresize(Point pt, TileIndex tile_from)
|
||||
|
||||
@@ -309,6 +309,7 @@ struct BuildRoadToolbarWindow : Window {
|
||||
|
||||
~BuildRoadToolbarWindow()
|
||||
{
|
||||
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
|
||||
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
||||
}
|
||||
|
||||
@@ -531,6 +532,7 @@ struct BuildRoadToolbarWindow : Window {
|
||||
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
DeleteWindowByClass(WC_BUILD_BRIDGE);
|
||||
EraseQueuedTouchCommand();
|
||||
}
|
||||
|
||||
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
|
||||
@@ -1016,6 +1018,7 @@ struct BuildRoadStationWindow : public PickerWindowBase {
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
EraseQueuedTouchCommand();
|
||||
break;
|
||||
|
||||
case WID_BROS_LT_OFF:
|
||||
|
||||
@@ -288,6 +288,7 @@ struct TerraformToolbarWindow : Window {
|
||||
{
|
||||
DeleteWindowById(WC_BUILD_OBJECT, 0);
|
||||
this->RaiseButtons();
|
||||
EraseQueuedTouchCommand();
|
||||
ResetObjectToPlace();
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ public:
|
||||
this->RaiseButtons();
|
||||
|
||||
ResetObjectToPlace();
|
||||
EraseQueuedTouchCommand();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user