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

This commit is contained in:
Areloch 2018-01-28 15:27:51 -06:00
parent 0135418046
commit 380c5814ff
2 changed files with 11 additions and 2 deletions

View file

@ -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" );

View file

@ -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();";
};
}
}