From e11aabe399dd50012dd3decbeb843249bb0d423d Mon Sep 17 00:00:00 2001 From: Buurazu Date: Thu, 31 Mar 2022 14:43:33 -0400 Subject: [PATCH] Only lock controls if Recipe List is on screen --- eid_bagofcrafting.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eid_bagofcrafting.lua b/eid_bagofcrafting.lua index 92a0f8d5..fc23be1e 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -789,6 +789,7 @@ local newResults = {} local skipRandom = false local isRefresh = false local queryString = "" +local displayingRecipeList = false local function RecipeCrunchCoroutine() coTimer = Isaac.GetTime() @@ -894,7 +895,7 @@ function EID:handleBagOfCraftingUpdating() end -- Check for Hold Tab key inputs - if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.bagPlayer.ControllerIndex) then + if displayingRecipeList and Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.bagPlayer.ControllerIndex) then EID.bagPlayer.ControlsCooldown = 2 if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.bagPlayer.ControllerIndex) then bagOfCraftingOffset = math.min(numResults-(numResults%EID.Config["BagOfCraftingResults"]), bagOfCraftingOffset + EID.Config["BagOfCraftingResults"]) @@ -940,9 +941,11 @@ end -- Called when needed based on EID.Config["RefreshRate"] function EID:handleBagOfCraftingRendering(ignoreRefreshRate) -- Determine if we should display anything at all - if ((EID.isHidden or craftingIsHidden) and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting") or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then + if not EID:RefreshThisFrame() and not ignoreRefreshRate then return false - elseif not EID:RefreshThisFrame() and not ignoreRefreshRate then + end + displayingRecipeList = false + if ((EID.isHidden or craftingIsHidden) and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting") or game.Challenge == Challenge.CHALLENGE_CANTRIPPED then return false elseif EID.Config["BagOfCraftingHideInBattle"] then if Isaac.CountBosses() > 0 or Isaac.CountEnemies() > 0 then @@ -1070,6 +1073,7 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate) end -- Recipe List display + displayingRecipeList = true if sortNeeded then sortAllItems() sortNeeded = false