Option to show start menu in Kids mode

This commit is contained in:
pjft 2020-02-24 10:16:59 +00:00 committed by pjft
parent c9b3f5b646
commit 258df48481
3 changed files with 9 additions and 2 deletions

View file

@ -366,6 +366,12 @@ void GuiMenu::openUISettings()
if (enable_filter->getState() != filter_is_enabled) ViewController::get()->ReloadAndGoToStart(); if (enable_filter->getState() != filter_is_enabled) ViewController::get()->ReloadAndGoToStart();
}); });
// hide start menu in Kid Mode
auto disable_start = std::make_shared<SwitchComponent>(mWindow);
disable_start->setState(Settings::getInstance()->getBool("DisableKidStartMenu"));
s->addWithLabel("DISABLE START MENU IN KID MODE", disable_start);
s->addSaveFunc([disable_start] { Settings::getInstance()->setBool("DisableKidStartMenu", disable_start->getState()); });
mWindow->pushGui(s); mWindow->pushGui(s);
} }

View file

@ -360,7 +360,7 @@ bool ViewController::input(InputConfig* config, Input input)
return true; return true;
// open menu // open menu
if(!UIModeController::getInstance()->isUIModeKid() && config->isMappedTo("start", input) && input.value != 0) if(!(UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("DisableKidStartMenu")) && config->isMappedTo("start", input) && input.value != 0)
{ {
// open menu // open menu
mWindow->pushGui(new GuiMenu(mWindow)); mWindow->pushGui(new GuiMenu(mWindow));
@ -527,7 +527,7 @@ std::vector<HelpPrompt> ViewController::getHelpPrompts()
return prompts; return prompts;
prompts = mCurrentView->getHelpPrompts(); prompts = mCurrentView->getHelpPrompts();
if(!UIModeController::getInstance()->isUIModeKid()) if(!(UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("DisableKidStartMenu")))
prompts.push_back(HelpPrompt("start", "menu")); prompts.push_back(HelpPrompt("start", "menu"));
return prompts; return prompts;

View file

@ -65,6 +65,7 @@ void Settings::setDefaults()
mBoolMap["SplashScreen"] = true; mBoolMap["SplashScreen"] = true;
mBoolMap["SplashScreenProgress"] = true; mBoolMap["SplashScreenProgress"] = true;
mStringMap["StartupSystem"] = ""; mStringMap["StartupSystem"] = "";
mBoolMap["DisableKidStartMenu"] = true;
mBoolMap["VSync"] = true; mBoolMap["VSync"] = true;