Torque3D/Templates/BaseGame/game/data/UI/guis/MainMenuButtons.tscript
JeffR 41add628ad Implements a more standardized way to format usual UI pages by having the ability to utilize the UINavigation namespace for page stack navigation
Also fixes behavior handling of menu input buttons not refreshing reliably
Adds ability to define a control on a MenuList to act as a highlighter over the currently selected control
Cleaned up BaseUI pages to use UINavigation which reduced a lot of duplication of elements and code
2022-05-06 23:39:16 -05:00

67 lines
1.3 KiB
Plaintext

function MainMenuButtons::onWake(%this)
{
}
function MainMenuButtons::onSleep(%this)
{
}
//Optional, as the check defaults to true, but here as an example case
function MainMenuButtonList::canOpen(%this)
{
return true;
}
function MainMenuButtonList::onOpen(%this)
{
MainMenuButtonList.setAsActiveMenuList();
$activeMenuButtonContainer-->button1.disable();
$activeMenuButtonContainer-->button2.disable();
$activeMenuButtonContainer-->button3.disable();
$activeMenuButtonContainer-->button4.set("btn_a", "Return", "Go", "MainMenuButtonList.activate();");
$activeMenuButtonContainer-->button5.disable();
}
//Optional, as the check defaults to true, but here as an example case
function MainMenuButtonList::canClose(%this)
{
return true;
}
function MainMenuButtonList::onClose(%this)
{
}
function openSinglePlayerMenu()
{
$pref::HostMultiPlayer=false;
MainMenuGui.pushPage(ChooseLevelDlg);
}
function openMultiPlayerMenu()
{
$pref::HostMultiPlayer=true;
MainMenuGui.pushPage(ChooseLevelDlg);
}
function openJoinServerMenu()
{
MainMenuGui.pushPage(JoinServerMenu);
}
function openOptionsMenu()
{
MainMenuGui.pushPage(OptionsMenu);
}
function openWorldEditorBtn()
{
fastLoadWorldEdit(1);
}
function openGUIEditorBtn()
{
fastLoadGUIEdit(1);
}