mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-02 02:51:00 +00:00
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
67 lines
1.3 KiB
Plaintext
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);
|
|
} |