From 392408ce6ef9028fcd6cb9ee92f1869233c83fee Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 14 Jul 2025 16:09:41 +0200 Subject: [PATCH] Add search by id to Priority window --- Questionable/Windows/PriorityWindow.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Questionable/Windows/PriorityWindow.cs b/Questionable/Windows/PriorityWindow.cs index e80b2a7c..487339c9 100644 --- a/Questionable/Windows/PriorityWindow.cs +++ b/Questionable/Windows/PriorityWindow.cs @@ -104,9 +104,17 @@ internal sealed class PriorityWindow : LWindow IEnumerable foundQuests; if (!string.IsNullOrEmpty(_searchString)) { + bool DefaultPredicate(Quest x) => x.Info.Name.Contains(_searchString, StringComparison.CurrentCultureIgnoreCase); + + Func searchPredicate; + if (ElementId.TryFromString(_searchString, out ElementId? elementId)) + searchPredicate = x => DefaultPredicate(x) || x.Id == elementId; + else + searchPredicate = DefaultPredicate; + foundQuests = _questRegistry.AllQuests .Where(x => x.Id is not SatisfactionSupplyNpcId and not AlliedSocietyDailyId) - .Where(x => x.Info.Name.Contains(_searchString, StringComparison.CurrentCultureIgnoreCase)) + .Where(searchPredicate) .Where(x => !_questFunctions.IsQuestUnobtainable(x.Id)); } else -- 2.20.1