Return token name if not a minifig

This commit is contained in:
Joshua de Reeper 2024-10-07 18:24:44 +02:00
parent 0829d33a48
commit ec1e67e592
2 changed files with 13 additions and 0 deletions

View File

@ -1114,6 +1114,11 @@ namespace nsyshid
return s_listMinis;
}
std::map<const uint32, const char*> DimensionsUSB::GetListTokens()
{
return s_listTokens;
}
std::string DimensionsUSB::FindFigure(uint32 figNum)
{
for (const auto& it : GetListMinifigs())
@ -1123,6 +1128,13 @@ namespace nsyshid
return it.second;
}
}
for (const auto& it : GetListTokens())
{
if (it.first == figNum)
{
return it.second;
}
}
return fmt::format("Unknown ({})", figNum);
}
} // namespace nsyshid

View File

@ -70,6 +70,7 @@ namespace nsyshid
bool CreateFigure(fs::path pathName, uint32 id);
bool MoveFigure(uint8 pad, uint8 index, uint8 oldPad, uint8 oldIndex);
static std::map<const uint32, const char*> GetListMinifigs();
static std::map<const uint32, const char*> GetListTokens();
std::string FindFigure(uint32 figNum);
protected: