Added theme support for the 'physicalName' and 'physicalNameExtension' metadata types for the text element

This commit is contained in:
Leon Styhre 2023-09-23 12:52:00 +02:00
parent 35356d96ad
commit 61d2b92814
3 changed files with 33 additions and 5 deletions

View file

@ -914,6 +914,12 @@ void GamelistView::updateView(const CursorState& state)
->getSystemEnvData()
->mLaunchCommands.front()
.second));
else if (metadata == "physicalName")
return file->getType() == PLACEHOLDER ?
"" :
Utils::FileSystem::getStem(file->getFileName());
else if (metadata == "physicalNameExtension")
return file->getType() == PLACEHOLDER ? "" : file->getFileName();
else if (metadata == "systemName")
return file->getSystem()->getName();
else if (metadata == "systemFullname")

View file

@ -1277,6 +1277,11 @@ void SystemView::updateGameSelectors()
->getSystemEnvData()
->mLaunchCommands.front()
.second));
else if (metadata == "physicalName")
text->setValue(
Utils::FileSystem::getStem(games.at(gameSelectorEntry)->getFileName()));
else if (metadata == "physicalNameExtension")
text->setValue(games.at(gameSelectorEntry)->getFileName());
else if (metadata == "systemName")
text->setValue(games.at(gameSelectorEntry)->getSystem()->getName());
else if (metadata == "systemFullname")

View file

@ -126,11 +126,28 @@ private:
"gamecountFavorites",
"gamecountFavoritesNoText"};
static inline std::vector<std::string> supportedMetadataTypes {
"name", "description", "rating", "developer", "publisher",
"genre", "players", "favorite", "completed", "kidgame",
"broken", "playcount", "controller", "altemulator", "emulator",
"manual", "systemName", "systemFullname", "sourceSystemName", "sourceSystemFullname"};
static inline std::vector<std::string> supportedMetadataTypes {"name",
"description",
"rating",
"developer",
"publisher",
"genre",
"players",
"favorite",
"completed",
"kidgame",
"broken",
"playcount",
"controller",
"altemulator",
"emulator",
"manual",
"physicalName",
"physicalNameExtension",
"systemName",
"systemFullname",
"sourceSystemName",
"sourceSystemFullname"};
Renderer* mRenderer;
std::string mDefaultValue;