From 6ad9dd02d9551573b84b3f822d6dcc564feb0135 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 7 Sep 2022 13:25:05 -0400 Subject: [PATCH] some shit --- client/Configuration.cs | 2 ++ client/Ui/MainWindowTabs/Settings.cs | 25 +++++++++++++++---------- client/Ui/Viewer.cs | 7 ++++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/client/Configuration.cs b/client/Configuration.cs index 23eede1..0e21e78 100644 --- a/client/Configuration.cs +++ b/client/Configuration.cs @@ -13,6 +13,8 @@ public class Configuration : IPluginConfiguration { public bool RemoveGlow = true; public bool AutoViewer; public bool AutoViewerClose = true; + public bool LockViewer; + public bool ClickThroughViewer; public bool HideTitlebar; public float ViewerOpacity = 100.0f; public int DefaultGlyph = 3; diff --git a/client/Ui/MainWindowTabs/Settings.cs b/client/Ui/MainWindowTabs/Settings.cs index 08ad04e..6181bac 100644 --- a/client/Ui/MainWindowTabs/Settings.cs +++ b/client/Ui/MainWindowTabs/Settings.cs @@ -25,16 +25,6 @@ internal class Settings : ITab { anyChanged |= vfx |= ImGui.Checkbox("Disable in trials", ref this.Plugin.Config.DisableTrials); anyChanged |= vfx |= ImGui.Checkbox("Disable in Deep Dungeons", ref this.Plugin.Config.DisableDeepDungeon); anyChanged |= vfx |= ImGui.Checkbox("Remove glow effect from signs", ref this.Plugin.Config.RemoveGlow); - anyChanged |= ImGui.Checkbox("Open the viewer automatically when near a sign", ref this.Plugin.Config.AutoViewer); - anyChanged |= ImGui.Checkbox("Close the viewer automatically when no signs are nearby", ref this.Plugin.Config.AutoViewerClose); - - if (this.Plugin.Config.AutoViewerClose) { - ImGui.TreePush(); - anyChanged |= ImGui.Checkbox("Hide viewer titlebar", ref this.Plugin.Config.HideTitlebar); - ImGui.TreePop(); - } - - anyChanged |= ImGui.SliderFloat("Viewer opacity", ref this.Plugin.Config.ViewerOpacity, 0f, 100.0f, $"{this.Plugin.Config.ViewerOpacity:N3}%%"); var glyph = this.Plugin.Config.DefaultGlyph + 1; if (ImGui.InputInt("Default glyph", ref glyph)) { @@ -42,6 +32,21 @@ internal class Settings : ITab { anyChanged = true; } + if (ImGui.CollapsingHeader("Viewer settings")) { + anyChanged |= ImGui.SliderFloat("Viewer opacity", ref this.Plugin.Config.ViewerOpacity, 0f, 100.0f, $"{this.Plugin.Config.ViewerOpacity:N3}%%"); + anyChanged |= ImGui.Checkbox("Open the viewer automatically when near a sign", ref this.Plugin.Config.AutoViewer); + anyChanged |= ImGui.Checkbox("Close the viewer automatically when no signs are nearby", ref this.Plugin.Config.AutoViewerClose); + + if (this.Plugin.Config.AutoViewerClose) { + ImGui.TreePush(); + anyChanged |= ImGui.Checkbox("Hide viewer titlebar", ref this.Plugin.Config.HideTitlebar); + ImGui.TreePop(); + } + + anyChanged |= ImGui.Checkbox("Lock viewer in place", ref this.Plugin.Config.LockViewer); + anyChanged |= ImGui.Checkbox("Click through viewer", ref this.Plugin.Config.ClickThroughViewer); + } + if (anyChanged) { this.Plugin.SaveConfig(); } diff --git a/client/Ui/Viewer.cs b/client/Ui/Viewer.cs index e1ed00a..ac85e68 100644 --- a/client/Ui/Viewer.cs +++ b/client/Ui/Viewer.cs @@ -21,9 +21,10 @@ internal class Viewer { return; } - var flags = this.Plugin.Config.HideTitlebar - ? ImGuiWindowFlags.NoTitleBar - : ImGuiWindowFlags.None; + var flags = ImGuiWindowFlags.NoBringToFrontOnFocus; + flags |= this.Plugin.Config.HideTitlebar ? ImGuiWindowFlags.NoTitleBar : ImGuiWindowFlags.None; + flags |= this.Plugin.Config.LockViewer ? ImGuiWindowFlags.NoMove : ImGuiWindowFlags.None; + flags |= this.Plugin.Config.ClickThroughViewer ? ImGuiWindowFlags.NoInputs : ImGuiWindowFlags.None; ImGui.SetNextWindowSize(new Vector2(350, 175), ImGuiCond.FirstUseEver); ImGui.SetNextWindowBgAlpha(this.Plugin.Config.ViewerOpacity / 100.0f); if (!ImGui.Begin("Messages", ref this.Visible, flags)) {