Adds option to set the bag of crafting toggle button and added lookup table between ActionButton enum and Icons

This commit is contained in:
Wofsauge committed 2021-07-21 22:00:24 +02:00
1 parent 8b1e9ae6e7
commit 48b6126c3d
6 files changed
+30 -8

No files matched your search

+1 -1
View File
@@ -670,6 +670,6 @@ EID.descriptions["en_us"].horsepills={
EID.descriptions["en_us"].CraftingBagContent = "Bag:"
EID.descriptions["en_us"].CraftingRoomContent = "Room:"
EID.descriptions["en_us"].CraftingFloorContent = "Floor:"
EID.descriptions["en_us"].CraftingResults = "Results:#(Scroll: hold {{ButtonSelect}} + {{ButtonY}} {{ButtonA}})"
EID.descriptions["en_us"].CraftingResults = "Results:#(Scroll: hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}})"
EID.descriptions["en_us"].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{ColorRed}}This feature currently does not support games with modded items installed"
+1 -1
View File
@@ -671,5 +671,5 @@ EID.descriptions["ru"].horsepills={
EID.descriptions["ru"].CraftingBagContent = "Мешок:"
EID.descriptions["ru"].CraftingRoomContent = "Комната:"
EID.descriptions["ru"].CraftingFloorContent = "Этаж:"
EID.descriptions["ru"].CraftingResults = "Результаты:#(Листать: {{ButtonSelect}} + {{ButtonY}} {{ButtonA}})"
EID.descriptions["ru"].CraftingResults = "Результаты:#(Листать: {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}})"
EID.descriptions["ru"].CraftingBagModError = "!!! {{ColorRed}}ОШИБКА:#{{ColorRed}}Эта функция на данный момент не поддерживается с установленными модами"
+2 -3
View File
@@ -460,7 +460,7 @@ end, EntityType.ENTITY_KNIFE)
local holdCounter = 0
local function trackBagHolding()
local isCardHold = Input.IsActionPressed(ButtonAction.ACTION_PILLCARD, 0) or Input.IsActionPressed(ButtonAction.ACTION_PILLCARD, 1)
local isCardHold = Input.IsActionPressed(ButtonAction.ACTION_PILLCARD, EID.player.ControllerIndex)
local animationName = EID.player:GetSprite():GetAnimation()
if isCardHold and string.match(animationName, "PickupWalk") and #EID.BagItems>=8 then
holdCounter = holdCounter + 1
@@ -669,8 +669,7 @@ function EID:handleBagOfCraftingRendering()
local resultDesc = EID:getDescriptionEntry("CraftingResults")
EID:appendToDescription(customDescObj, resultDesc)
if Input.IsActionPressed(ButtonAction.ACTION_MAP, 0) or Input.IsActionPressed(ButtonAction.ACTION_MAP, 1) then
if Input.IsActionPressed(EID.Config["BagOfCraftingToggleKey"], EID.player.ControllerIndex) then
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.player.ControllerIndex) then
EID.bagOfCraftingOffset = math.min(#results-(#results%EID.Config["BagOfCraftingResults"]), EID.bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
elseif Input.IsActionTriggered(ButtonAction.ACTION_SHOOTUP, EID.player.ControllerIndex) then
+6 -1
View File
@@ -49,7 +49,7 @@ EID.UserConfig = {
-- Default = "none"
["Indicator"] = "none",
-- Set the keybinding to toggle the descriptions
-- look into the AB+ documentation for the key names
-- look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/Keyboard.html
-- Default = Keyboard.KEY_F2
["HideKey"] = Keyboard.KEY_F2,
-- Initial displaystate. Can be used to change the toggle behavior of the "Hide Key" event
@@ -169,6 +169,10 @@ EID.UserConfig = {
-- Higher numbers can cause more lag!
-- Default = 7
["BagOfCraftingResults"] = 7,
-- Set the keybinding to toggle the scroll feature of the bag of crafting descriptions
-- look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html
-- Default = ButtonAction.ACTION_MAP
["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP,
---------Mouse Controls-----------
@@ -261,6 +265,7 @@ EID.DefaultConfig = {
["DisplayDiceInfo"] = true,
["DisplayBagOfCrafting"] = "always",
["BagOfCraftingResults"] = 7,
["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP,
["SpindownDiceResults"] = 3,
["EnableMouseControls"] = false,
["ShowCursor"] = false,
+19 -1
View File
@@ -21,6 +21,23 @@ EID.SpindownDiceSkipIDs = {
[718]=true
}
EID.ButtonToIconMap = {
[ButtonAction.ACTION_SHOOTUP] = "{{ButtonY}}",
[ButtonAction.ACTION_SHOOTDOWN] = "{{ButtonA}}",
[ButtonAction.ACTION_SHOOTRIGHT] = "{{ButtonB}}",
[ButtonAction.ACTION_SHOOTLEFT] = "{{ButtonX}}",
[ButtonAction.ACTION_DOWN] = "{{ButtonDDown}}",
[ButtonAction.ACTION_UP] = "{{ButtonDUp}}",
[ButtonAction.ACTION_RIGHT] = "{{ButtonDRight}}",
[ButtonAction.ACTION_LEFT] = "{{ButtonDLeft}}",
[ButtonAction.ACTION_BOMB] = "{{ButtonLB}}",
[ButtonAction.ACTION_PILLCARD] = "{{ButtonRB}}",
[ButtonAction.ACTION_ITEM] = "{{ButtonLT}}",
[ButtonAction.ACTION_DROP] = "{{ButtonRT}}",
[ButtonAction.ACTION_MAP] = "{{ButtonSelect}}",
[ButtonAction.ACTION_PAUSE] = "{{ButtonMenu}}",
}
EID.HUDElements = {
["Active1"] = {x = 20,y = 5, width = 65, height = 65, anchors={"TOP","LEFT"}, descriptionObj = function()
local id = EID.player:GetActiveItem(ActiveSlot.SLOT_PRIMARY)
@@ -86,7 +103,8 @@ EID.TextReplacementPairs = {
{"\8\189", "{{Bomb}}"}, -- Legacy BOMB
{"{{Hashtag}}", "ǂ"}, -- Hashtag
{"{{CR}}", "{{ColorReset}}"}, -- Shortcut for Color Resetting
{"{{EthernalHeart}}", "{{EternalHeart}}"} -- fix spelling error
{"{{EthernalHeart}}", "{{EternalHeart}}"}, -- fix spelling error
{"{{CONFIG_BoC_Toggle}}", function(_) return EID.ButtonToIconMap[EID.Config["BagOfCraftingToggleKey"]] or "{{ButtonSelect}}" end}, -- fix spelling error
}
local controllerSprites = Sprite()
controllerSprites:Load("gfx/ui/buttons.anm2", true)
+1 -1
View File
@@ -90,7 +90,7 @@ https://moddingofisaac.com/mod/1079/external-item-descriptions
- Jake for the sweet [b]German[/b] language pack
- [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities
</description>
<version>3.68</version>
<version>3.69</version>
<visibility>Public</visibility>
<tag id="Lua"/>
<tag id="Items"/>