From 55e24926e46bfdd5f0de3733d701075d4048fbb0 Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 28 Aug 2020 02:49:26 -0500 Subject: [PATCH] Fixes logic when opening shapeEditor with a TSStatic selected, it'll attempt to load up the shapeAsset if one is set on the static. --- Templates/BaseGame/game/tools/shapeEditor/main.cs | 6 +++++- .../game/tools/shapeEditor/scripts/shapeEditor.ed.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/tools/shapeEditor/main.cs b/Templates/BaseGame/game/tools/shapeEditor/main.cs index fe40ed882..5354c20c3 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/main.cs +++ b/Templates/BaseGame/game/tools/shapeEditor/main.cs @@ -235,7 +235,7 @@ function ShapeEditorPlugin::onActivated(%this) { %obj = EWorldEditor.getSelectedObject(%i); %shapeFile = ShapeEditor.getObjectShapeFile(%obj); - if (%shapeFile !$= "") + if (%shapeFile !$= "" && isFile(%shapeFile)) { if (!isObject(ShapeEditor.shape) || (ShapeEditor.shape.baseShape !$= %shapeFile)) { @@ -251,6 +251,10 @@ function ShapeEditorPlugin::onActivated(%this) } break; } + else if(%shapeFile !$= "") + { + %this.openShapeAssetId(%shapeFile); + } } } diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs index 4272d7b1c..df59cceec 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs @@ -58,7 +58,7 @@ function ShapeEditor::getObjectShapeFile( %this, %obj ) // works for the vast majority of object types) %path = ""; if ( %obj.isMemberOfClass( "TSStatic" ) ) - %path = %obj.shapeName; + %path = %obj.shapeAsset !$= "" ? %obj.shapeAsset : %obj.shapeName; else if ( %obj.isMemberOfClass( "PhysicsShape" ) ) %path = %obj.getDataBlock().shapeName; else if ( %obj.isMemberOfClass( "GameBase" ) )