From fe1d2d51dbb875e08d306f37c2b40f82a2982130 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 27 Aug 2024 22:16:04 +0200 Subject: [PATCH] Mark completed daily quests as unable to accept --- Questionable/Functions/QuestFunctions.cs | 3 +++ .../QuestComponents/CreationUtilsComponent.cs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Questionable/Functions/QuestFunctions.cs b/Questionable/Functions/QuestFunctions.cs index 15a2dec1..4bfdce00 100644 --- a/Questionable/Functions/QuestFunctions.cs +++ b/Questionable/Functions/QuestFunctions.cs @@ -360,6 +360,9 @@ internal sealed unsafe class QuestFunctions { if (IsQuestAccepted(questId)) return false; + + if (QuestManager.Instance()->IsDailyQuestCompleted(questId.Value)) + return false; } else { diff --git a/Questionable/Windows/QuestComponents/CreationUtilsComponent.cs b/Questionable/Windows/QuestComponents/CreationUtilsComponent.cs index 33fa831c..ab73c25d 100644 --- a/Questionable/Windows/QuestComponents/CreationUtilsComponent.cs +++ b/Questionable/Windows/QuestComponents/CreationUtilsComponent.cs @@ -110,6 +110,18 @@ internal sealed class CreationUtilsComponent } #endif +#if false + var questManager = QuestManager.Instance(); + if (questManager != null) + { + for (int i = 0; i < questManager->DailyQuests.Length; ++i) + { + var dailyQuest = questManager->DailyQuests[i]; + ImGui.Text($"Daily Quest {i}: {dailyQuest.QuestId}, {dailyQuest.IsCompleted}"); + } + } +#endif + #if false var director = UIState.Instance()->DirectorTodo.Director; if (director != null)