Torque3D/Templates/BaseGame/game/data/UI/UI.tscript
Areloch ae8eca48e1 Implementation of Subscenes, SceneGroups and Gamemodes
Standardizes Gamemodes to be an actual class with data and utility functions that can be parsed
Adds inspector field handling for selecting gamemodes
Updated Scene class to work with Gamemodes for the gamemode field
Updates editor suite elements to be able to create SubScenes, SceneGroups and Gamemodes
Adds ability to convert SimGroup to SubScene
Updates BaseUI's chooselevel menu to have gamemode selection and filters shown levels based on selected gamemode
2024-09-01 16:39:00 -05:00

107 lines
3 KiB
Plaintext

// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
// First, a client will always create a server in the event that they want to host a single player
// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
// in the networking short-circuited to sidestep around lag and packet transmission times.
// initServer() is called, loading the default server scripts.
// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
// to prep a playable client session.
// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
// connected to it via createAndConnectToLocalServer().
function UI::onCreate( %this )
{
exec("./scripts/utility");
// create and set as core a defaultTable LanguageTable for localization purposes
// example usage for quick language appending
// addLanguage("defaultTable","check","ch");
// addLanguage("defaultTable","try","tr");
createLangTable("defaultTable");
setCoreLangTable("defaultTable");
exec("./langs/languageMap");
}
function UI::onDestroy( %this )
{
}
function UI::initServer(%this){}
function UI::onCreateGameServer(%this){}
function UI::onDestroyGameServer(%this){}
function UI::initClient(%this)
{
//Load UI stuff
//Profiles
%this.queueExec("./scripts/profiles");
%this.queueExec("./guis/mainMenu");
%this.queueExec("./guis/mainMenu.gui");
%this.queueExec("./guis/ChooseLevelMenu");
%this.queueExec("./guis/ChooseLevelMenu.gui");
%this.queueExec("./guis/joinServerMenu");
%this.queueExec("./guis/joinServerMenu.gui");
%this.queueExec("./guis/loadingGui.gui");
%this.queueExec("./guis/optionsMenu");
%this.queueExec("./guis/optionsMenu.gui");
%this.queueExec("./guis/GameMenu");
%this.queueExec("./guis/GameMenu.gui");
%this.queueExec("./guis/remapDlg");
%this.queueExec("./guis/remapDlg.gui");
%this.queueExec("./guis/remapConfirmDlg.gui");
%this.queueExec("./guis/profiler");
%this.queueExec("./guis/profiler.gui");
%this.queueExec("./guis/netGraphGui.gui");
%this.queueExec("./guis/startupGui");
%this.queueExec("./guis/startupGui.gui");
%this.queueExec("./guis/messageBoxDlg");
%this.queueExec("./guis/messageBoxDlg.gui");
%this.queueExec("./guis/SystemMenu");
%this.queueExec("./guis/SystemMenu.gui");
//Load scripts
%this.queueExec("./scripts/controlsMenu");
%this.queueExec("./scripts/cursors");
if(isToolBuild())
%this.queueExec("./tools/creator.tscript");
//GameMenu actionmap
%this.queueExec("./scripts/defaultKeybinds.tscript");
}
function UI::onCreateClientConnection(%this)
{
GameMenuToggleActionMap.push();
}
function UI::onDestroyClientConnection(%this)
{
GameMenuToggleActionMap.pop();
}
function UI::registerGameMenus(%this, %menusArrayObj)
{
%menusArrayObj.add("System", SystemMenu);
}
function listLevelsAndGameModes()
{
}