From 0635e3436e2aefc5b7f89131034e166d4ba46534 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Fri, 3 May 2024 20:02:07 +0200 Subject: [PATCH] ItemReminder: Flipped up/down navigation buttons to make it more intuitive to use --- eid_config.lua | 14 +++++++------- eid_holdmapdesc.lua | 18 +++++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index d85e9a14..60b8f4c2 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -337,18 +337,18 @@ EID.UserConfig = { -- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html -- Default = ButtonAction.ACTION_SHOOTLEFT ["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT, - -- Set the keybinding that is used to scroll thru the players in the left direction - -- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html - -- Default = ButtonAction.ACTION_SHOOTDOWN - ["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN, - -- Number of entries to display per category of the item description. - -- Set the keybinding that is used to scroll thru the players in the right direction + -- Set the keybinding that is used to scroll thru the players or item entries in the left direction -- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html -- Default = ButtonAction.ACTION_SHOOTUP ["ItemReminderNavigateUpButton"] = ButtonAction.ACTION_SHOOTUP, + -- Set the keybinding that is used to scroll thru the players or item entries in the right direction + -- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html + -- Default = ButtonAction.ACTION_SHOOTDOWN + ["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN, -- Limits the number of description bullet points to be displayed on the overview page for each item -- Default = 2 ["ItemReminderOverviewHideAfterRows"] = 2, + -- Number of entries to display per category of the item description. -- Default = 3 ["ItemReminderMaxEntriesCount"] = 3, -- Items that grant you items without saying what they are (like Zodiac, Liberty Cap) can have their current granted item revealed in the Item Reminder @@ -603,8 +603,8 @@ EID.DefaultConfig = { ["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP, ["ItemReminderNavigateLeftButton"] = ButtonAction.ACTION_SHOOTLEFT, ["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT, - ["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN, ["ItemReminderNavigateUpButton"] = ButtonAction.ACTION_SHOOTUP, + ["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN, ["ItemReminderOverviewHideAfterRows"] = 2, ["ItemReminderMaxEntriesCount"] = 5, ["ItemReminderShowHiddenInfo"] = false, diff --git a/eid_holdmapdesc.lua b/eid_holdmapdesc.lua index a24c8284..cac69c87 100644 --- a/eid_holdmapdesc.lua +++ b/eid_holdmapdesc.lua @@ -433,8 +433,8 @@ function EID:ItemReminderHandleInputs() EID.ForceRefreshCache = true lastInputTime = Isaac.GetTime() lastScrollDirection = 1 - elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateDownButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then - if not EID:IsCategorySelected("Passives") then + elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateUpButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then + if not EID:IsScrollableCategorySelected() then EID.ItemReminderSelectedPlayer = (EID.ItemReminderSelectedPlayer - 1) % #EID.coopAllPlayers else EID.ItemReminderSelectedItem = EID.ItemReminderSelectedItem - 1 -- clamp later @@ -442,8 +442,8 @@ function EID:ItemReminderHandleInputs() EID.ForceRefreshCache = true lastInputTime = Isaac.GetTime() - elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateUpButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then - if not EID:IsCategorySelected("Passives") then + elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateDownButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then + if not EID:IsScrollableCategorySelected() then EID.ItemReminderSelectedPlayer = (EID.ItemReminderSelectedPlayer + 1) % #EID.coopAllPlayers else EID.ItemReminderSelectedItem = EID.ItemReminderSelectedItem + 1 -- clamp later @@ -455,6 +455,10 @@ function EID:ItemReminderHandleInputs() end end +function EID:IsScrollableCategorySelected() + return EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1].isScrollable +end + function EID:IsCategorySelected(categoryID) return EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1].id == categoryID end @@ -499,9 +503,9 @@ function EID:ItemReminderGetTitle() local playerIcon = EID:GetPlayerIcon(currentPlayer:GetPlayerType(), "P" .. curPlayerID ) local playerSelectWidget = playerIcon .. " " - if not EID:IsCategorySelected("Passives") and EID.Config["ItemReminderDisplayMode"] ~= "Classic" then - playerSelectWidget = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] .. - playerIcon .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. "|" + if not EID:IsScrollableCategorySelected() and EID.Config["ItemReminderDisplayMode"] ~= "Classic" then + playerSelectWidget = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. + playerIcon .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] .. "|" end combinedText = "{{ColorText}}" .. playerSelectWidget .. combinedText end