From 1bcc0276391ccb9bdfb00440d7eea3f98051260d Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 16 Dec 2024 18:26:30 +0100 Subject: [PATCH] Fix color corruption on Allied Society tab --- Directory.Build.targets | 2 +- .../AlliedSocietyJournalComponent.cs | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 58f58a73..6759af62 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,5 @@ - 4.7 + 4.8 diff --git a/Questionable/Windows/JournalComponents/AlliedSocietyJournalComponent.cs b/Questionable/Windows/JournalComponents/AlliedSocietyJournalComponent.cs index 92cc96b7..c7e50602 100644 --- a/Questionable/Windows/JournalComponents/AlliedSocietyJournalComponent.cs +++ b/Questionable/Windows/JournalComponents/AlliedSocietyJournalComponent.cs @@ -57,16 +57,28 @@ internal sealed class AlliedSocietyJournalComponent if (quests.Count == 0) continue; - bool containsNewQuests = quests.Any(x => !_questFunctions.IsQuestComplete(x.QuestId)); - if (containsNewQuests) - ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); + string label = $"{alliedSociety}###AlliedSociety{(int)alliedSociety}"; +#if DEBUG + bool isOpen; + if (quests.Any(x => !_questRegistry.IsKnownQuest(x.QuestId))) + { + using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + isOpen = ImGui.CollapsingHeader(label); + } + else if (quests.Any(x => !_questFunctions.IsQuestComplete(x.QuestId))) + { + using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + isOpen = ImGui.CollapsingHeader(label); + } + else + isOpen = ImGui.CollapsingHeader(label); +#else + bool isOpen = ImGui.CollapsingHeader(label); +#endif - if (!ImGui.CollapsingHeader($"{alliedSociety}###AlliedSociety{(int)alliedSociety}")) + if (!isOpen) continue; - if (containsNewQuests) - ImGui.PopStyleColor(); - if (alliedSociety <= EAlliedSociety.Ixal) { for (byte i = 1; i <= 8; ++i)