diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index b7998a52f..6d7429cbd 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -247,17 +247,19 @@ void FileFilterIndex::resetFilters() void FileFilterIndex::setUIModeFilters() { - if (!UIModeController::getInstance()->isUIModeFull()) - { - filterByHidden = true; - std::vector val = { "FALSE" }; - setFilter(HIDDEN_FILTER, &val); - } - if (UIModeController::getInstance()->isUIModeKid()) - { - filterByKidGame = true; - std::vector val = { "TRUE" }; - setFilter(KIDGAME_FILTER, &val); + if(!Settings::getInstance()->getBool("ForceDisableFilters")){ + if (!UIModeController::getInstance()->isUIModeFull()) + { + filterByHidden = true; + std::vector val = { "FALSE" }; + setFilter(HIDDEN_FILTER, &val); + } + if (UIModeController::getInstance()->isUIModeKid()) + { + filterByKidGame = true; + std::vector val = { "TRUE" }; + setFilter(KIDGAME_FILTER, &val); + } } } diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index 300a1e410..7510f0c5c 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -77,11 +77,14 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) : Gui mMenu.addWithLabel("SORT GAMES BY", mListSort); } // show filtered menu - row.elements.clear(); - row.addElement(std::make_shared(mWindow, "FILTER GAMELIST", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true); - row.addElement(makeArrow(mWindow), false); - row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this)); - mMenu.addRow(row); + if(!Settings::getInstance()->getBool("ForceDisableFilters")) + { + row.elements.clear(); + row.addElement(std::make_shared(mWindow, "FILTER GAMELIST", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true); + row.addElement(makeArrow(mWindow), false); + row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this)); + mMenu.addRow(row); + } std::map customCollections = CollectionSystemManager::get()->getCustomCollectionSystems(); diff --git a/es-app/src/guis/GuiGeneralScreensaverOptions.cpp b/es-app/src/guis/GuiGeneralScreensaverOptions.cpp index 40c8a25ac..30688c566 100644 --- a/es-app/src/guis/GuiGeneralScreensaverOptions.cpp +++ b/es-app/src/guis/GuiGeneralScreensaverOptions.cpp @@ -2,6 +2,7 @@ #include "components/OptionListComponent.h" #include "components/SliderComponent.h" +#include "components/SwitchComponent.h" #include "guis/GuiMsgBox.h" #include "guis/GuiSlideshowScreensaverOptions.h" #include "guis/GuiVideoScreensaverOptions.h" @@ -17,6 +18,12 @@ GuiGeneralScreensaverOptions::GuiGeneralScreensaverOptions(Window* window, const Settings::getInstance()->setInt("ScreenSaverTime", (int)Math::round(screensaver_time->getValue()) * (1000 * 60)); PowerSaver::updateTimeouts(); }); + + // Allow ScreenSaver Controls - ScreenSaverControls + auto ss_controls = std::make_shared(mWindow); + ss_controls->setState(Settings::getInstance()->getBool("ScreenSaverControls")); + addWithLabel("SCREENSAVER CONTROLS", ss_controls); + addSaveFunc([ss_controls] { Settings::getInstance()->setBool("ScreenSaverControls", ss_controls->getState()); }); // screensaver behavior auto screensaver_behavior = std::make_shared< OptionListComponent >(mWindow, "SCREENSAVER BEHAVIOR", false); diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 4cf41badc..53512c89b 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -39,8 +39,7 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MEN if (isFullUI) addEntry("CONFIGURE INPUT", 0x777777FF, true, [this] { openConfigInput(); }); - if (!(UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("hideQuitMenuOnKidUI"))) - addEntry("QUIT", 0x777777FF, true, [this] {openQuitMenu(); }); + addEntry("QUIT", 0x777777FF, true, [this] {openQuitMenu(); }); addChild(&mMenu); addVersionInfo(); @@ -309,6 +308,16 @@ void GuiMenu::openUISettings() s->addWithLabel("ON-SCREEN HELP", show_help); s->addSaveFunc([show_help] { Settings::getInstance()->setBool("ShowHelpPrompts", show_help->getState()); }); + // enable filters (ForceDisableFilters) + auto enable_filter = std::make_shared(mWindow); + enable_filter->setState(!Settings::getInstance()->getBool("ForceDisableFilters")); + s->addWithLabel("ENABLE FILTERS", enable_filter); + s->addSaveFunc([enable_filter] { + bool filter_is_enabled = !Settings::getInstance()->getBool("ForceDisableFilters"); + Settings::getInstance()->setBool("ForceDisableFilters", !enable_filter->getState()); + if (enable_filter->getState() != filter_is_enabled) ViewController::get()->ReloadAndGoToStart(); + }); + mWindow->pushGui(s); } diff --git a/es-app/src/guis/GuiVideoScreensaverOptions.cpp b/es-app/src/guis/GuiVideoScreensaverOptions.cpp index 2fcd111cf..b7489b0ec 100644 --- a/es-app/src/guis/GuiVideoScreensaverOptions.cpp +++ b/es-app/src/guis/GuiVideoScreensaverOptions.cpp @@ -25,12 +25,6 @@ GuiVideoScreensaverOptions::GuiVideoScreensaverOptions(Window* window, const cha addSaveFunc([ss_omx, this] { Settings::getInstance()->setBool("ScreenSaverOmxPlayer", ss_omx->getState()); }); #endif - // Allow ScreenSaver Controls - ScreenSaverControls - auto ss_controls = std::make_shared(mWindow); - ss_controls->setState(Settings::getInstance()->getBool("ScreenSaverControls")); - addWithLabel("SCREENSAVER CONTROLS", ss_controls); - addSaveFunc([ss_controls] { Settings::getInstance()->setBool("ScreenSaverControls", ss_controls->getState()); }); - // Render Video Game Name as subtitles auto ss_info = std::make_shared< OptionListComponent >(mWindow, "SHOW GAME INFO", false); std::vector info_type; diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index df680023e..2cc928146 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -132,6 +132,10 @@ bool parseArgs(int argc, char* argv[]) { Settings::getInstance()->setBool("ForceKid", true); } + else if (strcmp(argv[i], "--force-disable-filters") == 0) + { + Settings::getInstance()->setBool("ForceDisableFilters", true); + } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { #ifdef WIN32 @@ -158,7 +162,9 @@ bool parseArgs(int argc, char* argv[]) "--windowed not fullscreen, should be used with --resolution\n" "--vsync [1/on or 0/off] turn vsync on or off (default is on)\n" "--max-vram [size] Max VRAM to use in Mb before swapping. 0 for unlimited\n" + "--force-kid Force the UI mode to be Kid\n" "--force-kiosk Force the UI mode to be Kiosk\n" + "--force-disable-filters Force the UI to ignore applied filters in gamelist\n" "--help, -h summon a sentient, angry tuba\n\n" "More information available in README.md.\n"; return false; //exit after printing help diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index fe850d566..c5204807b 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -196,7 +196,7 @@ bool SystemView::input(InputConfig* config, Input input) config->isMappedTo("up", input) || config->isMappedTo("down", input)) listInput(0); - if(config->isMappedTo("select", input) && Settings::getInstance()->getBool("ScreenSaverControls")) + if(!UIModeController::getInstance()->isUIModeKid() && config->isMappedTo("select", input) && Settings::getInstance()->getBool("ScreenSaverControls")) { mWindow->startScreenSaver(); mWindow->renderScreenSaver(); @@ -382,7 +382,7 @@ std::vector SystemView::getHelpPrompts() prompts.push_back(HelpPrompt("a", "select")); prompts.push_back(HelpPrompt("x", "random")); - if (Settings::getInstance()->getBool("ScreenSaverControls")) + if (!UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("ScreenSaverControls")) prompts.push_back(HelpPrompt("select", "launch screensaver")); return prompts; diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index c43d7729b..81626cba6 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -357,7 +357,7 @@ bool ViewController::input(InputConfig* config, Input input) return true; // open menu - if(config->isMappedTo("start", input) && input.value != 0) + if(!UIModeController::getInstance()->isUIModeKid() && config->isMappedTo("start", input) && input.value != 0) { // open menu mWindow->pushGui(new GuiMenu(mWindow)); @@ -512,7 +512,8 @@ std::vector ViewController::getHelpPrompts() return prompts; prompts = mCurrentView->getHelpPrompts(); - prompts.push_back(HelpPrompt("start", "menu")); + if(!UIModeController::getInstance()->isUIModeKid()) + prompts.push_back(HelpPrompt("start", "menu")); return prompts; } diff --git a/es-app/src/views/gamelist/BasicGameListView.cpp b/es-app/src/views/gamelist/BasicGameListView.cpp index 5c76e101c..7a5ef8f1b 100644 --- a/es-app/src/views/gamelist/BasicGameListView.cpp +++ b/es-app/src/views/gamelist/BasicGameListView.cpp @@ -150,10 +150,11 @@ std::vector BasicGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("up/down", "choose")); prompts.push_back(HelpPrompt("a", "launch")); prompts.push_back(HelpPrompt("b", "back")); - prompts.push_back(HelpPrompt("select", "options")); + if(!UIModeController::getInstance()->isUIModeKid()) + prompts.push_back(HelpPrompt("select", "options")); if(mRoot->getSystem()->isGameSystem()) prompts.push_back(HelpPrompt("x", "random")); - if(mRoot->getSystem()->isGameSystem() && !UIModeController::getInstance()->isUIModeKid()) + if(mRoot->getSystem()->isGameSystem() && UIModeController::getInstance()->isUIModeFull()) { std::string prompt = CollectionSystemManager::get()->getEditingCollection(); prompts.push_back(HelpPrompt("y", prompt)); diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index 66c827f80..a568a0943 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -368,7 +368,8 @@ std::vector GridGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("up/down/left/right", "choose")); prompts.push_back(HelpPrompt("a", "launch")); prompts.push_back(HelpPrompt("b", "back")); - prompts.push_back(HelpPrompt("select", "options")); + if(!UIModeController::getInstance()->isUIModeKid()) + prompts.push_back(HelpPrompt("select", "options")); if(mRoot->getSystem()->isGameSystem()) prompts.push_back(HelpPrompt("x", "random")); if(mRoot->getSystem()->isGameSystem() && !UIModeController::getInstance()->isUIModeKid()) diff --git a/es-app/src/views/gamelist/IGameListView.cpp b/es-app/src/views/gamelist/IGameListView.cpp index a017d73be..5fd5dbf07 100644 --- a/es-app/src/views/gamelist/IGameListView.cpp +++ b/es-app/src/views/gamelist/IGameListView.cpp @@ -1,6 +1,7 @@ #include "views/gamelist/IGameListView.h" #include "guis/GuiGamelistOptions.h" +#include "views/UIModeController.h" #include "views/ViewController.h" #include "Sound.h" #include "Window.h" @@ -8,7 +9,7 @@ bool IGameListView::input(InputConfig* config, Input input) { // select to open GuiGamelistOptions - if(config->isMappedTo("select", input) && input.value) + if(!UIModeController::getInstance()->isUIModeKid() && config->isMappedTo("select", input) && input.value) { Sound::getFromTheme(mTheme, getName(), "menuOpen")->play(); mWindow->pushGui(new GuiGamelistOptions(mWindow, this->mRoot->getSystem())); diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index 45acb4cae..2caf26b1e 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -146,7 +146,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) } return true; } - }else if (config->isMappedTo("y", input) && !(UIModeController::getInstance()->isUIModeKid())) + }else if (config->isMappedTo("y", input) && UIModeController::getInstance()->isUIModeFull()) { if(mRoot->getSystem()->isGameSystem()) { diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 2a999fb23..a0169619a 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -18,6 +18,7 @@ std::vector settings_dont_save { { "DebugImage" }, { "ForceKid" }, { "ForceKiosk" }, + { "ForceDisableFilters" }, { "IgnoreGamelist" }, { "HideConsole" }, { "ShowExit" }, @@ -138,7 +139,7 @@ void Settings::setDefaults() mStringMap["UIMode_passkey"] = "uuddlrlrba"; mBoolMap["ForceKiosk"] = false; mBoolMap["ForceKid"] = false; - mBoolMap["hideQuitMenuOnKidUI"] = false; + mBoolMap["ForceDisableFilters"] = false; mIntMap["WindowWidth"] = 0; mIntMap["WindowHeight"] = 0;