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

@ -475,7 +475,7 @@ function MaterialEditorGui::isMatEditorMaterial(%this, %material)
{
return ( %material.getFilename() $= "" ||
%material.getFilename() $= "tools/gui/materialSelector.ed.gui" ||
%material.getFilename() $= "tools/materialEditor/scripts/materialEditor.ed.cs" );
%material.getFilename() $= "tools/materialEditor/scripts/materialEditor.ed.tscript" );
}
function MaterialEditorGui::setMaterialNotDirty(%this)
@ -521,13 +521,13 @@ function MaterialEditorGui::setMaterialDirty(%this)
%k = %pos + 1;
}
%savePath = getSubStr( %shapePath , 0 , %k );
%savePath = %savePath @ "materials.cs";
%savePath = %savePath @ "materials.tscript";
matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %savePath);
}
else
{
matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, "art/materials.cs");
matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, "art/materials.tscript");
}
}
else
@ -1840,7 +1840,7 @@ function MaterialEditorGui::createNewCubemap( %this, %cubemap )
parentGroup = RootGroup;
};
matEd_cubemapEdPerMan.setDirty( %cubemap, "art/materials.cs" );
matEd_cubemapEdPerMan.setDirty( %cubemap, "art/materials.tscript" );
matEd_cubemapEdPerMan.saveDirty();
return %cubemap;
@ -1857,7 +1857,7 @@ function MaterialEditorGui::setCubemapDirty(%this)
// materials created in the materail selector are given that as its filename, so we run another check
if( MaterialEditorGui.isMatEditorMaterial( %cubemap ) )
matEd_cubemapEdPerMan.setDirty(%cubemap, "art/materials.cs");
matEd_cubemapEdPerMan.setDirty(%cubemap, "art/materials.tscript");
else
matEd_cubemapEdPerMan.setDirty(%cubemap);
}
@ -2384,7 +2384,7 @@ function MaterialEditorGui::switchMaterial( %this, %material )
and updates the engines libraries accordingly in order to make this change per
object/per objects instances/per target. Before this functionality is enacted,
there is a popup beforehand that will ask if you are sure if you want to make
this change. Making this change will physically alter possibly two materials.cs
this change. Making this change will physically alter possibly two materials.tscript
files in order to move the (%fromMaterial, %toMaterial), replacing the
(%fromMaterials)'s mapTo to "unmapped_mat".
-------------------------------------------------------------------------------*/
@ -2424,7 +2424,7 @@ function MaterialEditorGui::changeMaterial(%this, %fromMaterial, %toMaterial)
%k = %count + 1;
}
%fileName = getSubStr( %sourcePath , 0 , %k );
%fileName = %fileName @ "materials.cs";
%fileName = %fileName @ "materials.tscript";
%action.toMaterialNewFname = %fileName;

View file

@ -326,7 +326,7 @@ function ActionChangeMaterial::redo(%this)
MaterialEditorGui.currentObject = %this.object;
if( %this.toMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.tscript")
{
matEd_PersistMan.removeObjectFromFile(%this.toMaterial);
}
@ -357,7 +357,7 @@ function ActionChangeMaterial::undo(%this)
MaterialEditorGui.currentObject = %this.object;
if( %this.toMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.tscript")
{
matEd_PersistMan.removeObjectFromFile(%this.toMaterial);
}
@ -442,7 +442,7 @@ function ActionDeleteMaterial::redo(%this)
}
if( %this.oldMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.oldMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
%this.oldMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.tscript")
{
matEd_PersistMan.removeObjectFromFile(%this.oldMaterial);
}