Jelajahi Sumber

Added convenience function to take control of selected entity if it supports it.

Areloch 7 tahun lalu
induk
melakukan
c729f603b8

+ 7 - 0
Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs

@@ -587,6 +587,13 @@ function makeSelectedAMesh()
    EditorTree.buildVisibleTree( true );  
 }
 
+function EditorTakeControlOfEntity()
+{
+   %object = EWorldEditor.getSelectedObject(0);
+   switchCamera(localClientConnection, %object);
+   switchControlObject(localClientConnection, %object);  
+}
+
 function EditorMount()
 {
    echo( "EditorMount" );

+ 4 - 2
Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.cs

@@ -379,8 +379,10 @@ function EditorGui::buildMenus(%this)
          Item[17] = "Make Selection Prefab" TAB "" TAB "EditorMakePrefab();";
          Item[18] = "Explode Selected Prefab" TAB "" TAB "EditorExplodePrefab();";
          Item[19] = "-";
-         Item[20] = "Mount Selection A to B" TAB "" TAB "EditorMount();";
-         Item[21] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();";
+         Item[20] = "Take control of entity" TAB "" TAB "EditorTakeControlOfEntity();";
+         Item[21] = "-";
+         Item[22] = "Mount Selection A to B" TAB "" TAB "EditorMount();";
+         Item[23] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();";
       };
    }
 }