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

Function DeleteNewGRFInspectWindow

src/newgrf_debug_gui.cpp:726–737  ·  view source on GitHub ↗

* Delete inspect window for a given feature and index. * The index is normally an in-game location/identifier, such * as a TileIndex or an IndustryID depending on the feature * we want to inspect. * @param feature The feature we want to delete the window for. * @param index The index/identifier of the feature to delete. */

Source from the content-addressed store, hash-verified

724 * @param index The index/identifier of the feature to delete.
725 */
726void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index)
727{
728 if (feature == GSF_INVALID) return;
729
730 WindowNumber wno = GetInspectWindowNumber(feature, index);
731 CloseWindowById(WC_NEWGRF_INSPECT, wno);
732
733 /* Reinitialise the land information window to remove the "debug" sprite if needed.
734 * Note: Since we might be called from a command here, it is important to not execute
735 * the invalidation immediately. The landinfo window tests commands itself. */
736 InvalidateWindowData(WC_LAND_INFO, 0, 1);
737}
738
739/**
740 * Can we inspect the data given a certain feature and index.

Callers

nothing calls this directly

Calls 3

GetInspectWindowNumberFunction · 0.85
CloseWindowByIdFunction · 0.85
InvalidateWindowDataFunction · 0.70

Tested by

no test coverage detected