2020-05-20 17:19:52 -05:00
|
|
|
function MainMenuGui::onAdd(%this)
|
|
|
|
|
{
|
2020-07-23 00:22:15 -05:00
|
|
|
$activeControllerName = "K&M"; //default input type
|
2020-05-20 17:19:52 -05:00
|
|
|
}
|
|
|
|
|
|
2019-08-29 00:22:33 -05:00
|
|
|
function MainMenuGui::onWake(%this)
|
|
|
|
|
{
|
2022-05-09 16:17:22 -05:00
|
|
|
//In the BaseUI example case, the MainMenuGUI acts as our background
|
|
|
|
|
//So it's a logical control to set as our UINavigation as well. So we
|
|
|
|
|
//set the MainMenuGUI's superClass to UINavigation to integrate it into
|
|
|
|
|
//that namespace to open up page navigation
|
|
|
|
|
|
|
|
|
|
//At the same time, the MainMenuGUI control has the button holder, set to
|
|
|
|
|
//the MenuInputButtonContainer class, allowing us to set it as the active button
|
|
|
|
|
//holder here, prepping it for catching any button inputs to active commands
|
|
|
|
|
//Specifically, it sets the $activeMenuButtonContainer to be this, which allows
|
|
|
|
|
//other controls to manage what the behavior of the buttons is consistently
|
|
|
|
|
//without needing to worry about hardcoded names
|
2020-07-23 00:22:15 -05:00
|
|
|
MainMenuButtonHolder.setActive();
|
2022-05-09 16:17:22 -05:00
|
|
|
|
|
|
|
|
//We also have the MainMenuInputHandler, a GuiInputCtrl with the MenuInputHandler class
|
|
|
|
|
//This allows us to catch any input/axis event and pass it along to the active menuList
|
|
|
|
|
//or button containers to navigate the menus
|
|
|
|
|
//We set up this catch by making said control our first responder, here
|
2022-02-17 18:21:13 -06:00
|
|
|
MainMenuInputHandler.setFirstResponder();
|
2022-05-06 23:39:16 -05:00
|
|
|
|
2022-05-09 16:17:22 -05:00
|
|
|
//We also go ahead and mark for any future pages being added to the UINavigation's page stack
|
|
|
|
|
//to be prompted to resize when added. This isn't required, but helps keep pages formated to
|
|
|
|
|
//the current size of the UINavigation, which is useful when dealing with aspect ratio or resolution
|
|
|
|
|
//changes.
|
2022-05-06 23:39:16 -05:00
|
|
|
%this.resizePages = true;
|
2022-06-02 20:17:23 -05:00
|
|
|
//Lastly, we go ahead and display some actual navigable content up on our main menu here
|
|
|
|
|
//In this case, we set the MainMenuButtons as our root page, so we always come back
|
|
|
|
|
//to having the main menu buttons on screen if every other page is closed.
|
|
|
|
|
//This will ultimately call MainMenuButtons::onOpen(), so to see where the navigation
|
|
|
|
|
//chain continues, see that function.
|
|
|
|
|
%this.setRootPage(MainMenuButtons);
|
2022-06-05 01:21:38 -05:00
|
|
|
|
|
|
|
|
%this.refreshPage();
|
2020-05-20 17:19:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MainMenuButtonHolder::onWake(%this)
|
|
|
|
|
{
|
2022-05-09 16:17:22 -05:00
|
|
|
//Because the blan slate MainMenuGUI doesn't have anything we need to bother with inputs on
|
|
|
|
|
//we just go ahead and disable all the buttons in our MainMenuButtonHolder to have
|
|
|
|
|
// a clean slate
|
2022-05-06 23:39:16 -05:00
|
|
|
%this-->button1.disable();
|
|
|
|
|
%this-->button2.disable();
|
|
|
|
|
%this-->button3.disable();
|
|
|
|
|
%this-->button4.disable();
|
|
|
|
|
%this-->button5.disable();
|
|
|
|
|
}
|