mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Start now closes most submenus.
This commit is contained in:
parent
fc96849f08
commit
63113aeea7
|
@ -1,6 +1,7 @@
|
|||
#include "GuiScraperStart.h"
|
||||
#include "GuiScraperMulti.h"
|
||||
#include "GuiMsgBox.h"
|
||||
#include "../views/ViewController.h"
|
||||
|
||||
#include "../components/TextComponent.h"
|
||||
#include "../components/OptionListComponent.h"
|
||||
|
@ -102,6 +103,15 @@ bool GuiScraperStart::input(InputConfig* config, Input input)
|
|||
return true;
|
||||
}
|
||||
|
||||
if(config->isMappedTo("start", input) && input.value != 0)
|
||||
{
|
||||
// close everything
|
||||
Window* window = mWindow;
|
||||
while(window->peekGui() && window->peekGui() != window->getViewController())
|
||||
delete window->peekGui();
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -109,5 +119,6 @@ std::vector<HelpPrompt> GuiScraperStart::getHelpPrompts()
|
|||
{
|
||||
std::vector<HelpPrompt> prompts = mMenu.getHelpPrompts();
|
||||
prompts.push_back(HelpPrompt("b", "back"));
|
||||
prompts.push_back(HelpPrompt("start", "close"));
|
||||
return prompts;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "GuiSettings.h"
|
||||
#include "../Settings.h"
|
||||
#include "../views/ViewController.h"
|
||||
|
||||
GuiSettings::GuiSettings(Window* window, const char* title) : GuiComponent(window), mMenu(window, title)
|
||||
{
|
||||
|
@ -34,6 +35,14 @@ bool GuiSettings::input(InputConfig* config, Input input)
|
|||
delete this;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(config->isMappedTo("start", input) && input.value != 0)
|
||||
{
|
||||
// close everything
|
||||
Window* window = mWindow;
|
||||
while(window->peekGui() && window->peekGui() != window->getViewController())
|
||||
delete window->peekGui();
|
||||
}
|
||||
|
||||
return GuiComponent::input(config, input);
|
||||
}
|
||||
|
@ -43,6 +52,7 @@ std::vector<HelpPrompt> GuiSettings::getHelpPrompts()
|
|||
std::vector<HelpPrompt> prompts = mMenu.getHelpPrompts();
|
||||
|
||||
prompts.push_back(HelpPrompt("b", "back"));
|
||||
prompts.push_back(HelpPrompt("start", "close"));
|
||||
|
||||
return prompts;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue