Improve handling of non-default script filenames

This commit is contained in:
Lukas Aldershaab 2021-01-07 12:01:09 +01:00
parent 099dd4f1f3
commit 9ccaa6d3ea
118 changed files with 534 additions and 528 deletions

View file

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

View file

@ -33,7 +33,7 @@ function ExampleModule::onDestroy(%this)
function ExampleModule::initServer(%this)
{
//This script contains our ExampleGameMode logic
%this.queueExec("./scripts/ExampleGamemodeScript.tscript");
%this.queueExec("./scripts/ExampleGamemodeScript." @ $TorqueScriptFileExtension);
}
//This is called when a game session server is actually created so the game may be played. It's called
@ -50,7 +50,7 @@ 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.tscript");
//%this.registerDatablock("./datablocks/ExampleDatablock." @ $TorqueScriptFileExtension);
}
//This is called when a game session server is destroyed, when the game shuts down. It's called from
@ -74,13 +74,13 @@ 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.tscript");
%this.queueExec("./scripts/default.keybinds." @ $TorqueScriptFileExtension);
%prefPath = getPrefpath();
if(isFile(%prefPath @ "/keybinds.tscript"))
exec(%prefPath @ "/keybinds.tscript");
if(isFile(%prefPath @ "/keybinds." @ $TorqueScriptFileExtension))
exec(%prefPath @ "/keybinds." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/inputCommands.tscript");
%this.queueExec("./scripts/inputCommands." @ $TorqueScriptFileExtension);
}
//This is called when a game session client successfuly connects to a game server.

View file

@ -16,7 +16,7 @@ function gameUI::initClient(%this)
{
//guis
%this.queueExec("./GUIs/playGui.gui");
%this.queueExec("./GUIs/playGui.tscript");
%this.queueExec("./GUIs/playGui." @ $TorqueScriptFileExtension);
}
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.tscript"
ScriptFile="UI"
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.tscript");
//%this.queueExec("./datablocks/guiSounds." @ $TorqueScriptFileExtension);
//Profiles
%this.queueExec("./scripts/profiles.tscript");
%this.queueExec("./scripts/profiles." @ $TorqueScriptFileExtension);
//Now gui files
%this.queueExec("./scripts/menuInputButtons.tscript");
%this.queueExec("./scripts/menuInputButtons." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/mainMenu.tscript");
%this.queueExec("./guis/mainMenu." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/mainMenu.gui");
%this.queueExec("./guis/chooseLevelDlg.tscript");
%this.queueExec("./guis/chooseLevelDlg." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/chooseLevelDlg.gui");
%this.queueExec("./guis/joinServerMenu.tscript");
%this.queueExec("./guis/joinServerMenu." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/joinServerMenu.gui");
%this.queueExec("./guis/loadingGui.gui");
%this.queueExec("./guis/optionsMenu.tscript");
%this.queueExec("./guis/optionsMenu." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/optionsMenu.gui");
%this.queueExec("./guis/pauseMenu.tscript");
%this.queueExec("./guis/pauseMenu." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/pauseMenu.gui");
%this.queueExec("./guis/remapDlg.gui");
%this.queueExec("./guis/remapConfirmDlg.gui");
%this.queueExec("./guis/profiler.tscript");
%this.queueExec("./guis/profiler." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/profiler.gui");
%this.queueExec("./guis/netGraphGui.gui");
%this.queueExec("./guis/RecordingsDlg.gui");
%this.queueExec("./guis/guiMusicPlayer.tscript");
%this.queueExec("./guis/guiMusicPlayer." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/guiMusicPlayer.gui");
%this.queueExec("./guis/startupGui.tscript");
%this.queueExec("./guis/startupGui." @ $TorqueScriptFileExtension);
%this.queueExec("./guis/startupGui.gui");
// Load Editor Dialogs
%this.queueExec("./guis/messageBoxDlg.gui");
//Load scripts
%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");
%this.queueExec("./scripts/controlsMenu." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/messageBoxes." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/help." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/cursors." @ $TorqueScriptFileExtension);
%this.queueExec("./scripts/utility." @ $TorqueScriptFileExtension);
}
function UI::onCreateClientConnection(%this){}

View file

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