From 6966f935eee732ca8225005531ef47078abab680 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 6 Feb 2022 03:49:11 -0500 Subject: [PATCH] chore: move a method --- ChatTwo/PluginUi.cs | 58 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/ChatTwo/PluginUi.cs b/ChatTwo/PluginUi.cs index 401c2d5..da4bf5c 100755 --- a/ChatTwo/PluginUi.cs +++ b/ChatTwo/PluginUi.cs @@ -116,6 +116,35 @@ internal sealed class PluginUi : IDisposable { this._fontCfgMerge.Destroy(); } + private void Draw() { + this.DefaultText = ImGui.GetStyle().Colors[(int) ImGuiCol.Text]; + + var font = this.RegularFont.HasValue; + + if (font) { + ImGui.PushFont(this.RegularFont!.Value); + } + + foreach (var component in this.Components) { + try { + component.Draw(); + } catch (Exception ex) { + PluginLog.LogError(ex, "Error drawing component"); + } + } + + if (font) { + ImGui.PopFont(); + } + } + + private byte[] GetResource(string name) { + var stream = this.GetType().Assembly.GetManifestResourceStream(name)!; + var memory = new MemoryStream(); + stream.CopyTo(memory); + return memory.ToArray(); + } + private void SetUpUserFonts() { FontData? fontData = null; if (this.Plugin.Config.GlobalFont.StartsWith(Fonts.IncludedIndicator)) { @@ -194,35 +223,6 @@ internal sealed class PluginUi : IDisposable { ); } - private void Draw() { - this.DefaultText = ImGui.GetStyle().Colors[(int) ImGuiCol.Text]; - - var font = this.RegularFont.HasValue; - - if (font) { - ImGui.PushFont(this.RegularFont!.Value); - } - - foreach (var component in this.Components) { - try { - component.Draw(); - } catch (Exception ex) { - PluginLog.LogError(ex, "Error drawing component"); - } - } - - if (font) { - ImGui.PopFont(); - } - } - - private byte[] GetResource(string name) { - var stream = this.GetType().Assembly.GetManifestResourceStream(name)!; - var memory = new MemoryStream(); - stream.CopyTo(memory); - return memory.ToArray(); - } - private void BuildFonts() { this.RegularFont = null; this.ItalicFont = null;