Torque3D/Templates/BaseGame/game/data/ui/guis/mainMenu.cs
Areloch ef4cc8b573 Updated names of some of the input images to match the names of the inputs to simplify lookups
Altered a few of the input images to improve readability of some of the text
Standardizes the menuInputButton set usage to just use the raw action names rather than a middleman naming scheme for simplicity and standardization
Added comments to menuInputButtons.cs
Split out the menuInputButton containers to simplify and stabilize the code on the messageBox dialog
Removed old reference to script/gui files not there anymore
Simplified the input state check in guiGameListMenuCtrl.cpp
Added a check so we don't try exec'ing the selected list item in guiGameListMenuCtrl.cpp if nothing has actually be selected
2020-07-23 16:26:38 -05:00

79 lines
1.9 KiB
C#

function MainMenuGui::onAdd(%this)
{
$activeControllerName = "K&M"; //default input type
}
function MainMenuGui::onWake(%this)
{
MainMenuButtonList.hidden = false;
MainMenuButtonHolder.setActive();
}
function MainMenuGui::onSleep(%this)
{
MainMenuButtonHolder.hidden = true;
}
function MainMenuButtonHolder::onWake(%this)
{
%this-->goButton.set("btn_a", "Return", "Go", "MainMenuButtonList.activateRow();");
}
function MainMenuButtonList::onAdd(%this)
{
MainMenuButtonList.addRow("Single Player", "openSinglePlayerMenu", 0);
MainMenuButtonList.addRow("Create Server", "openMultiPlayerMenu", 4, -15);
MainMenuButtonList.addRow("Join Server", "openJoinServerMenu", 4, -15);
MainMenuButtonList.addRow("Options", "openOptionsMenu", 6, -15);
MainMenuButtonList.addRow("Open World Editor", "openWorldEditorBtn", 6, -15);
MainMenuButtonList.addRow("Open GUI Editor", "openGUIEditorBtn", 6, -15);
MainMenuButtonList.addRow("Exit Game", "quit", 8, -15);
}
function openSinglePlayerMenu()
{
$pref::HostMultiPlayer=false;
Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true;
MainMenuButtonHolder.hidden = true;
}
function openMultiPlayerMenu()
{
$pref::HostMultiPlayer=true;
Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true;
}
function openJoinServerMenu()
{
Canvas.pushDialog(JoinServerMenu);
JoinServerMenu.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true;
}
function openOptionsMenu()
{
Canvas.pushDialog(OptionsMenu);
OptionsMenu.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true;
}
function openWorldEditorBtn()
{
fastLoadWorldEdit(1);
}
function openGUIEditorBtn()
{
fastLoadGUIEdit(1);
}
function MainMenuGui::onReturnTo(%this)
{
MainMenuButtonList.hidden = false;
MainMenuButtonList.setFirstResponder();
MainMenuButtonHolder.setActive();
}