NewGRF: Add generic town callback to set town zone radii

This commit is contained in:
Jonathan G Rennison
2023-03-11 02:24:50 +00:00
parent 93c34775e4
commit ae99f667b0
10 changed files with 89 additions and 14 deletions

View File

@@ -1593,6 +1593,7 @@ static const NIVariable _niv_towns[] = {
class NIHTown : public NIHelper {
bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
bool ShowSpriteDumpButton(uint index) const override { return true; }
uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const override { return Town::Get(index); }
const void *GetSpec(uint index) const override { return nullptr; }
@@ -1660,6 +1661,12 @@ class NIHTown : public NIHelper {
}
}
}
/* virtual */ void SpriteDump(uint index, DumpSpriteGroupPrinter print) const override
{
extern void DumpGenericCallbackSpriteGroups(GrfSpecFeature feature, DumpSpriteGroupPrinter print);
DumpGenericCallbackSpriteGroups(GSF_FAKE_TOWNS, std::move(print));
}
};
static const NIFeature _nif_town = {