Start now closes most submenus.

This commit is contained in:
Aloshi 2014-04-30 11:55:10 -05:00
parent fc96849f08
commit 63113aeea7
2 changed files with 21 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;
}