mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
skip game lists without games when quick selecting, handle empty game lists
This commit is contained in:
parent
d2d448ee1c
commit
6f602a22c9
|
@ -161,6 +161,12 @@ void SystemData::launchGame(Window* window, FileData* game)
|
|||
|
||||
void SystemData::populateFolder(FileData* folder)
|
||||
{
|
||||
if (mDirectLaunch)
|
||||
{
|
||||
LOG(LogInfo) << "System " << mName << " is a direct launch item, not building game lists.";
|
||||
return;
|
||||
}
|
||||
|
||||
const fs::path& folderPath = folder->getPath();
|
||||
if(!fs::is_directory(folderPath))
|
||||
{
|
||||
|
@ -330,12 +336,15 @@ bool SystemData::loadConfig()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!directLaunch)
|
||||
{
|
||||
//convert path to generic directory seperators
|
||||
boost::filesystem::path genericPath(path);
|
||||
path = genericPath.generic_string();
|
||||
}
|
||||
|
||||
SystemData* newSys = new SystemData(name, fullname, path, extensions, cmd, platformIds, themeFolder, directLaunch);
|
||||
if(newSys->getRootFolder()->getChildren().size() == 0)
|
||||
if(newSys->getRootFolder()->getChildren().size() == 0 && !directLaunch)
|
||||
{
|
||||
LOG(LogWarning) << "System \"" << name << "\" has no games! Ignoring it.";
|
||||
delete newSys;
|
||||
|
|
|
@ -72,7 +72,15 @@ void ViewController::goToNextGameList()
|
|||
assert(mState.viewing == GAME_LIST);
|
||||
SystemData* system = getState().getSystem();
|
||||
assert(system);
|
||||
goToGameList(system->getNext());
|
||||
|
||||
// skip systems that don't have a game list, this will always end since it is called
|
||||
// from a system with a game list and the iterator is cyclic
|
||||
do
|
||||
{
|
||||
system = system->getNext();
|
||||
} while ( system->getDirectLaunch() );
|
||||
|
||||
goToGameList(system);
|
||||
}
|
||||
|
||||
void ViewController::goToPrevGameList()
|
||||
|
@ -80,7 +88,15 @@ void ViewController::goToPrevGameList()
|
|||
assert(mState.viewing == GAME_LIST);
|
||||
SystemData* system = getState().getSystem();
|
||||
assert(system);
|
||||
goToGameList(system->getPrev());
|
||||
|
||||
// skip systems that don't have a game list, this will always end since it is called
|
||||
// from a system with a game list and the iterator is cyclic
|
||||
do
|
||||
{
|
||||
system = system->getPrev();
|
||||
} while ( system->getDirectLaunch() );
|
||||
|
||||
goToGameList(system);
|
||||
}
|
||||
|
||||
void ViewController::goToGameList(SystemData* system)
|
||||
|
|
|
@ -39,6 +39,12 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
|||
{
|
||||
mList.clear();
|
||||
|
||||
// file list can be empty if direct launch item
|
||||
if (files.size()==0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHeaderText.setText(files.at(0)->getSystem()->getFullName());
|
||||
|
||||
for(auto it = files.begin(); it != files.end(); it++)
|
||||
|
|
Loading…
Reference in a new issue