2017-02-24 08:40:56 +00:00
|
|
|
|
|
|
|
|
// 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().
|
|
|
|
|
|
2019-09-02 21:13:24 +00:00
|
|
|
function UI::onCreate( %this )
|
2017-02-24 08:40:56 +00:00
|
|
|
{
|
2023-06-22 22:52:32 +00:00
|
|
|
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");
|
2019-08-29 05:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-02 21:13:24 +00:00
|
|
|
function UI::onDestroy( %this )
|
2019-08-29 05:22:33 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function UI::initServer(%this){}
|
|
|
|
|
|
2019-09-02 21:13:24 +00:00
|
|
|
function UI::onCreateGameServer(%this){}
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2019-09-02 21:13:24 +00:00
|
|
|
function UI::onDestroyGameServer(%this){}
|
2019-08-29 05:22:33 +00:00
|
|
|
|
|
|
|
|
function UI::initClient(%this)
|
|
|
|
|
{
|
2017-02-24 08:40:56 +00:00
|
|
|
//Load UI stuff
|
|
|
|
|
//Profiles
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./scripts/profiles");
|
2023-12-17 05:18:33 +00:00
|
|
|
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./guis/mainMenu");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/mainMenu.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2023-12-17 05:18:33 +00:00
|
|
|
%this.queueExec("./guis/ChooseLevelMenu");
|
|
|
|
|
%this.queueExec("./guis/ChooseLevelMenu.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./guis/joinServerMenu");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/joinServerMenu.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/loadingGui.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./guis/optionsMenu");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/optionsMenu.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2023-12-17 05:18:33 +00:00
|
|
|
%this.queueExec("./guis/GameMenu");
|
|
|
|
|
%this.queueExec("./guis/GameMenu.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/remapDlg.gui");
|
|
|
|
|
%this.queueExec("./guis/remapConfirmDlg.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./guis/profiler");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/profiler.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/netGraphGui.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./guis/startupGui");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/startupGui.gui");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
2023-12-17 05:18:33 +00:00
|
|
|
%this.queueExec("./guis/messageBoxDlg");
|
2020-10-05 20:50:45 +00:00
|
|
|
%this.queueExec("./guis/messageBoxDlg.gui");
|
2019-09-29 12:51:43 +00:00
|
|
|
|
2023-12-17 05:18:33 +00:00
|
|
|
%this.queueExec("./guis/SystemMenu");
|
|
|
|
|
%this.queueExec("./guis/SystemMenu.gui");
|
|
|
|
|
|
2019-08-29 05:22:33 +00:00
|
|
|
//Load scripts
|
2021-07-20 16:02:38 +00:00
|
|
|
%this.queueExec("./scripts/controlsMenu");
|
|
|
|
|
%this.queueExec("./scripts/cursors");
|
2022-05-10 01:57:42 +00:00
|
|
|
|
|
|
|
|
if(isToolBuild())
|
|
|
|
|
%this.queueExec("./tools/creator.tscript");
|
2017-02-24 08:40:56 +00:00
|
|
|
}
|
|
|
|
|
|
2019-08-29 05:22:33 +00:00
|
|
|
function UI::onCreateClientConnection(%this){}
|
|
|
|
|
|
2022-02-23 02:12:39 +00:00
|
|
|
function UI::onDestroyClientConnection(%this){}
|
2023-12-17 05:18:33 +00:00
|
|
|
|
|
|
|
|
function UI::registerGameMenus(%this, %menusArrayObj)
|
|
|
|
|
{
|
|
|
|
|
%menusArrayObj.add("System", SystemMenu);
|
|
|
|
|
}
|