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

Function ShowNewGRFInspectWindow

src/newgrf_debug_gui.cpp:692–700  ·  view source on GitHub ↗

* Show the 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 inspect. * @param index The index/identifier of the feature to inspect. * @param grfid GRFID of the item opening this window, or 0 if not opened by oth

Source from the content-addressed store, hash-verified

690 * @param grfid GRFID of the item opening this window, or 0 if not opened by other window.
691 */
692void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32_t grfid)
693{
694 if (!IsNewGRFInspectable(feature, index)) return;
695
696 WindowNumber wno = GetInspectWindowNumber(feature, index);
697 WindowDesc &desc = (feature == GSF_TRAINS || feature == GSF_ROADVEHICLES) ? _newgrf_inspect_chain_desc : _newgrf_inspect_desc;
698 NewGRFInspectWindow *w = AllocateWindowDescFront<NewGRFInspectWindow, true>(desc, wno);
699 w->SetCallerGRFID(grfid);
700}
701
702/**
703 * Invalidate the inspect window for a given feature and index.

Callers 4

OnClickMethod · 0.85

Calls 3

IsNewGRFInspectableFunction · 0.85
GetInspectWindowNumberFunction · 0.85
SetCallerGRFIDMethod · 0.80

Tested by

no test coverage detected