Browse Source

Merge pull request #1769 from Areloch/ToggleChildrenOptionsFix

Fixes the Toggle Children Lock and Toggle Children Hidden options
Areloch 9 years ago
parent
commit
c83efa59e0

+ 19 - 1
Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs

@@ -2135,10 +2135,19 @@ function EWorldEditor::toggleLockChildren( %this, %simGroup )
 {
    foreach( %child in %simGroup )
    {
+      if( %child.class $= "SimGroup" )
+      {
+         %this.toggleHideChildren( %child );
+      }
       if( %child.isMemberOfClass( "SimGroup" ) )
-         %this.toggleLockChildren( %child );
+      {
+         %this.toggleHideChildren( %child );
+         %child.setLocked( !%child.locked );
+      }
       else
+      {
          %child.setLocked( !%child.locked );
+      }
    }
    
    EWorldEditor.syncGui();
@@ -2148,10 +2157,19 @@ function EWorldEditor::toggleHideChildren( %this, %simGroup )
 {
    foreach( %child in %simGroup )
    {
+      if( %child.class $= "SimGroup" )
+      {
+         %this.toggleHideChildren( %child );
+      }
       if( %child.isMemberOfClass( "SimGroup" ) )
+      {
          %this.toggleHideChildren( %child );
+         %this.hideObject( %child, !%child.hidden );
+      }
       else
+      {
          %this.hideObject( %child, !%child.hidden );
+      }
    }
    
    EWorldEditor.syncGui();

+ 19 - 1
Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs

@@ -2135,10 +2135,19 @@ function EWorldEditor::toggleLockChildren( %this, %simGroup )
 {
    foreach( %child in %simGroup )
    {
+      if( %child.class $= "SimGroup" )
+      {
+         %this.toggleHideChildren( %child );
+      }
       if( %child.isMemberOfClass( "SimGroup" ) )
-         %this.toggleLockChildren( %child );
+      {
+         %this.toggleHideChildren( %child );
+         %child.setLocked( !%child.locked );
+      }
       else
+      {
          %child.setLocked( !%child.locked );
+      }
    }
    
    EWorldEditor.syncGui();
@@ -2148,10 +2157,19 @@ function EWorldEditor::toggleHideChildren( %this, %simGroup )
 {
    foreach( %child in %simGroup )
    {
+      if( %child.class $= "SimGroup" )
+      {
+         %this.toggleHideChildren( %child );
+      }
       if( %child.isMemberOfClass( "SimGroup" ) )
+      {
          %this.toggleHideChildren( %child );
+         %this.hideObject( %child, !%child.hidden );
+      }
       else
+      {
          %this.hideObject( %child, !%child.hidden );
+      }
    }
    
    EWorldEditor.syncGui();