From d5e62ebc1537fd3c0b906775ca6c20890b2b6c04 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 10 Aug 2024 18:13:46 +0200 Subject: [PATCH] Disable minimizing/closing quest window if any quest is running --- .../QuestComponents/ActiveQuestComponent.cs | 2 -- Questionable/Windows/QuestWindow.cs | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs index ce669a7bd..e36fe2a1d 100644 --- a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs @@ -1,5 +1,4 @@ using System; -using System.Globalization; using System.Linq; using System.Numerics; using Dalamud.Game.Text; @@ -9,7 +8,6 @@ using Dalamud.Interface.Components; using Dalamud.Interface.Utility.Raii; using Dalamud.Plugin; using Dalamud.Plugin.Services; -using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions; using ImGuiNET; using Questionable.Controller; using Questionable.Controller.Steps.Shared; diff --git a/Questionable/Windows/QuestWindow.cs b/Questionable/Windows/QuestWindow.cs index 5f7531e1f..0f892489e 100644 --- a/Questionable/Windows/QuestWindow.cs +++ b/Questionable/Windows/QuestWindow.cs @@ -42,7 +42,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig IFramework framework, GameUiController gameUiController) : base($"Questionable v{PluginVersion.ToString(2)}###Questionable", - ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse) + ImGuiWindowFlags.AlwaysAutoResize) { _pluginInterface = pluginInterface; _questController = questController; @@ -92,7 +92,17 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig public override void PreOpenCheck() { - IsOpen |= _questController.IsRunning; + if (_questController.IsRunning) + { + IsOpen = true; + Flags |= ImGuiWindowFlags.NoCollapse; + ShowCloseButton = false; + } + else + { + Flags &= ~ImGuiWindowFlags.NoCollapse; + ShowCloseButton = true; + } } public override bool DrawConditions()