From: Liza Carvelli Date: Mon, 14 Jul 2025 14:09:41 +0000 (+0200) Subject: Add search by id to Priority window X-Git-Tag: v5.21~5 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=392408ce6ef9028fcd6cb9ee92f1869233c83fee;p=Questionable.git Add search by id to Priority window --- 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