Skip to content

Commit

Permalink
Return token name if not a minifig
Browse files Browse the repository at this point in the history
  • Loading branch information
deReeperJosh committed Oct 7, 2024
1 parent 0829d33 commit ec1e67e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Cafe/OS/libs/nsyshid/Dimensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
1 change: 1 addition & 0 deletions src/Cafe/OS/libs/nsyshid/Dimensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ec1e67e

Please sign in to comment.