diff --git a/addons/imgui-godot/ImGuiGodot/ImGuiGD.cs b/addons/imgui-godot/ImGuiGodot/ImGuiGD.cs index 5c6c522..d7445c2 100644 --- a/addons/imgui-godot/ImGuiGodot/ImGuiGD.cs +++ b/addons/imgui-godot/ImGuiGodot/ImGuiGD.cs @@ -60,5 +60,15 @@ public static void RebuildFontAtlas() Internal.State.Instance.Fonts.RebuildFontAtlas(scaleToDpi ? Scale * dpiFactor : Scale); } + + public static void Connect(Callable callable) + { + ImGuiLayer.Instance?.Signaler.Connect("imgui_layout", callable); + } + + public static void Connect(Action action) + { + Connect(Callable.From(action)); + } } #endif diff --git a/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs b/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs index 18d66f5..2a63e13 100644 --- a/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs +++ b/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs @@ -1,7 +1,6 @@ using Godot; #if GODOT_PC using ImGuiNET; -using System; namespace ImGuiGodot; @@ -152,16 +151,6 @@ public override void _Input(InputEvent e) } } - public static void Connect(Callable callable) - { - Instance?.Signaler.Connect("imgui_layout", callable); - } - - public static void Connect(Action action) - { - Connect(Callable.From(action)); - } - private void CheckContentScale() { switch (_window.ContentScaleMode) diff --git a/src/MySecondNode.cs b/src/MySecondNode.cs index 44d9736..5322738 100644 --- a/src/MySecondNode.cs +++ b/src/MySecondNode.cs @@ -58,7 +58,7 @@ public override void _EnterTree() public override void _Ready() { - ImGuiLayer.Connect(OnImGuiLayout); + ImGuiGD.Connect(OnImGuiLayout); _iconTexture = GD.Load("res://data/icon.svg"); _atlasTexture = GD.Load("res://data/robot_eye.tres"); _vp = GetNode("%SubViewport");