ItemReminder: Added Classic display mode

This commit is contained in:
Wofsauge committed 2024-05-03 18:47:08 +02:00
1 parent c845c94c35
commit 6ff51b782e
3 files changed
+28 -16

No files matched your search

+5 -4
View File
@@ -318,9 +318,10 @@ EID.UserConfig = {
-- Enable/Disable item reminder feature.
-- Hold Map (or the button action chosen below) to show a description of your active item's effect, recently picked up items, and things like Teleport 2.0's destination and Void's absorbed items
["ItemReminderEnabled"] = true,
-- Display all important descriptions in a single overview category
-- Default = true
["ItemReminderShowOverview"] = true,
-- Changes the display mode of the item reminder feature.
-- Options: "All" (Overview + scrollable item categories), "NoOverview" (Only scrollable item categories), "Classic" (only overview page)
-- Default = "All"
["ItemReminderDisplayMode"] = "All",
-- Disable inputs while Item Reminder is visible
-- Default = false
["ItemReminderDisableInputs"] = false,
@@ -594,7 +595,7 @@ EID.DefaultConfig = {
["CraftingResultButton"] = -1,
["ItemReminderEnabled"] = true,
["ItemReminderShowOverview"] = true,
["ItemReminderDisplayMode"] = "All",
["ItemReminderDisableInputs"] = false,
["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP,
["ItemReminderNavigateLeftButton"] = ButtonAction.ACTION_SHOOTLEFT,
+14 -9
View File
@@ -399,12 +399,12 @@ end
-- Handle scroll inputs
function EID:ItemReminderHandleInputs()
if EID.Config["ItemReminderEnabled"] and EID.holdTabCounter >= 30 and EID.TabDescThisFrame == false and EID.holdTabPlayer ~= nil then
if EID.Config["ItemReminderEnabled"] and EID.Config["ItemReminderDisplayMode"] ~= "Classic" and EID.holdTabCounter >= 30 and EID.TabDescThisFrame == false and EID.holdTabPlayer ~= nil then
if EID.Config["ItemReminderDisableInputs"] then EID.holdTabPlayer.ControlsCooldown = 2 end
if Input.IsActionTriggered(EID.Config["ItemReminderNavigateLeftButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then
EID.ItemReminderSelectedCategory = (EID.ItemReminderSelectedCategory - 1) % #EID.ItemReminderCategories
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
if EID.Config["ItemReminderDisplayMode"] == "NoOverview" and EID.ItemReminderSelectedCategory == 0 then
EID.ItemReminderSelectedCategory = #EID.ItemReminderCategories
end
@@ -413,7 +413,7 @@ function EID:ItemReminderHandleInputs()
lastScrollDirection = -1
elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateRightButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then
EID.ItemReminderSelectedCategory = (EID.ItemReminderSelectedCategory + 1) % #EID.ItemReminderCategories
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then EID.ItemReminderSelectedCategory = 1 end
if EID.Config["ItemReminderDisplayMode"] == "NoOverview" and EID.ItemReminderSelectedCategory == 0 then EID.ItemReminderSelectedCategory = 1 end
EID.ForceRefreshCache = true
lastInputTime = Isaac.GetTime()
@@ -469,8 +469,13 @@ function EID:ItemReminderGetTitle()
local title = translatedTitle and translatedTitle[category.id] or
translatedTitleEnglish and translatedTitleEnglish[category.id] or category.id
local combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateLeftButton"]] ..
title .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateRightButton"]]
local combinedText = title
-- add nav buttons
if EID.Config["ItemReminderDisplayMode"] ~= "Classic" then
combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateLeftButton"]] ..
combinedText .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateRightButton"]]
end
-- add player toggle when more than 1 player is present
if #EID.coopAllPlayers > 1 then
@@ -479,7 +484,7 @@ function EID:ItemReminderGetTitle()
local playerIcon = EID:GetPlayerIcon(currentPlayer:GetPlayerType(), "P" .. curPlayerID )
local playerSelectWidget = playerIcon .. " "
if not EID:IsCategorySelected("Passives") then
if not EID:IsCategorySelected("Passives") and EID.Config["ItemReminderDisplayMode"] ~= "Classic" then
playerSelectWidget = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] ..
playerIcon .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. "|"
end
@@ -497,7 +502,7 @@ function EID:ItemReminderGetDescription()
local player = EID.coopAllPlayers[EID.ItemReminderSelectedPlayer + 1]
if EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
if EID.ItemReminderSelectedCategory == 0 or EID.Config["ItemReminderDisplayMode"] == "Classic" then
-- execute all functions defined per category
for _, category in ipairs(EID.ItemReminderCategories) do
numAvailableDescriptionSlots = 1 -- limit to one description per category in overview mode
@@ -517,7 +522,7 @@ function EID:ItemReminderGetDescription()
if #EID.ItemReminderTempDescriptions == 0 then
if lastAutoScrollPosition == -1 then
-- auto scroll was started. store last valid category. skip overview if its disabled
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
if EID.Config["ItemReminderDisplayMode"] == "NoOverview" and EID.ItemReminderSelectedCategory == 0 then
lastAutoScrollPosition = lastScrollDirection % #EID.ItemReminderCategories
else
lastAutoScrollPosition = EID.ItemReminderSelectedCategory
@@ -526,7 +531,7 @@ function EID:ItemReminderGetDescription()
EID.ItemReminderSelectedCategory = (EID.ItemReminderSelectedCategory + lastScrollDirection) %
#EID.ItemReminderCategories
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
if EID.Config["ItemReminderDisplayMode"] == "NoOverview" and EID.ItemReminderSelectedCategory == 0 then
EID.ItemReminderSelectedCategory = #EID.ItemReminderCategories
end
+9 -3
View File
@@ -576,11 +576,17 @@ if MCMLoaded then
EID:AddBooleanSetting("Reminder", "ItemReminderEnabled", "Item Reminder", {displayingTab = "",offText = "Disabled", onText = "Enabled", infoText = "Hold Map to show your active item's effect, recently picked up items, and much more"})
local itemSlotReminders = { [0] = "No", "Yes (max 1)", "Yes (max 2)", "Yes (max 3)", "Yes (max 4)", "Yes (max 5)", "Yes (max 6)", "Yes (max 7)", "Yes (max 8)" }
local itemReminderModes = {"All", "NoOverview", "Classic"}
MCM.AddSpace("EID", "Reminder")
MCM.AddText("EID", "Reminder", "Options")
EID:AddBooleanSetting("Reminder", "ItemReminderShowOverview", "Show Overview Category", { infoText = "Show category with an overview of items in your inventory"})
EID:AddNumberSetting("Reminder", "ItemReminderDisplayMode", "Display Mode", 1, #itemReminderModes, {indexOf = itemReminderModes, infoText = "Changes the display mode. All = overview + categories. NoOverview = categories. Classic = Overview only", onChangeFunc =
function(currentNum)
EID.MCM_OptionChanged = true
EID.ItemReminderSelectedItem = 0
EID.ItemReminderSelectedCategory = 0
EID.Config["ItemReminderDisplayMode"] = itemReminderModes[currentNum]
end})
EID:AddBooleanSetting("Reminder", "ItemReminderDisableInputs", "Disable Player Inputs", { infoText = "Prevents the player from doing inputs when item reminder is visible"})
EID:AddBooleanSetting("Reminder", "ItemReminderShowHiddenInfo", "Show Hidden Information", { infoText = "Items like Error (404) or Rainbow Worm can have their current granted item revealed in the Item Reminder"})
EID:AddBooleanSetting("Reminder", "ItemReminderShowRNGCheats", "Show RNG Predictions", { infoText = "Some items can have their next random result predicted and shown in the Item Reminder"})
@@ -607,7 +613,7 @@ if MCMLoaded then
MCM.AddSpace("EID", "Reminder")
MCM.AddText("EID", "Reminder", "Item Descriptions")
EID:AddNumberSetting("Reminder", "ItemReminderMaxEntriesCount", "Max Entries", 0, 10, { displayTable = itemSlotReminders, infoText = {"Number of Descriptions possible to be displayed in the Item Reminder feature"}})
EID:AddNumberSetting("Reminder", "ItemReminderMaxEntriesCount", "Max Entries", 0, 10, {infoText = {"Number of Descriptions possible to be displayed in the Item Reminder feature"}})
---------------------------------------------------------------------------