Merge pull request #565 from Areloch/BugfixQOL_20210909

Bugfix qol 20210909
This commit is contained in:
Brian Roberts 2021-09-11 01:52:19 -05:00 committed by GitHub
commit 86fbb3748b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 694 additions and 755 deletions

View file

@ -672,16 +672,21 @@ function GuiEditor::onControlDropped(%this, %payload, %position)
{
// Make sure we have the right kind of D&D.
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) )
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
return;
%pos = %payload.getGlobalPosition();
%x = getWord(%pos, 0);
%y = getWord(%pos, 1);
%this.addNewCtrl(%payload);
%asset = %payload.assetName;
%cmd = "return new " @ %asset @ "();";
%ctrl = eval( %cmd );
%this.addNewCtrl(%ctrl);
%payload.setPositionGlobal(%x, %y);
%ctrl.setPositionGlobal(%x, %y);
%this.setFirstResponder();
}
@ -846,6 +851,8 @@ function GuiEditorTabBook::onWake( %this )
item[ 0 ] = "Alphabetical View" TAB "" TAB "GuiEditorToolbox.setViewType( \"Alphabetical\" );";
item[ 1 ] = "Categorized View" TAB "" TAB "GuiEditorToolbox.setViewType( \"Categorized\" );";
};
GlobalActionMap.bindCmd( keyboard, space, "", "AssetBrowser.toggleDialog();" );
}
//---------------------------------------------------------------------------------------------
@ -1010,6 +1017,8 @@ function GuiEditorGui::onWake( %this )
function GuiEditorGui::onSleep( %this)
{
GlobalActionMap.unbind( keyboard, space );
// If we are editing a control, store its guide state.
%content = GuiEditor.getContentControl();