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

@ -34,7 +34,7 @@ function initializeEditorClasses()
// Load Editor Profiles
//-----------------------------------------------------------------------------
exec("./scripts/fileLoader.ed.tscript");
exec("./scripts/fileLoader.ed." @ $TorqueScriptFileExtension);
loadDirectory( expandFilename("./gui/panels") );
@ -43,39 +43,39 @@ function initializeEditorClasses()
// Setup Preferences Manager
//-----------------------------------------------------------------------------
exec("./scripts/preferencesManager.ed.tscript");
exec("./scripts/preferencesManager.ed." @ $TorqueScriptFileExtension);
initPreferencesManager();
//-----------------------------------------------------------------------------
// Load Form Managers
//-----------------------------------------------------------------------------
exec("./scripts/guiFormLibraryManager.ed.tscript");
exec("./scripts/guiFormContentManager.ed.tscript");
exec("./scripts/guiFormReferenceManager.ed.tscript");
exec("./scripts/guiFormLayoutManager.ed.tscript");
exec("./scripts/guiFormMessageManager.ed.tscript");
exec("./scripts/expandos.ed.tscript");
exec("./scripts/utility.ed.tscript");
exec("./scripts/guiFormLibraryManager.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiFormContentManager.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiFormReferenceManager.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiFormLayoutManager.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiFormMessageManager.ed." @ $TorqueScriptFileExtension);
exec("./scripts/expandos.ed." @ $TorqueScriptFileExtension);
exec("./scripts/utility.ed." @ $TorqueScriptFileExtension);
setupBaseExpandos();
// User Display
exec("./scripts/contextPopup.ed.tscript");
exec("./scripts/contextPopup.ed." @ $TorqueScriptFileExtension);
// Project Support
exec("./scripts/projects/projectEvents.ed.tscript");
exec("./scripts/projects/projectInternalInterface.ed.tscript");
exec("./scripts/projects/projectEvents.ed." @ $TorqueScriptFileExtension);
exec("./scripts/projects/projectInternalInterface.ed." @ $TorqueScriptFileExtension);
// Input
exec("./scripts/input/inputEvents.ed.tscript");
exec("./scripts/input/dragDropEvents.ed.tscript");
exec("./scripts/input/applicationEvents.ed.tscript");
exec("./scripts/input/inputEvents.ed." @ $TorqueScriptFileExtension);
exec("./scripts/input/dragDropEvents.ed." @ $TorqueScriptFileExtension);
exec("./scripts/input/applicationEvents.ed." @ $TorqueScriptFileExtension);
// Form Class
exec("./scripts/guiFormClass.ed.tscript");
exec("./scripts/guiClasses/guiThumbnailPopup.ed.tscript");
exec("./scripts/guiClasses/guiThumbnail.ed.tscript");
exec("./scripts/RSSNews/RSSFeedScript.ed.tscript");
exec("./scripts/guiFormClass.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiClasses/guiThumbnailPopup.ed." @ $TorqueScriptFileExtension);
exec("./scripts/guiClasses/guiThumbnail.ed." @ $TorqueScriptFileExtension);
exec("./scripts/RSSNews/RSSFeedScript.ed." @ $TorqueScriptFileExtension);
loadDirectory( expandFilename("./scripts/core") );
loadDirectory( expandFilename("./scripts/platform") );

View file

@ -28,7 +28,7 @@ $RSSFeed::userAgent = "TorqueGameEngineAdvances/1.1";
$RSSFeed::maxNewHeadlines = 10;
// Load up the helper objects
exec( "./RSSStructs.ed.tscript" );
exec( "./RSSStructs.ed." @ $TorqueScriptFileExtension );
function RSSFeedObject::onConnected(%this)
{
@ -93,7 +93,7 @@ function RSSFeedObject::onDisconnect(%this)
{
// Create collection and load cache.
%ret = constructRSSHeadlineCollection();
%ret.loadFromFile( "RSSCache.tscript" );
%ret.loadFromFile( "RSSCache." @ $TorqueScriptFileExtension );
// Ok, we have a full buffer now, hopefully. Let's process it.
//echo(" - Got " @ $RSSFeed::lineCount @ " lines.");
@ -137,7 +137,7 @@ function RSSFeedObject::onDisconnect(%this)
eval( %this._callback @ "(" @ %params @ ");" );
}
%ret.writeToFile( "RSSCache.tscript", false );
%ret.writeToFile( "RSSCache." @ $TorqueScriptFileExtension, false );
}
function RSSUpdate::initialize( %callback )

View file

@ -26,11 +26,11 @@ function setupBaseExpandos()
// FIXME TGEA doesnt currently have these due to the way it's built
return;
setScriptPathExpando("tools", getExecutablePath() @ "/tools", true);
setScriptPathExpando("tool", getExecutablePath() , true);
setScriptPathExpando("toolResources", getExecutablePath() @ "/resources", true);
se" @ $TorqueScriptFileExtension @ "PathExpando("tools", getExecutablePath() @ "/tools", true);
se" @ $TorqueScriptFileExtension @ "PathExpando("tool", getExecutablePath() , true);
se" @ $TorqueScriptFileExtension @ "PathExpando("toolResources", getExecutablePath() @ "/resources", true);
setScriptPathExpando("core", getExecutablePath() @ "/core", true);
se" @ $TorqueScriptFileExtension @ "PathExpando("core", getExecutablePath() @ "/core", true);
// Remove the game expando so we can use this to reset expandos
removeScriptPathExpando("game");

View file

@ -23,7 +23,7 @@
function loadDirectory(%path, %type, %dsoType)
{
if( %type $= "" )
%type = "ed.tscript";
%type = "ed." @ $TorqueScriptFileExtension;
if( %dsoType $= "" )
%dsoType = "edso";

View file

@ -37,7 +37,7 @@ function GuiFormManager::InitLayouts( %libraryName, %layoutName, %layoutObj )
}
// Load up all Layouts in the layout base path.
loadDirectory( %libraryObj.basePath, "tscript", "dso" );
loadDirectory( %libraryObj.basePath, "" @ $TorqueScriptFileExtension, "dso" );
}
@ -77,7 +77,7 @@ function GuiFormManager::RegisterLayout( %libraryName, %layoutName, %layoutObj )
layoutName = %layoutName;
layoutLibrary = %libraryObj;
layoutObj = %layoutObj;
layoutFile = %libraryObj.basePath @ %layoutName @ ".tscript";
layoutFile = %libraryObj.basePath @ %layoutName @ "." @ $TorqueScriptFileExtension;
};
// Tag Layout Object Properly so it can reset itself.
@ -192,7 +192,7 @@ function GuiFormManager::SaveLayout( %library, %layoutName, %newName )
// Do any form layout specifics saving.
GuiFormManager::SaveLayoutContent( %layoutObjRef.layoutObj );
%newFile = %libraryObj.basePath @ "/" @ %newName @ ".tscript";
%newFile = %libraryObj.basePath @ "/" @ %newName @ "." @ $TorqueScriptFileExtension;
if( %newName $= "" )
{
%newName = %layoutObjRef.layoutName;

View file

@ -112,8 +112,8 @@ function ProjectBase::_onProjectOpen( %this, %data )
setCurrentDirectory( %this.gamePath );
// Set ^game expando
setScriptPathExpando("project", %this.gamePath );
setScriptPathExpando("game", %this.gamePath @ "/game" );
se" @ $TorqueScriptFileExtension @ "PathExpando("project", %this.gamePath );
se" @ $TorqueScriptFileExtension @ "PathExpando("game", %this.gamePath @ "/game" );
%this.onProjectOpen( %data );
%this.setActive();