From e3c88aad24cc1181e0ad891320462dc8b8344cf9 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 31 May 2024 20:21:03 +0200 Subject: [PATCH] BoC: Resetting search query when starting a new game --- eid_bagofcrafting_search.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eid_bagofcrafting_search.lua b/eid_bagofcrafting_search.lua index cc2a5e15..1c883b64 100644 --- a/eid_bagofcrafting_search.lua +++ b/eid_bagofcrafting_search.lua @@ -291,10 +291,16 @@ function EID:BoCSBlockInputAction(entity, inputHook, buttonAction) return nil end ---- Resets the search query when entering a new level (and starting a new game) +--- Resets the search query when entering a new level function EID:BoCSOnNewLevel() EID:BoCSSetSearchValue("") end +--- Resets the search query when starting and continuing a game +function EID:BoCSPostGameStarted() + EID:BoCSSetSearchValue("") +end + EID:BoCSHookInput() EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.BoCSOnNewLevel) +EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, EID.BoCSOnNewLevel)