mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Made the the text element emulator metadata property work with collections.
This commit is contained in:
parent
ace7dde017
commit
6c3f5e70bd
|
@ -12,16 +12,14 @@
|
|||
#define ES_APP_FILE_DATA_H
|
||||
|
||||
#include "MetaData.h"
|
||||
#include "SystemData.h"
|
||||
#include "Window.h"
|
||||
#include "utils/FileSystemUtil.h"
|
||||
#include "utils/StringUtil.h"
|
||||
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
|
||||
class SystemData;
|
||||
class Window;
|
||||
struct SystemEnvironmentData;
|
||||
|
||||
enum FileType {
|
||||
GAME = 1, // Cannot have children.
|
||||
FOLDER = 2,
|
||||
|
@ -69,6 +67,10 @@ public:
|
|||
const std::vector<FileData*>& getChildren() const { return mChildren; }
|
||||
const std::vector<FileData*>& getFilteredChildren() const { return mFilteredChildren; }
|
||||
SystemData* getSystem() const { return mSystem; }
|
||||
SystemData* getSourceSystem()
|
||||
{
|
||||
return (mSourceFileData != nullptr ? mSourceFileData->mSystem : mSystem);
|
||||
}
|
||||
SystemEnvironmentData* getSystemEnvData() const { return mEnvData; }
|
||||
|
||||
// These functions are used by GameSelectorComponent.
|
||||
|
|
|
@ -895,14 +895,16 @@ void GamelistView::updateView(const CursorState& state)
|
|||
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));
|
||||
return (file->getType() == FOLDER) ?
|
||||
"" :
|
||||
(file->metadata.get("altemulator") != "" ?
|
||||
file->metadata.get("altemulator") :
|
||||
(file->getSourceSystem()->getAlternativeEmulator() != "" ?
|
||||
file->getSourceSystem()->getAlternativeEmulator() :
|
||||
file->getSourceSystem()
|
||||
->getSystemEnvData()
|
||||
->mLaunchCommands.front()
|
||||
.second));
|
||||
else if (metadata == "systemName")
|
||||
return file->getSystem()->getName();
|
||||
else if (metadata == "systemFullname")
|
||||
|
|
|
@ -1300,10 +1300,13 @@ void SystemView::updateGameSelectors()
|
|||
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)->getSourceSystem()->getAlternativeEmulator() !=
|
||||
"" ?
|
||||
games.at(gameSelectorEntry)
|
||||
->getSystem()
|
||||
->getSourceSystem()
|
||||
->getAlternativeEmulator() :
|
||||
games.at(gameSelectorEntry)
|
||||
->getSourceSystem()
|
||||
->getSystemEnvData()
|
||||
->mLaunchCommands.front()
|
||||
.second));
|
||||
|
|
Loading…
Reference in a new issue