Simplified the code to the important part as we do the position math previously.

Also added the stub for the onGUIEditorDropped
This commit is contained in:
JeffR 2025-05-15 12:50:21 -05:00
parent c6213f0d12
commit 65c290a770

View file

@ -30,30 +30,12 @@ function AssetBrowser::onFinishCreateObject(%this, %objId)
function Creator::onWorldEditorDropped(%this, %position)
{
if(EditorIsActive())
{
%targetPosition = EWorldEditor.unproject(%position SPC 1);
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{
%pos = getWords(%rayResult, 1, 3);
}
else
{
%pos = "0 0 0";
}
%func = %this.val[2];
$CurrentAssetBrowser.createdObjectPos = %pos;
%newObj = eval(%func);
}
else if(GuiEditorIsActive())
{
%placeholderVar = "";
}
%func = %this.val[2];
$CurrentAssetBrowser.createdObjectPos = %position;
%newObj = eval(%func);
}
function Creator::onGUIEditorDropped(%this, %position)
{
}