diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 156c553b46..ccd18f1e5c 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -1438,6 +1438,25 @@ class NIHSignals : public NIHelper { extern void DumpNewSignalsSpriteGroups(SpriteGroupDumper &dumper); DumpNewSignalsSpriteGroups(dumper); } + + /* virtual */ bool ShowOptionsDropDown(uint index) const override + { + return true; + } + + /* virtual */ void FillOptionsDropDown(uint index, DropDownList &list) const override + { + list.push_back(std::make_unique(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, 0, !IsTileType(index, MP_RAILWAY))); + } + + /* virtual */ void OnOptionsDropdownSelect(uint index, int selected) const override + { + switch (selected) { + case 0: + ShowNewGRFInspectWindow(GSF_RAILTYPES, index); + break; + } + } }; static const NIFeature _nif_signals = { @@ -1706,6 +1725,30 @@ class NIHRailType : public NIHelper { extern void DumpRailTypeSpriteGroup(RailType rt, SpriteGroupDumper &dumper); DumpRailTypeSpriteGroup(GetTileRailType(index), dumper); } + + /* virtual */ bool ShowOptionsDropDown(uint index) const override + { + return true; + } + + /* virtual */ void FillOptionsDropDown(uint index, DropDownList &list) const override + { + list.push_back(std::make_unique(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE, 0, !IsLevelCrossingTile(index))); + list.push_back(std::make_unique(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_SIGNALS, 1, !(IsTileType(index, MP_RAILWAY) && HasSignals(index)))); + } + + /* virtual */ void OnOptionsDropdownSelect(uint index, int selected) const override + { + switch (selected) { + case 0: + ShowNewGRFInspectWindow(GSF_ROADTYPES, index); + break; + + case 1: + ShowNewGRFInspectWindow(GSF_SIGNALS, index); + break; + } + } }; static const NIFeature _nif_railtype = { @@ -2162,6 +2205,25 @@ class NIHRoadType : public NIHelper { DumpRoadTypeSpriteGroup(rt, dumper); } } + + /* virtual */ bool ShowOptionsDropDown(uint index) const override + { + return true; + } + + /* virtual */ void FillOptionsDropDown(uint index, DropDownList &list) const override + { + list.push_back(std::make_unique(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, 0, !IsLevelCrossingTile(index))); + } + + /* virtual */ void OnOptionsDropdownSelect(uint index, int selected) const override + { + switch (selected) { + case 0: + ShowNewGRFInspectWindow(GSF_RAILTYPES, index); + break; + } + } }; static const NIFeature _nif_roadtype = {