belugas@3601: /* $Id$ */ belugas@3601: #ifndef NEWGRF_TEXT_H belugas@3601: #define NEWGRF_TEXT_H belugas@3601: belugas@3601: /** @file belugas@3601: * Header of Action 04 "universal holder" structure and functions belugas@3601: */ belugas@3601: belugas@3601: #define MAX_LANG 28 belugas@3601: belugas@3601: /** belugas@3601: * Element of the linked list. belugas@3601: * Each of those elements represent the string, belugas@3601: * but according to a different lang. belugas@3601: */ belugas@3601: typedef struct GRFText { belugas@3601: byte langid; belugas@3601: char *text; belugas@3601: struct GRFText *next; belugas@3601: } GRFText; belugas@3601: belugas@3601: belugas@3601: /** belugas@3601: * Holder of the above structure. belugas@3601: * Putting both grfid and stringid togueter allow us to avoid duplicates, belugas@3601: * since it is NOT SUPPOSED to happen. belugas@3601: */ belugas@3601: typedef struct GRFTextEntry { belugas@3601: uint32 grfid; belugas@3601: uint16 stringid; belugas@3601: GRFText *textholder; belugas@3601: } GRFTextEntry; belugas@3601: belugas@3601: belugas@3601: StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, const char *text_to_add); belugas@3601: StringID GetGRFStringID(uint32 grfid, uint16 stringid); belugas@3601: char *GetGRFString(char *buff, uint16 stringid); belugas@3601: void CleanUpStrings(void); belugas@3601: void SetCurrentGrfLangID(const char *iso_name); belugas@3601: belugas@3601: #endif /* NEWGRF_TEXT_H */