Torque3D/Templates/BaseGame/game/main.cs.in
Areloch 99cee7f32a Caught the main modules up to new module script file paradigm
Have initServer only get called when a server is actually started for the first time
Added utility method callGamemodeFunction to streamline exec'ing of gamemode function calls
Added onClientConnect gamemode function, called when the client establishes the connection
Added onInitialControlSet gamemode function, called when the client actively gains control in the game, to allow gamemodes to special override GUI settings or input commands
Cleaned up init'ng of the engine so stock UI module isn't required to trip configuration of the canvas
Added fallback so if nothing set the main content control for the UI after boot, we attempt to set the defined mainMenuGUI, on the chance nothing explicitly sets it on load
2019-09-02 16:13:24 -05:00

41 lines
No EOL
1.2 KiB
C#

$Core::windowIcon = "data/icon.png";
$Core::splashWindowImage = "data/splash.png";
// Display a splash window immediately to improve app responsiveness before
// engine is initialized and main window created.
displaySplashWindow($Core::splashWindowImage);
// Console does something.
setLogMode(6);
// Disable script trace.
trace(false);
// Set the name of our application
$appName = "@TORQUE_APP_NAME@";
//-----------------------------------------------------------------------------
// Load up scripts to initialise subsystems.
ModuleDatabase.setModuleExtension("module");
ModuleDatabase.scanModules( "core", false );
ModuleDatabase.LoadExplicit( "CoreModule" );
//-----------------------------------------------------------------------------
// Load any gameplay modules
ModuleDatabase.scanModules( "data", false );
ModuleDatabase.LoadGroup( "Game" );
//Finally, initialize the client/server structure
ModuleDatabase.LoadExplicit( "Core_ClientServer" );
//If nothing else set a main menu, try to do so now
if(!isObject(Canvas.getContent()))
{
%mainMenuGUI = ProjectSettings.value("UI/mainMenuName");
if (isObject( %mainMenuGUI ))
Canvas.setContent( %mainMenuGUI );
}
closeSplashWindow();
echo("Engine initialized...");