mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 09:35:39 +00:00
Merge pull request #94 from jrassa/gamelist-view-check
don't enable video view if current theme doesn't support it
This commit is contained in:
commit
0bb7134b5d
|
@ -228,13 +228,15 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
|
|||
//if we didn't, make it, remember it, and return it
|
||||
std::shared_ptr<IGameListView> view;
|
||||
|
||||
bool themeHasVideoView = system->getTheme()->hasView("video");
|
||||
|
||||
//decide type
|
||||
bool detailed = false;
|
||||
bool video = false;
|
||||
std::vector<FileData*> files = system->getRootFolder()->getFilesRecursive(GAME | FOLDER);
|
||||
for(auto it = files.begin(); it != files.end(); it++)
|
||||
{
|
||||
if(!(*it)->getVideoPath().empty())
|
||||
if(themeHasVideoView && !(*it)->getVideoPath().empty())
|
||||
{
|
||||
video = true;
|
||||
break;
|
||||
|
|
|
@ -343,6 +343,11 @@ void ThemeData::parseElement(const pugi::xml_node& root, const std::map<std::str
|
|||
}
|
||||
}
|
||||
|
||||
bool ThemeData::hasView(const std::string& view)
|
||||
{
|
||||
auto viewIt = mViews.find(view);
|
||||
return (viewIt != mViews.end());
|
||||
}
|
||||
|
||||
const ThemeData::ThemeElement* ThemeData::getElement(const std::string& view, const std::string& element, const std::string& expectedType) const
|
||||
{
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
BOOLEAN
|
||||
};
|
||||
|
||||
bool hasView(const std::string& view);
|
||||
|
||||
// If expectedType is an empty string, will do no type checking.
|
||||
const ThemeElement* getElement(const std::string& view, const std::string& element, const std::string& expectedType) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue