Merge pull request #395 from Areloch/MarkActiveScene

WIP of marking active scene in the scenetree
This commit is contained in:
Brian Roberts 2020-12-19 02:35:58 -06:00 committed by GitHub
commit 52ecd8bb0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 5 deletions

View file

@ -614,6 +614,9 @@ function EditorGui::onNewLevelLoaded( %this, %levelName )
//ECameraSettingsPage.init();
EditorCameraSpeedOptions.setupDefaultState();
//Set our starting Active Scene being edited
EWorldEditor.SetActiveScene(getRootScene());
new ScriptObject( EditorMissionCleanup )
{
parentGroup = "MissionCleanup";
@ -1646,7 +1649,10 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
}
else if( %obj.isMemberOfClass( "Scene" ))
{
%popup.item[ 0 ] = "Set as Active Scene" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId(" @ %popup.object @ ") );";
%popup.object = %obj;
%haveObjectEntries = true;
%popup.item[ 0 ] = "Set as Active Scene" TAB "" TAB "EWorldEditor.SetActiveScene(" @ %popup.object @ ");";
%popup.item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject(" @ %popup.object @ ");";
%popup.item[ 2 ] = "Inspect" TAB "" TAB "inspectObject(" @ %popup.object @ ");";
%popup.item[ 3 ] = "-";
@ -2280,6 +2286,22 @@ function EWorldEditor::selectAllObjectsInSet( %this, %set, %deselect )
}
}
function EWorldEditor::SetActiveScene(%this, %sceneObj)
{
if(isObject($ActiveEditingScene))
{
$ActiveEditingScene.isEditing = false;
%itemId = EditorTree.findItemByObjectId($ActiveScene);
EditorTree.markItem(%itemId);
}
%itemId = EditorTree.findItemByObjectId(%sceneObj);
EditorTree.markItem(%itemId);
$ActiveEditingScene = %sceneObj;
$ActiveEditingScene.isEditing = true;
}
function toggleSnappingOptions( %var )
{
if( SnapToBar->objectSnapDownBtn.getValue() && SnapToBar->objectSnapBtn.getValue() )