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().
|
|
|
|
|
|
|
|
|
|
function UI::create( %this )
|
|
|
|
|
{
|
|
|
|
|
if ($Server::Dedicated)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Use our prefs to configure our Canvas/Window
|
|
|
|
|
configureCanvas();
|
|
|
|
|
|
|
|
|
|
//Load UI stuff
|
|
|
|
|
//we need to load this because some of the menu profiles use the sounds here
|
|
|
|
|
exec("./scripts/datablocks/guiSounds.cs");
|
|
|
|
|
|
|
|
|
|
//Profiles
|
|
|
|
|
exec("./scripts/profiles.cs");
|
|
|
|
|
|
|
|
|
|
//Now gui files
|
|
|
|
|
exec("./scripts/guis/mainMenu.gui");
|
|
|
|
|
exec("./scripts/guis/chooseLevelDlg.gui");
|
|
|
|
|
exec("./scripts/guis/joinServerMenu.gui");
|
|
|
|
|
exec("./scripts/guis/loadingGui.gui");
|
|
|
|
|
exec("./scripts/guis/optionsMenu.gui");
|
|
|
|
|
exec("./scripts/guis/pauseMenu.gui");
|
|
|
|
|
exec("./scripts/guis/remapDlg.gui");
|
|
|
|
|
exec("./scripts/guis/remapConfirmDlg.gui");
|
|
|
|
|
|
|
|
|
|
exec("./scripts/guis/profiler.gui");
|
|
|
|
|
exec("./scripts/guis/netGraphGui.gui");
|
2019-07-25 04:33:45 +00:00
|
|
|
exec("./scripts/guis/RecordingsDlg.gui");
|
2017-03-27 05:36:23 +00:00
|
|
|
exec("./scripts/guis/FileDialog.gui");
|
2017-03-26 22:53:01 +00:00
|
|
|
exec("./scripts/guis/guiMusicPlayer.gui");
|
2017-03-27 05:36:23 +00:00
|
|
|
exec("./scripts/guis/startupGui.gui");
|
2017-02-24 08:40:56 +00:00
|
|
|
|
|
|
|
|
//Load gui companion scripts
|
|
|
|
|
exec("./scripts/chooseLevelDlg.cs");
|
|
|
|
|
exec("./scripts/optionsList.cs");
|
|
|
|
|
exec("./scripts/optionsMenu.cs");
|
|
|
|
|
exec("./scripts/graphicsMenu.cs");
|
|
|
|
|
exec("./scripts/controlsMenu.cs");
|
|
|
|
|
exec("./scripts/chooseLevelDlg.cs");
|
|
|
|
|
exec("./scripts/mainMenu.cs");
|
|
|
|
|
exec("./scripts/joinServerMenu.cs");
|
|
|
|
|
exec("./scripts/pauseMenu.cs");
|
|
|
|
|
exec("./scripts/messageBoxes.cs");
|
2017-03-26 22:53:01 +00:00
|
|
|
exec("./scripts/help.cs");
|
|
|
|
|
exec("./scripts/cursors.cs");
|
|
|
|
|
exec("./scripts/profiler.cs");
|
|
|
|
|
exec("./scripts/FileDialog.cs");
|
|
|
|
|
exec("./scripts/GuiTreeViewCtrl.cs");
|
|
|
|
|
exec("./scripts/guiMusicPlayer.cs");
|
2017-03-27 05:36:23 +00:00
|
|
|
exec("./scripts/startupGui.cs");
|
2017-02-24 08:40:56 +00:00
|
|
|
|
|
|
|
|
%dbList = new ArrayObject(LevelFilesList);
|
|
|
|
|
|
2017-03-27 05:36:23 +00:00
|
|
|
loadStartup();
|
2017-02-24 08:40:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Game::destroy( %this )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|