Explorar o código

Merge pull request #305 from Areloch/OpenShapeEditorFix

Fixes logic when opening shapeEditor with a TSStatic selected
Brian Roberts %!s(int64=5) %!d(string=hai) anos
pai
achega
4c63090a6f

+ 5 - 1
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);
+      }
    }
 }
 

+ 1 - 1
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" ) )