1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Merge pull request #20271 from duncanspumpkin/objDescriptor

Rework Object Identifier callers
This commit is contained in:
Matthias Moninger
2023-06-26 16:11:45 +03:00
committed by GitHub
10 changed files with 7 additions and 149 deletions

View File

@@ -156,28 +156,9 @@ void Object::PopulateTablesFromJson(IReadObjectContext* context, json_t& root)
_usesFallbackImages = _imageTable.ReadJson(context, root);
}
std::string Object::GetOverrideString(uint8_t index) const
{
auto legacyIdentifier = GetLegacyIdentifier();
const auto& localisationService = OpenRCT2::GetContext()->GetLocalisationService();
auto stringId = localisationService.GetObjectOverrideStringId(legacyIdentifier, index);
const utf8* result = nullptr;
if (stringId != STR_NONE)
{
result = LanguageGetString(stringId);
}
return String::ToStd(result);
}
std::string Object::GetString(ObjectStringID index) const
{
auto sz = GetOverrideString(static_cast<uint8_t>(index));
if (sz.empty())
{
sz = GetStringTable().GetString(index);
}
return sz;
return GetStringTable().GetString(index);
}
std::string Object::GetString(int32_t language, ObjectStringID index) const