From 22ec3fbe597e278cac49f3baf213fc0cbf49cea2 Mon Sep 17 00:00:00 2001 From: Patrick Dawson Date: Fri, 23 Sep 2022 02:07:46 +0200 Subject: [PATCH] remove new font exports in ImGuiNode, pending a better implementation --- .gitignore | 1 + addons/imgui-godot/ImGuiNode.cs | 26 +------------------------- addons/imgui-godot/plugin.cfg | 2 +- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 3e3e3fd..24566b0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ imgui.ini export_presets.cfg .godot/ +*.user diff --git a/addons/imgui-godot/ImGuiNode.cs b/addons/imgui-godot/ImGuiNode.cs index 01faf34..b96c2db 100644 --- a/addons/imgui-godot/ImGuiNode.cs +++ b/addons/imgui-godot/ImGuiNode.cs @@ -10,15 +10,6 @@ public partial class ImGuiNode : Node2D [Export] public float FontSize = 16.0f; - [Export] - public FontFile ExtraFont = null; - - [Export] - public float ExtraFontSize = 16.0f; - - [Export(PropertyHint.Enum, "Korean,Japanese,ChineseFull,ChineseSimplifiedCommon,Cyrillic,Thai,Vietnamese")] - public string ExtraFontGlyphRange = "Japanese"; - [Export] public bool IncludeDefaultFont = true; @@ -30,21 +21,6 @@ public virtual void Init(ImGuiIOPtr io) if (Font is not null) { ImGuiGD.AddFont(Font, FontSize); - if (ExtraFont is not null) - { - IntPtr gr = ExtraFontGlyphRange switch - { - "Korean" => io.Fonts.GetGlyphRangesKorean(), - "Japanese" => io.Fonts.GetGlyphRangesJapanese(), - "ChineseFull" => io.Fonts.GetGlyphRangesChineseFull(), - "ChineseSimplifiedCommon" => io.Fonts.GetGlyphRangesChineseSimplifiedCommon(), - "Cyrillic" => io.Fonts.GetGlyphRangesCyrillic(), - "Thai" => io.Fonts.GetGlyphRangesThai(), - "Vietnamese" => io.Fonts.GetGlyphRangesVietnamese(), - _ => throw new Exception("invalid glyph range") - }; - ImGuiGD.AddFontMerge(ExtraFont, ExtraFontSize, gr); - } } if (IncludeDefaultFont) @@ -66,7 +42,7 @@ public override void _Process(double delta) if (Visible) { ImGuiGD.Update(delta, GetViewport()); - EmitSignal("imgui_layout"); + EmitSignal(nameof(imgui_layout)); ImGuiGD.Render(GetCanvasItem()); } } diff --git a/addons/imgui-godot/plugin.cfg b/addons/imgui-godot/plugin.cfg index a12ecae..adf714f 100644 --- a/addons/imgui-godot/plugin.cfg +++ b/addons/imgui-godot/plugin.cfg @@ -3,5 +3,5 @@ name="Dear ImGui for Godot" description="Dear ImGui for Godot" author="Patrick Dawson" -version="2.0.0" +version="2.0.1" script="ImGuiPlugin.gd"