diff --git a/HuntBuddy/Configuration.cs b/HuntBuddy/Configuration.cs index e4e1cea..8dd85bb 100644 --- a/HuntBuddy/Configuration.cs +++ b/HuntBuddy/Configuration.cs @@ -20,6 +20,7 @@ public int Version { public bool HideLocalHuntBackground; public bool HideCompletedHunts; public bool SuppressEliteMarkLocationWarning; + public bool IgnoreCloseHotkey; public float IconScale = 1f; public Vector4 IconBackgroundColour = new(0.76f, 0.75f, 0.76f, 0.8f); diff --git a/HuntBuddy/Plugin.cs b/HuntBuddy/Plugin.cs index bae4584..9799cf7 100644 --- a/HuntBuddy/Plugin.cs +++ b/HuntBuddy/Plugin.cs @@ -44,7 +44,7 @@ private WindowSystem WindowSystem { get; } - private MainWindow MainWindow { + internal MainWindow MainWindow { get; } diff --git a/HuntBuddy/Windows/ConfigurationWindow.cs b/HuntBuddy/Windows/ConfigurationWindow.cs index e905dde..26186f6 100644 --- a/HuntBuddy/Windows/ConfigurationWindow.cs +++ b/HuntBuddy/Windows/ConfigurationWindow.cs @@ -20,6 +20,7 @@ public ConfigurationWindow() : base( true) { this.Size = Vector2.Zero; this.SizeCondition = ImGuiCond.Always; + this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey; } public override void PreOpenCheck() { @@ -51,6 +52,13 @@ public override void Draw() { ImGui.Spacing(); + if (ImGui.Checkbox("Ignore close hotkey", + ref Plugin.Instance.Configuration.IgnoreCloseHotkey)) { + this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey; + Plugin.Instance.MainWindow.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey; + save = true; + } + save |= ImGui.Checkbox("Lock plugin window positions and sizes", ref Plugin.Instance.Configuration.LockWindowPositions); diff --git a/HuntBuddy/Windows/MainWindow.cs b/HuntBuddy/Windows/MainWindow.cs index 5e9842d..5847dca 100644 --- a/HuntBuddy/Windows/MainWindow.cs +++ b/HuntBuddy/Windows/MainWindow.cs @@ -23,6 +23,7 @@ public MainWindow() : base( true) { this.Size = new Vector2(400 * ImGui.GetIO().FontGlobalScale, 500); this.SizeCondition = ImGuiCond.FirstUseEver; + this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey; } public override void PreOpenCheck() {