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

Method Close

src/misc_gui.cpp:1011–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009 }
1010
1011 void Close([[maybe_unused]] int data = 0) override
1012 {
1013 if (this->parent != nullptr) {
1014 if (this->parent->window_class == WC_STATION_VIEW) SetViewportStationRect(Station::Get(this->parent->window_number), false);
1015 if (this->parent->window_class == WC_WAYPOINT_VIEW) SetViewportWaypointRect(Waypoint::Get(this->parent->window_number), false);
1016
1017 if (!this->editbox.handled) {
1018 Window *parent = this->parent;
1019 this->parent = nullptr; // so parent doesn't try to close us again
1020 parent->OnQueryTextFinished(std::nullopt);
1021 }
1022 }
1023
1024 this->Window::Close();
1025 }
1026};
1027
1028static constexpr std::initializer_list<NWidgetPart> _nested_query_string_widgets = {

Callers 1

OnClickMethod · 0.95

Calls 3

SetViewportStationRectFunction · 0.85
SetViewportWaypointRectFunction · 0.85
OnQueryTextFinishedMethod · 0.45

Tested by

no test coverage detected