Parametrize script extension, default to 'tscript'

This commit is contained in:
Lukas Aldershaab 2020-12-12 16:54:16 +01:00
parent b8b62292bd
commit 099dd4f1f3
542 changed files with 774 additions and 783 deletions

View file

@ -4,7 +4,7 @@
ModuleId="ExampleModule"
VersionId="1"
Group="Game"
scriptFile="ExampleModule.cs"
scriptFile="ExampleModule.tscript"
CreateFunction="onCreate"
DestroyFunction="onDestroy">
<DeclaredAssets

View file

@ -18,7 +18,7 @@ function ExampleModule::onDestroy(%this)
//This is called when the server part of the application is initially created. Torque3D
//assumes, even in a single player context, that there is ultimately a 'server' and a 'client'
//So during initial launch and startup of the engine, the server side is initialized in
//core/clientServer/scripts/server/server.cs - in the initServer() function where this is called.
//core/clientServer/scripts/server/server.tscript - in the initServer() function where this is called.
//This is called on all modules that have this function defined. This is important for
//any persistant parts of the server that always need to run such as gameplay scripts
//
@ -29,15 +29,15 @@ function ExampleModule::onDestroy(%this)
//ExampleGameMode::onMissionReset
//Are called during the startup, shut down, and resetting of any and all active gamemodes, as informed by the loaded scenes
//when the game server is processed.
//These callbacks are activated in core/clientServer/scripts/server/levelLoad.cs
//These callbacks are activated in core/clientServer/scripts/server/levelLoad.tscript
function ExampleModule::initServer(%this)
{
//This script contains our ExampleGameMode logic
%this.queueExec("./scripts/ExampleGamemodeScript.cs");
%this.queueExec("./scripts/ExampleGamemodeScript.tscript");
}
//This is called when a game session server is actually created so the game may be played. It's called
//from core/clientServer/scripts/server/server.cs - in the createServer() function, which is called when
//from core/clientServer/scripts/server/server.tscript - in the createServer() function, which is called when
//A game session is actually launched, and the server is generated so game clients can connect to it.
//This is utilized to set up common things that need to be set up each time the game session server is
//created, such as common variables, datablocks to be transmitted to the client, etc.
@ -50,11 +50,11 @@ function ExampleModule::onCreateGameServer(%this)
//onServerCreated(), it loads the datablocks via this array, and when when the server goes
//to pass data to the client, it iterates over this list and processes it, ensuring all datablocks
//are the most up to date possible for transmission to the connecting client
//%this.registerDatablock("./datablocks/ExampleDatablock.cs");
//%this.registerDatablock("./datablocks/ExampleDatablock.tscript");
}
//This is called when a game session server is destroyed, when the game shuts down. It's called from
//core/clientServer/scripts/server/server.cs - in the destroyServer() function, which just cleans up anything
//core/clientServer/scripts/server/server.tscript - in the destroyServer() function, which just cleans up anything
//The module may have set up as part of the game server being created.
function ExampleModule::onDestroyGameServer(%this)
{
@ -63,7 +63,7 @@ function ExampleModule::onDestroyGameServer(%this)
//Similar to initServer, this is called during the initial launch of the application and the client component
//is set up. The difference is that the client may not actually be created, such as in the case for dedicated servers
//Where no UI or gameplay interface is required. It's called from core/clientServer/scripts/client/client.cs -
//Where no UI or gameplay interface is required. It's called from core/clientServer/scripts/client/client.tscript -
//in the initClient() function. It sets up common elements that the client will always need, such as scripts, GUIs
//and the like
function ExampleModule::initClient(%this)
@ -74,17 +74,17 @@ function ExampleModule::initClient(%this)
//client scripts
//Here, we exec out keybind scripts so the player is able to move when they get into a game
%this.queueExec("./scripts/default.keybinds.cs");
%this.queueExec("./scripts/default.keybinds.tscript");
%prefPath = getPrefpath();
if(isFile(%prefPath @ "/keybinds.cs"))
exec(%prefPath @ "/keybinds.cs");
if(isFile(%prefPath @ "/keybinds.tscript"))
exec(%prefPath @ "/keybinds.tscript");
%this.queueExec("./scripts/inputCommands.cs");
%this.queueExec("./scripts/inputCommands.tscript");
}
//This is called when a game session client successfuly connects to a game server.
//It's called from core/clientServer/scripts/client/connectionToServer.cs - in the GameConnection::onConnectionAccepted() function
//It's called from core/clientServer/scripts/client/connectionToServer.tscript - in the GameConnection::onConnectionAccepted() function
//It's used for any client-side specific game session stuff that the client needs to load or pass to the server, such as profile data
//account progress, preferences, etc.
//
@ -96,7 +96,7 @@ function ExampleModule::onCreateClientConnection(%this)
}
//This is called when a client game session disconnects from a game server
//It's called from core/clientServer/scripts/client/connectionToServer.cs - in the disconnectedCleanup() function
//It's called from core/clientServer/scripts/client/connectionToServer.tscript - in the disconnectedCleanup() function
//It's used to clean up and potentially write out any client-side stuff that needs housekeeping when disconnecting for any reason.
//It will be called if the connection is manually terminated, or lost due to any sort of connection issue.
//

View file

@ -7,7 +7,7 @@
//ExampleGameMode::onMissionReset
//ExampleGameMode::onMissionEnd
//Are the primary hooks for the server to start, restart and end any active gamemodes
//onMissionStart, for example is called from core/clientServer/scripts/server/levelLoad.cs
//onMissionStart, for example is called from core/clientServer/scripts/server/levelLoad.tscript
//It's called once the server has successfully loaded the level, and has parsed
//through any active scenes to get GameModeNames defined by them. It then iterates
//over them and calls these callbacks to envoke gamemode behaviors. This allows multiple
@ -128,7 +128,7 @@ function ExampleGameMode::onClientConnect(%this, %client)
//This is called when a client enters the game server. It's used to spawn a player object
//set up any client-specific properties such as saved configs, values, their name, etc
//These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs
//These callbacks are activated in core/clientServer/scripts/server/levelDownload.tscript
function ExampleGameMode::onClientEnterGame(%this, %client)
{
//Set the player name based on the client's connection data
@ -139,7 +139,7 @@ function ExampleGameMode::onClientEnterGame(%this, %client)
//This is called when the player leaves the game server. It's used to clean up anything that
//was spawned or setup for the client when it connected, in onClientEnterGame
//These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs
//These callbacks are activated in core/clientServer/scripts/server/levelDownload.tscript
function ExampleGameMode::onClientLeaveGame(%this, %client)
{
// Cleanup the camera

View file

@ -4,7 +4,7 @@
ModuleId="Prototyping"
VersionId="1"
Group="Game"
scriptFile="Prototyping.cs"
scriptFile="Prototyping.tscript"
CreateFunction="onCreate"
DestroyFunction="onDestroy">
<DeclaredAssets

View file

@ -2,7 +2,7 @@
ModuleId="gameUI"
VersionId="1"
Description="Basic Game GUI."
ScriptFile="gameUI.cs"
ScriptFile="gameUI.tscript"
CreateFunction="create"
DestroyFunction="destroy"
Group="Game"

View file

@ -16,7 +16,7 @@ function gameUI::initClient(%this)
{
//guis
%this.queueExec("./GUIs/playGui.gui");
%this.queueExec("./GUIs/playGui.cs");
%this.queueExec("./GUIs/playGui.tscript");
}
function gameUI::onCreateClientConnection(%this){}

View file

@ -2,7 +2,7 @@
ModuleId="UI"
VersionId="1"
Description="Module that implements the menus for the game."
ScriptFile="UI.cs"
ScriptFile="UI.tscript"
CreateFunction="onCreate"
DestroyFunction="onDestroy"
Group="Game">

View file

@ -30,55 +30,55 @@ function UI::initClient(%this)
{
//Load UI stuff
//we need to load this because some of the menu profiles use the sounds here
//%this.queueExec("./datablocks/guiSounds.cs");
//%this.queueExec("./datablocks/guiSounds.tscript");
//Profiles
%this.queueExec("./scripts/profiles.cs");
%this.queueExec("./scripts/profiles.tscript");
//Now gui files
%this.queueExec("./scripts/menuInputButtons.cs");
%this.queueExec("./scripts/menuInputButtons.tscript");
%this.queueExec("./guis/mainMenu.cs");
%this.queueExec("./guis/mainMenu.tscript");
%this.queueExec("./guis/mainMenu.gui");
%this.queueExec("./guis/chooseLevelDlg.cs");
%this.queueExec("./guis/chooseLevelDlg.tscript");
%this.queueExec("./guis/chooseLevelDlg.gui");
%this.queueExec("./guis/joinServerMenu.cs");
%this.queueExec("./guis/joinServerMenu.tscript");
%this.queueExec("./guis/joinServerMenu.gui");
%this.queueExec("./guis/loadingGui.gui");
%this.queueExec("./guis/optionsMenu.cs");
%this.queueExec("./guis/optionsMenu.tscript");
%this.queueExec("./guis/optionsMenu.gui");
%this.queueExec("./guis/pauseMenu.cs");
%this.queueExec("./guis/pauseMenu.tscript");
%this.queueExec("./guis/pauseMenu.gui");
%this.queueExec("./guis/remapDlg.gui");
%this.queueExec("./guis/remapConfirmDlg.gui");
%this.queueExec("./guis/profiler.cs");
%this.queueExec("./guis/profiler.tscript");
%this.queueExec("./guis/profiler.gui");
%this.queueExec("./guis/netGraphGui.gui");
%this.queueExec("./guis/RecordingsDlg.gui");
%this.queueExec("./guis/guiMusicPlayer.cs");
%this.queueExec("./guis/guiMusicPlayer.tscript");
%this.queueExec("./guis/guiMusicPlayer.gui");
%this.queueExec("./guis/startupGui.cs");
%this.queueExec("./guis/startupGui.tscript");
%this.queueExec("./guis/startupGui.gui");
// Load Editor Dialogs
%this.queueExec("./guis/messageBoxDlg.gui");
//Load scripts
%this.queueExec("./scripts/controlsMenu.cs");
%this.queueExec("./scripts/messageBoxes.cs");
%this.queueExec("./scripts/help.cs");
%this.queueExec("./scripts/cursors.cs");
%this.queueExec("./scripts/utility.cs");
%this.queueExec("./scripts/controlsMenu.tscript");
%this.queueExec("./scripts/messageBoxes.tscript");
%this.queueExec("./scripts/help.tscript");
%this.queueExec("./scripts/cursors.tscript");
%this.queueExec("./scripts/utility.tscript");
}
function UI::onCreateClientConnection(%this){}

View file

@ -1,4 +1,4 @@
exec( "tools/gui/profiles.ed.cs" );
exec( "tools/gui/profiles.ed.tscript" );
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) {

View file

@ -99,7 +99,7 @@ function OptionsMenu::apply(%this)
if(%actionMap == GlobalActionMap.getId())
continue;
%actionMap.save( %prefPath @ "/keybinds.cs", %append );
%actionMap.save( %prefPath @ "/keybinds.tscript", %append );
if(%append != true)
%append = true;
@ -107,7 +107,7 @@ function OptionsMenu::apply(%this)
}
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
export("$pref::*", %prefPath @ "/clientPrefs.tscript", false);
}
function OptionsMenu::resetToDefaults(%this)
@ -290,7 +290,7 @@ function OptionsMenu::applyDisplaySettings(%this)
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
export("$pref::*", %prefPath @ "/clientPrefs.tscript", false);
}
function OptionsMenu::populateGraphicsSettingsList(%this)
@ -386,7 +386,7 @@ function OptionsMenu::applyGraphicsSettings(%this)
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
export("$pref::*", %prefPath @ "/clientPrefs.tscript", false);
}
function updateDisplaySettings()