mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +00:00
A dummy entry is now displayed in the game options menu if the system has no games.
This commit is contained in:
parent
3907b5ceed
commit
d073dae00b
|
@ -142,7 +142,7 @@ GuiGamelistOptions::GuiGamelistOptions(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the filters entry, unless this is the grouped custom collections system or if there
|
// Add the filters entry, unless this is the grouped custom collections system or if there
|
||||||
// are no games (which should only happen for ungrouped custom collections).
|
// are no games for the system.
|
||||||
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
|
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
|
||||||
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
|
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
|
@ -153,6 +153,16 @@ GuiGamelistOptions::GuiGamelistOptions(
|
||||||
mMenu.addRow(row);
|
mMenu.addRow(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Add a dummy entry when applicable as the menu looks quite ugly if it's just blank.
|
||||||
|
else if (!CollectionSystemsManager::get()->isEditing() &&
|
||||||
|
mSystem->getRootFolder()->getChildren().size() == 0 &&
|
||||||
|
!mIsCustomCollectionGroup && !mIsCustomCollection) {
|
||||||
|
row.elements.clear();
|
||||||
|
row.addElement(std::make_shared<TextComponent>
|
||||||
|
(mWindow, "THIS SYSTEM HAS NO GAMES",
|
||||||
|
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
||||||
|
mMenu.addRow(row);
|
||||||
|
}
|
||||||
|
|
||||||
std::string customSystem;
|
std::string customSystem;
|
||||||
if (Settings::getInstance()->getBool("UseCustomCollectionsSystem"))
|
if (Settings::getInstance()->getBool("UseCustomCollectionsSystem"))
|
||||||
|
@ -207,7 +217,8 @@ GuiGamelistOptions::GuiGamelistOptions(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons. Logic to apply or cancel settings are handled by the destructor.
|
// Buttons. Logic to apply or cancel settings are handled by the destructor.
|
||||||
mMenu.addButton("APPLY", "apply", [&] { delete this; });
|
if (!(!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() == 0))
|
||||||
|
mMenu.addButton("APPLY", "apply", [&] { delete this; });
|
||||||
mMenu.addButton("CANCEL", "cancel", [&] { mCancelled = true; delete this; });
|
mMenu.addButton("CANCEL", "cancel", [&] { mCancelled = true; delete this; });
|
||||||
|
|
||||||
// Center the menu.
|
// Center the menu.
|
||||||
|
@ -272,7 +283,8 @@ GuiGamelistOptions::~GuiGamelistOptions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND);
|
if (mSystem->getRootFolder()->getChildren().size() != 0)
|
||||||
|
NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiGamelistOptions::openGamelistFilter()
|
void GuiGamelistOptions::openGamelistFilter()
|
||||||
|
@ -318,12 +330,16 @@ void GuiGamelistOptions::startEditMode()
|
||||||
ViewController::get()->getGameListView((*it))->getCursor(), false);
|
ViewController::get()->getGameListView((*it))->getCursor(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mSystem->getRootFolder()->getChildren().size() == 0)
|
||||||
|
NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND);
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiGamelistOptions::exitEditMode()
|
void GuiGamelistOptions::exitEditMode()
|
||||||
{
|
{
|
||||||
CollectionSystemsManager::get()->exitEditMode();
|
CollectionSystemsManager::get()->exitEditMode();
|
||||||
|
if (mSystem->getRootFolder()->getChildren().size() == 0)
|
||||||
|
NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND);
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +517,10 @@ std::vector<HelpPrompt> GuiGamelistOptions::getHelpPrompts()
|
||||||
{
|
{
|
||||||
auto prompts = mMenu.getHelpPrompts();
|
auto prompts = mMenu.getHelpPrompts();
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", "select"));
|
||||||
prompts.push_back(HelpPrompt("b", "close (apply)"));
|
if (mSystem->getRootFolder()->getChildren().size() != 0)
|
||||||
|
prompts.push_back(HelpPrompt("b", "close (apply)"));
|
||||||
|
else
|
||||||
|
prompts.push_back(HelpPrompt("b", "close (cancel)"));
|
||||||
prompts.push_back(HelpPrompt("select", "close (cancel)"));
|
prompts.push_back(HelpPrompt("select", "close (cancel)"));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue