Remove reference asset names from info strings

This commit is contained in:
Jan
2021-03-06 21:20:13 +01:00
parent 78107b74e0
commit 313e9e9f1a
5 changed files with 20 additions and 11 deletions

View File

@ -144,6 +144,14 @@ InfoString InfoStringFromStructConverterBase::Convert()
return std::move(m_info_string);
}
const char* InfoStringFromStructConverterBase::AssetName(const char* name)
{
if (name && name[0] == ',')
return &name[1];
return name;
}
void InfoStringFromStructConverterBase::FillFromString(const std::string& key, const size_t offset)
{
const auto* str = *reinterpret_cast<const char**>(reinterpret_cast<uintptr_t>(m_structure) + offset);

View File

@ -54,6 +54,7 @@ protected:
const void* m_structure;
const std::function<std::string(scr_string_t)> m_get_scr_string;
static const char* AssetName(const char* name);
void FillFromString(const std::string& key, size_t offset);
void FillFromStringBuffer(const std::string& key, size_t offset, size_t bufferSize);
void FillFromInt(const std::string& key, size_t offset);