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

@ -28,7 +28,7 @@ function initializeShapeEditor()
{
echo(" % - Initializing Shape Editor");
exec("./gui/Profiles.ed.tscript");
exec("./gui/Profiles.ed." @ $TorqueScriptFileExtension);
exec("./gui/shapeEdPreviewWindow.ed.gui");
exec("./gui/shapeEdAnimWindow.ed.gui");
@ -37,9 +37,9 @@ function initializeShapeEditor()
exec("./gui/shapeEdSelectWindow.ed.gui");
exec("./gui/shapeEdPropWindow.ed.gui");
exec("./scripts/shapeEditor.ed.tscript");
exec("./scripts/shapeEditorHints.ed.tscript");
exec("./scripts/shapeEditorActions.ed.tscript");
exec("./scripts/shapeEditor.ed." @ $TorqueScriptFileExtension);
exec("./scripts/shapeEditorHints.ed." @ $TorqueScriptFileExtension);
exec("./scripts/shapeEditorActions.ed." @ $TorqueScriptFileExtension);
// Add windows to editor gui
ShapeEdPreviewGui.setVisible(false);

View file

@ -253,7 +253,7 @@ function ShapeEditor::createConstructor( %this, %path )
function ShapeEditor::saveConstructor( %this, %constructor )
{
%savepath = filePath( %constructor.baseShape ) @ "/" @ fileBase( %constructor.baseShape ) @ ".tscript";
%savepath = filePath( %constructor.baseShape ) @ "/" @ fileBase( %constructor.baseShape ) @ "." @ $TorqueScriptFileExtension;
new PersistenceManager( shapeEd_perMan );
shapeEd_perMan.setDirty( %constructor, %savepath );
shapeEd_perMan.saveDirtyObject( %constructor );
@ -3041,7 +3041,7 @@ function ShapeEditor::addLODFromFile( %this, %dest, %filename, %size, %allowUnma
{
// Get (or create) a TSShapeConstructor object for the source shape. Need to
// exec the script manually as the resource may not have been loaded yet
%csPath = filePath( %filename ) @ "/" @ fileBase( %filename ) @ ".tscript";
%csPath = filePath( %filename ) @ "/" @ fileBase( %filename ) @ "." @ $TorqueScriptFileExtension;
if ( isFile( %csPath ) )
exec( %csPath );