diff --git a/Questionable/External/QuestionableIpc.cs b/Questionable/External/QuestionableIpc.cs index a48d20b6..2b80d66a 100644 --- a/Questionable/External/QuestionableIpc.cs +++ b/Questionable/External/QuestionableIpc.cs @@ -15,11 +15,13 @@ internal sealed class QuestionableIpc : IDisposable private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId"; private const string IpcGetCurrentlyActiveEventQuests = "Questionable.GetCurrentlyActiveEventQuests"; private const string IpcStartQuest = "Questionable.StartQuest"; + private const string IpcStartSingleQuest = "Questionable.StartSingleQuest"; private readonly ICallGateProvider _isRunning; private readonly ICallGateProvider _getCurrentQuestId; private readonly ICallGateProvider> _getCurrentlyActiveEventQuests; private readonly ICallGateProvider _startQuest; + private readonly ICallGateProvider _startSingleQuest; public QuestionableIpc( QuestController questController, @@ -39,15 +41,21 @@ internal sealed class QuestionableIpc : IDisposable eventInfoComponent.GetCurrentlyActiveEventQuests().Select(q => q.ToString()).ToList()); _startQuest = pluginInterface.GetIpcProvider(IpcStartQuest); - _startQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId)); + _startQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId, false)); + + _startSingleQuest = pluginInterface.GetIpcProvider(IpcStartSingleQuest); + _startSingleQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId, true)); } - private static bool StartQuest(QuestController qc, QuestRegistry qr, string questId) + private static bool StartQuest(QuestController qc, QuestRegistry qr, string questId, bool single) { if (ElementId.TryFromString(questId, out var elementId) && elementId != null && qr.TryGetQuest(elementId, out var quest)) { qc.SetNextQuest(quest); - qc.Start("IPCQuestSelection"); + if (single) + qc.StartSingleQuest("IPCQuestSelection"); + else + qc.Start("IPCQuestSelection"); return true; } return false; diff --git a/Questionable/Windows/QuestComponents/EventInfoComponent.cs b/Questionable/Windows/QuestComponents/EventInfoComponent.cs index 48c37f1d..27165d69 100644 --- a/Questionable/Windows/QuestComponents/EventInfoComponent.cs +++ b/Questionable/Windows/QuestComponents/EventInfoComponent.cs @@ -139,7 +139,7 @@ internal sealed class EventInfoComponent public IEnumerable GetCurrentlyActiveEventQuests() { return _eventQuests - .Where(x => x.EndsAtUtc <= DateTime.UtcNow) + .Where(x => x.EndsAtUtc >= DateTime.UtcNow) .SelectMany(x => x.QuestIds); }