Add function to get GRF ID of string ID
This commit is contained in:
@@ -1078,3 +1078,13 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetStringGRFID(StringID string)
|
||||
{
|
||||
switch (GetStringTab(string)) {
|
||||
case TEXT_TAB_NEWGRF_START:
|
||||
return _grf_text[GetStringIndex(string)].grfid;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -174,6 +174,7 @@ extern StringParameters _global_string_params;
|
||||
char *GetString(char *buffr, StringID string, const char *last);
|
||||
char *GetStringWithArgs(char *buffr, StringID string, StringParameters *args, const char *last, uint case_index = 0, bool game_script = false);
|
||||
const char *GetStringPtr(StringID string);
|
||||
uint32 GetStringGRFID(StringID string);
|
||||
|
||||
uint ConvertKmhishSpeedToDisplaySpeed(uint speed);
|
||||
uint ConvertDisplaySpeedToKmhishSpeed(uint speed);
|
||||
|
Reference in New Issue
Block a user