MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetGRFStringWithTextStack

Function GetGRFStringWithTextStack

src/newgrf_text.cpp:999–1004  ·  view source on GitHub ↗

* Format a GRF string using the text ref stack for parameters. * @param grffile GRFFile of string. * @param grfstringid GRFStringID of string. * @param textstack Text parameter stack. * @returns Formatted string. */

Source from the content-addressed store, hash-verified

997 * @returns Formatted string.
998 */
999std::string GetGRFStringWithTextStack(const struct GRFFile *grffile, GRFStringID grfstringid, std::span<const int32_t> textstack)
1000{
1001 StringID stringid = GetGRFStringID(grffile->grfid, grfstringid);
1002 auto params = GetGRFStringTextStackParameters(grffile, stringid, textstack);
1003 return GetStringWithArgs(stringid, params);
1004}

Callers 6

FormatStringFunction · 0.85
GetCargoSuffixFunction · 0.85
DrawWidgetMethod · 0.85
DrawInfoMethod · 0.85
DrawWidgetMethod · 0.85
GetNewGRFAdditionalTextFunction · 0.85

Calls 3

GetGRFStringIDFunction · 0.85
GetStringWithArgsFunction · 0.85

Tested by

no test coverage detected