Added an emulator metadata property value for the text element.

This commit is contained in:
Leon Styhre 2023-02-19 11:50:47 +01:00
parent 16099aef58
commit ace7dde017
3 changed files with 24 additions and 6 deletions

View file

@ -894,6 +894,15 @@ void GamelistView::updateView(const CursorState& state)
return file->metadata.get("playcount");
else if (metadata == "altemulator")
return file->metadata.get("altemulator");
else if (metadata == "emulator")
return (file->metadata.get("altemulator") != "" ?
file->metadata.get("altemulator") :
(file->getSystem()->getAlternativeEmulator() != "" ?
file->getSystem()->getAlternativeEmulator() :
file->getSystem()
->getSystemEnvData()
->mLaunchCommands.front()
.second));
else if (metadata == "systemName")
return file->getSystem()->getName();
else if (metadata == "systemFullname")

View file

@ -1296,6 +1296,17 @@ void SystemView::updateGameSelectors()
text->setValue(games.at(gameSelectorEntry)->metadata.get("playcount"));
else if (metadata == "altemulator")
text->setValue(games.at(gameSelectorEntry)->metadata.get("altemulator"));
else if (metadata == "emulator")
text->setValue(
games.at(gameSelectorEntry)->metadata.get("altemulator") != "" ?
games.at(gameSelectorEntry)->metadata.get("altemulator") :
(games.at(gameSelectorEntry)->getSystem()->getAlternativeEmulator() != "" ?
games.at(gameSelectorEntry)->getSystem()->getAlternativeEmulator() :
games.at(gameSelectorEntry)
->getSystem()
->getSystemEnvData()
->mLaunchCommands.front()
.second));
else if (metadata == "systemName")
text->setValue(games.at(gameSelectorEntry)->getSystem()->getName());
else if (metadata == "systemFullname")

View file

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