MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnPlaceObjectAbort

Method OnPlaceObjectAbort

src/rail_gui.cpp:798–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796 }
797
798 void OnPlaceObjectAbort() override
799 {
800 if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) SetViewportCatchmentStation(nullptr, true);
801 if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) SetViewportCatchmentWaypoint(nullptr, true);
802
803 this->RaiseButtons();
804 this->DisableWidget(WID_RAT_REMOVE);
805 this->SetWidgetDirty(WID_RAT_REMOVE);
806
807 CloseWindowById(WC_BUILD_SIGNAL, TRANSPORT_RAIL);
808 CloseWindowById(WC_BUILD_STATION, TRANSPORT_RAIL);
809 CloseWindowById(WC_BUILD_DEPOT, TRANSPORT_RAIL);
810 CloseWindowById(WC_BUILD_WAYPOINT, TRANSPORT_RAIL);
811 CloseWindowById(WC_SELECT_STATION, 0);
812 CloseWindowByClass(WC_BUILD_BRIDGE);
813 }
814
815 void OnPlacePresize([[maybe_unused]] Point pt, TileIndex tile) override
816 {

Callers

nothing calls this directly

Calls 8

CloseWindowByIdFunction · 0.85
CloseWindowByClassFunction · 0.85
IsWidgetLoweredMethod · 0.80
RaiseButtonsMethod · 0.80
DisableWidgetMethod · 0.80
SetWidgetDirtyMethod · 0.80

Tested by

no test coverage detected