Erase queued commands when another command is about to be queued.
This commit is contained in:
@@ -103,6 +103,7 @@ struct BuildAirToolbarWindow : Window {
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
switch (this->last_user_action) {
|
||||
case WID_AT_AIRPORT: {
|
||||
VpStartPlaceSizing(tile, VPM_SINGLE_TILE, DDSP_BUILD_STATION);
|
||||
|
||||
@@ -168,6 +168,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
switch (this->last_clicked_widget) {
|
||||
case WID_DT_CANAL: // Build canal button
|
||||
VpStartPlaceSizing(tile, (_game_mode == GM_EDITOR) ? VPM_X_AND_Y : VPM_X_OR_Y, DDSP_CREATE_WATER);
|
||||
|
||||
@@ -583,6 +583,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
switch (this->last_user_action) {
|
||||
case WID_RAT_BUILD_NS:
|
||||
VpStartPlaceSizing(tile, VPM_FIX_VERTICAL | VPM_RAILDIRS, DDSP_PLACE_RAIL);
|
||||
|
||||
@@ -467,6 +467,7 @@ struct BuildRoadToolbarWindow : Window {
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
_remove_button_clicked = this->IsWidgetLowered(WID_ROT_REMOVE);
|
||||
_one_way_button_clicked = this->IsWidgetLowered(WID_ROT_ONE_WAY);
|
||||
switch (this->last_started_action) {
|
||||
|
||||
@@ -655,6 +655,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
switch (this->last_user_action) {
|
||||
case WID_ETT_DEMOLISH: // Demolish aka dynamite button
|
||||
PlaceProc_DemolishArea(tile);
|
||||
|
||||
@@ -149,6 +149,7 @@ public:
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
{
|
||||
EraseQueuedTouchCommand();
|
||||
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_PLANT_TREES);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user