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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user