From 2c285ff04e984241adb181eed3cacde5c17c3717 Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:10:02 -0700 Subject: [PATCH] Prime history with default filter --- Patches/FleaPrevSearchPatches.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Patches/FleaPrevSearchPatches.cs b/Patches/FleaPrevSearchPatches.cs index 3b795ff..8ed6513 100644 --- a/Patches/FleaPrevSearchPatches.cs +++ b/Patches/FleaPrevSearchPatches.cs @@ -76,7 +76,14 @@ namespace UIFixes layoutElement.preferredWidth = -1; // Prime the first filter + if (!History.Any()) + { + History.Push(new HistoryEntry() { filterRule = ragfair.method_3(EViewListType.AllOffers) }); // Player's saved default rule + } + + // Load what they're searching now, which may or may not be the same as the default OnFilterRuleChanged(); + ragfair.OnFilterRuleChanged += OnFilterRuleChanged; if (History.Count < 2)