* 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
| 690 | * @param grfid GRFID of the item opening this window, or 0 if not opened by other window. |
| 691 | */ |
| 692 | void 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. |
no test coverage detected