mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 20:34:41 +00:00
(svn r20371) -Codechange: add general function to call text callbacks for airports
This commit is contained in:
parent
a48dbd7c51
commit
5bacbba9f2
@ -349,3 +349,17 @@ uint16 GetAirportCallback(CallbackID callback, uint32 param1, uint32 param2, Sta
|
|||||||
|
|
||||||
return group->GetCallbackResult();
|
return group->GetCallbackResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringID GetAirportTextCallback(const AirportSpec *as, byte layout, uint16 callback)
|
||||||
|
{
|
||||||
|
const SpriteGroup *group;
|
||||||
|
ResolverObject object;
|
||||||
|
|
||||||
|
NewAirportResolver(&object, INVALID_TILE, NULL, as->GetIndex(), layout);
|
||||||
|
object.callback = (CallbackID)callback;
|
||||||
|
|
||||||
|
group = SpriteGroup::Resolve(as->grf_prop.spritegroup, &object);
|
||||||
|
if (group == NULL) return STR_UNDEFINED;
|
||||||
|
|
||||||
|
return GetGRFStringID(as->grf_prop.grffile->grfid, 0xD000 + group->GetResult());
|
||||||
|
}
|
||||||
|
@ -117,4 +117,6 @@ uint GetNumAirportsInClass(AirportClassID id);
|
|||||||
void BindAirportSpecs();
|
void BindAirportSpecs();
|
||||||
const AirportSpec *GetAirportSpecFromClass(AirportClassID aclass, uint airport);
|
const AirportSpec *GetAirportSpecFromClass(AirportClassID aclass, uint airport);
|
||||||
|
|
||||||
|
StringID GetAirportTextCallback(const AirportSpec *as, byte layout, uint16 callback);
|
||||||
|
|
||||||
#endif /* NEWGRF_AIRPORT_H */
|
#endif /* NEWGRF_AIRPORT_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user