From 82e6001451f0dcfd5f85427a1f3a843656292f1e Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 10 Nov 2012 20:41:45 +0000 Subject: (svn r24685) -Codechange: Add resolver classes for rail types. --- src/table/newgrf_debug_data.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/table/newgrf_debug_data.h') diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 064b6a9a5..b937eeea7 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -398,7 +398,14 @@ class NIHRailType : public NIHelper { const void *GetSpec(uint index) const { return NULL; } void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); } uint32 GetGRFID(uint index) const { return 0; } - void Resolve(ResolverObject *ro, uint32 index) const { extern void GetRailTypeResolver(ResolverObject *ro, uint index); GetRailTypeResolver(ro, index); } + + /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + { + /* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype. + * However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */ + RailTypeResolverObject ro(index, TCX_NORMAL, NULL); + return ro.GetScope(ro.scope)->GetVariable(var, param, avail); + } }; static const NIFeature _nif_railtype = { -- cgit v1.2.3-54-g00ecf