mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Extending ScriptGlue now possible
This commit is contained in:
@@ -19,15 +19,6 @@ namespace GlitchyEditor.EditWindows
|
||||
{
|
||||
private static uint32 TableId;
|
||||
|
||||
public static this()
|
||||
{
|
||||
/*ScriptGlue.OnRegisterNativeCalls.Add(new () => {
|
||||
// TODO: Implement
|
||||
Runtime.NotImplemented();
|
||||
//ScriptGlue.RegisterCall<function bool(ref AssetHandle)>("ScriptGlue::ImGuiExtension_ShowAssetDropTarget", => ShowAssetDropTarget);
|
||||
});*/
|
||||
}
|
||||
|
||||
public static void ShowComponents(Entity entity, Type componentType = null)
|
||||
{
|
||||
float cellPaddingY = ImGui.GetTextLineHeight() / 3.0f;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user