mirror of https://github.com/OpenTTD/OpenTTD
Merge aeb08a918a
into 6b6caa6fa8
commit
edd6d826a9
|
@ -476,7 +476,7 @@ CommandCost GetErrorMessageFromLocationCallbackResult(uint16_t cb_res, std::span
|
||||||
/* If this error isn't for the local player then it won't be seen, so don't bother encoding anything. */
|
/* If this error isn't for the local player then it won't be seen, so don't bother encoding anything. */
|
||||||
if (IsLocalCompany()) {
|
if (IsLocalCompany()) {
|
||||||
StringID stringid = GetGRFStringID(grffile->grfid, text_id);
|
StringID stringid = GetGRFStringID(grffile->grfid, text_id);
|
||||||
auto params = GetGRFSringTextStackParameters(grffile, stringid, textstack);
|
auto params = GetGRFStringTextStackParameters(grffile, stringid, textstack);
|
||||||
res.SetEncodedMessage(GetEncodedStringWithArgs(stringid, params));
|
res.SetEncodedMessage(GetEncodedStringWithArgs(stringid, params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -973,7 +973,7 @@ static void HandleNewGRFStringControlCodes(std::string_view str, TextRefStack &s
|
||||||
* @param textstack Text parameter stack.
|
* @param textstack Text parameter stack.
|
||||||
* @returns Parameters for GRF string.
|
* @returns Parameters for GRF string.
|
||||||
*/
|
*/
|
||||||
std::vector<StringParameter> GetGRFSringTextStackParameters(const GRFFile *grffile, StringID stringid, std::span<const int32_t> textstack)
|
std::vector<StringParameter> GetGRFStringTextStackParameters(const GRFFile *grffile, StringID stringid, std::span<const int32_t> textstack)
|
||||||
{
|
{
|
||||||
if (stringid == INVALID_STRING_ID) return {};
|
if (stringid == INVALID_STRING_ID) return {};
|
||||||
|
|
||||||
|
@ -998,6 +998,6 @@ std::vector<StringParameter> GetGRFSringTextStackParameters(const GRFFile *grffi
|
||||||
std::string GetGRFStringWithTextStack(const struct GRFFile *grffile, GRFStringID grfstringid, std::span<const int32_t> textstack)
|
std::string GetGRFStringWithTextStack(const struct GRFFile *grffile, GRFStringID grfstringid, std::span<const int32_t> textstack)
|
||||||
{
|
{
|
||||||
StringID stringid = GetGRFStringID(grffile->grfid, grfstringid);
|
StringID stringid = GetGRFStringID(grffile->grfid, grfstringid);
|
||||||
auto params = GetGRFSringTextStackParameters(grffile, stringid, textstack);
|
auto params = GetGRFStringTextStackParameters(grffile, stringid, textstack);
|
||||||
return GetStringWithArgs(stringid, params);
|
return GetStringWithArgs(stringid, params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ void AddGRFTextToList(GRFTextWrapper &list, std::string_view text_to_add);
|
||||||
|
|
||||||
bool CheckGrfLangID(uint8_t lang_id, uint8_t grf_version);
|
bool CheckGrfLangID(uint8_t lang_id, uint8_t grf_version);
|
||||||
|
|
||||||
std::vector<StringParameter> GetGRFSringTextStackParameters(const struct GRFFile *grffile, StringID stringid, std::span<const int32_t> textstack);
|
std::vector<StringParameter> GetGRFStringTextStackParameters(const struct GRFFile *grffile, StringID stringid, std::span<const int32_t> textstack);
|
||||||
std::string GetGRFStringWithTextStack(const struct GRFFile *grffile, GRFStringID grfstringid, std::span<const int32_t> textstack);
|
std::string GetGRFStringWithTextStack(const struct GRFFile *grffile, GRFStringID grfstringid, std::span<const int32_t> textstack);
|
||||||
|
|
||||||
#endif /* NEWGRF_TEXT_H */
|
#endif /* NEWGRF_TEXT_H */
|
||||||
|
|
Loading…
Reference in New Issue