add hotkey for Reset Bag
This commit is contained in:
1 parent
3201bce59a
commit
695197b174
1 file changed
+12
-1
+12
-1
@@ -664,6 +664,7 @@ local refreshPosition = 0
|
|||||||
local bagOfCraftingRefreshes = 0
|
local bagOfCraftingRefreshes = 0
|
||||||
local downHeld = 0
|
local downHeld = 0
|
||||||
local upHeld = 0
|
local upHeld = 0
|
||||||
|
local resetBagCounter = 0
|
||||||
|
|
||||||
local craftingIsHidden = false
|
local craftingIsHidden = false
|
||||||
local showCraftingResult = false
|
local showCraftingResult = false
|
||||||
@@ -1020,7 +1021,7 @@ function EID:handleBagOfCraftingRendering()
|
|||||||
local resultDesc = EID:getDescriptionEntry("CraftingResults")
|
local resultDesc = EID:getDescriptionEntry("CraftingResults")
|
||||||
EID:appendToDescription(customDescObj, resultDesc)
|
EID:appendToDescription(customDescObj, resultDesc)
|
||||||
if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.player.ControllerIndex) then
|
if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.player.ControllerIndex) then
|
||||||
EID.player:SetShootingCooldown(2)
|
EID.player.ControlsCooldown = 2
|
||||||
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.player.ControllerIndex) then
|
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.player.ControllerIndex) then
|
||||||
bagOfCraftingOffset = math.min(numResults-(numResults%EID.Config["BagOfCraftingResults"]), bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
|
bagOfCraftingOffset = math.min(numResults-(numResults%EID.Config["BagOfCraftingResults"]), bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
|
||||||
downHeld = Isaac.GetTime()
|
downHeld = Isaac.GetTime()
|
||||||
@@ -1045,6 +1046,16 @@ function EID:handleBagOfCraftingRendering()
|
|||||||
bagOfCraftingOffset = math.max(0, bagOfCraftingOffset - EID.Config["BagOfCraftingResults"])
|
bagOfCraftingOffset = math.max(0, bagOfCraftingOffset - EID.Config["BagOfCraftingResults"])
|
||||||
upHeld = Isaac.GetTime() - 700
|
upHeld = Isaac.GetTime() - 700
|
||||||
end
|
end
|
||||||
|
--reset bag contents when holding Use Pill/Card
|
||||||
|
if Input.IsActionPressed(ButtonAction.ACTION_PILLCARD, EID.player.ControllerIndex) then
|
||||||
|
resetBagCounter = resetBagCounter + 1
|
||||||
|
if resetBagCounter > 120 then
|
||||||
|
EID.BagItems = {}
|
||||||
|
resetBagCounter = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
resetBagCounter = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--fix bug with being allowed to go to an empty page if recipe count = multiple of page size (or if we refresh on last page)
|
--fix bug with being allowed to go to an empty page if recipe count = multiple of page size (or if we refresh on last page)
|
||||||
if (bagOfCraftingOffset >= numResults) then bagOfCraftingOffset = bagOfCraftingOffset - EID.Config["BagOfCraftingResults"] end
|
if (bagOfCraftingOffset >= numResults) then bagOfCraftingOffset = bagOfCraftingOffset - EID.Config["BagOfCraftingResults"] end
|
||||||
|
|||||||
Reference in new issue
Block a user