Extending ScriptGlue now possible

This commit is contained in:
Simon Lübeß
2025-07-27 17:43:00 +02:00
parent 566d39d928
commit 72e87ee9ad
4 changed files with 64 additions and 52 deletions
@@ -0,0 +1,24 @@
using System;
using GlitchyEditor.EditWindows;
using GlitchyEngine.Content;
namespace GlitchyEngine.Scripting;
extension ScriptGlue
{
static this()
{
OnRegisterNativeCalls.Add(new => RegisterExtensionCalls);
}
private static void RegisterExtensionCalls()
{
EngineFunctions.[Friend]_functions.ImGuiExtension_ShowAssetDropTarget = => ImGuiExtension_ShowAssetDropTarget;
}
[RegisterCall(EngineResultAsBool = true, IsExtension = true)]
public static EngineResult ImGuiExtension_ShowAssetDropTarget(ref AssetHandle assetHandle)
{
return ComponentEditWindow.ShowAssetDropTarget(ref assetHandle) ? .Ok : .False;
}
}