diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 37499dd80f..8179539190 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -690,3 +690,8 @@ bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type) } return false; } + +void DumpIndustrySpriteGroup(const IndustrySpec *spec, std::function print) +{ + DumpSpriteGroup(spec->grf_prop.spritegroup[0], std::move(print)); +} diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 2b3b2d7dc8..866b5981cf 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -727,6 +727,7 @@ static const NIVariable _niv_industries[] = { class NIHIndustry : public NIHelper { bool IsInspectable(uint index) const override { return true; } bool ShowExtraInfoOnly(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile == nullptr; } + bool ShowSpriteDumpButton(uint index) const override { return true; } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); } const void *GetInstance(uint index)const override { return Industry::Get(index); } const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); } @@ -805,6 +806,15 @@ class NIHIndustry : public NIHelper { } } } + + /* virtual */ void SpriteDump(uint index, std::function print) const override + { + const Industry *ind = Industry::GetIfValid(index); + if (ind) { + extern void DumpIndustrySpriteGroup(const IndustrySpec *spec, std::function print); + DumpIndustrySpriteGroup(GetIndustrySpec(ind->type), std::move(print)); + } + } }; static const NIFeature _nif_industry = {