Codechange: Preprocess text ref stack parameters. (#13642)

NewGRF text ref stack is now processed in advance, creating parameters as necessary, and then encoding this into an EncodedString.
This commit is contained in:
Peter Nelson
2025-02-22 22:03:38 +00:00
committed by GitHub
parent 4ac81656ee
commit b28dca2222
12 changed files with 168 additions and 354 deletions

View File

@@ -804,10 +804,7 @@ static std::optional<std::string> GetNewGRFAdditionalText(EngineID engine)
return std::nullopt;
}
StartTextRefStackUsage(grffile, 6);
std::string result = GetString(GetGRFStringID(grffile->grfid, GRFSTR_MISC_GRF_TEXT + callback));
StopTextRefStackUsage();
return result;
return GetGRFStringWithTextStack(grffile, GRFSTR_MISC_GRF_TEXT + callback, 6);
}
/**