mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-01 19:43:49 +00:00
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
This commit is contained in:
parent
22db2d4291
commit
41add628ad
20 changed files with 811 additions and 1217 deletions
67
Templates/BaseGame/game/data/UI/guis/MainMenuButtons.tscript
Normal file
67
Templates/BaseGame/game/data/UI/guis/MainMenuButtons.tscript
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue