From f3871a1d1ca721965e16e6985095f50401055825 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Fri, 12 Jan 2024 21:38:07 +0100 Subject: [PATCH] Added repentogon config settings page --- eid_config.lua | 19 +++++++ eid_mcm.lua | 132 +++++++++++++++++++++++++++++---------------- eid_modifiers.lua | 2 +- eid_repentogon.lua | 2 +- 4 files changed, 107 insertions(+), 48 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index 024e7d79..12d912c8 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -414,6 +414,10 @@ EID.UserConfig = { -- Default: 0 (Deactivate all Savegame features) ["SaveGameNumber"] = 0, + -- Highlight items, if they need to be collected for the collection page + -- Default: true + ["ItemCollectionIndicator"] = true, + -- Color in which the name of an item should be highlighted, which needs to be collected for the collection page -- Color names are defined in "eid_data.lua" (line 365) -- Default: "ColorFade" @@ -429,6 +433,17 @@ EID.UserConfig = { -- Default = false ["ShowCursor"] = false, + + ---------- Repentogon ---------- + -- The following options only affect features that require the API extention "Repentogon" to be installed. + -- Website: https://repentogon.com/index.html + + -- Toggles descriptions to be visible, when using the item collection page in the main menu. + -- Default = true + ["RGON_ShowOnCollectionPage"] = true, + + + ---------- Misc ---------- -- Changes the number of results shown for the additional Spindown Dice description @@ -581,9 +596,13 @@ EID.DefaultConfig = { ["SpindownDiceDisplayName"] = false, ["SpindownDiceSkipLocked"] = false, ["SaveGameNumber"] = 0, + ["ItemCollectionIndicator"] = true, ["ItemCollectionColor"] = "ColorFade", ["EnableMouseControls"] = false, ["ShowCursor"] = false, + + ["RGON_ShowOnCollectionPage"] = true, + ["ErrorMessage"] = "[Effect not defined]", ["TextColor"] = "ColorEIDText", ["ErrorColor"] = "ColorEIDError", diff --git a/eid_mcm.lua b/eid_mcm.lua index bc8edab8..92dab73b 100644 --- a/eid_mcm.lua +++ b/eid_mcm.lua @@ -694,49 +694,19 @@ if MCMLoaded then end --------------------------------------------------------------------------- - ----------------------------Savegame Config-------------------------------- - if EID.SaveGame then - MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "Loaded savegame data:" end) - MCM.AddText("EID", "Save Game", function() return EID.SaveGame.Platform .." User: "..EID.SaveGame.UserName.." ("..EID.SaveGame.UserID..")" end) - MCM.AddSpace("EID", "Save Game") - - -- Show Item needs Collection - MCM.AddSetting( - "EID", - "Save Game", - { - Type = ModConfigMenu.OptionType.NUMBER, - CurrentSetting = function() - return EID.Config["SaveGameNumber"] - end, - Minimum = 0, - Maximum = 3, - Display = function() - if EID.Config["SaveGameNumber"] == 0 then - return "Current Save Game: 0 (Deactivated)" - end - return "Current Save Game: " .. EID.Config["SaveGameNumber"] - end, - OnChange = function(currentNum) - EID.MCM_OptionChanged = true - EID.Config["SaveGameNumber"] = currentNum - end, - Info = {"Save game you are currently on. This info needs to be set to get the correct lookup tables"} - } - ) - MCM.AddText("EID", "Save Game", function() - if EID.Config["SaveGameNumber"] == 0 then return "" end - local count = 0 - for k, v in pairs(EID.SaveGame[EID.Config["SaveGameNumber"]].ItemNeedsPickup) do - count = count + 1 - end - return "Collection page items missing: "..count end) - MCM.AddSpace("EID", "Save Game") - + -------------------------------REPENTOGON---------------------------------- + if EID.isRepentance then + if not REPENTOGON then + -- show disclaimer, but also show available features + MCM.AddText("EID", "Repentogon", "You need to install REPENTOGON to use the following features:") + MCM.AddSpace("EID", "Repentogon") + end + + EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items",{ infoText = "Highlight items, if they need to be collected for the collection page"}) -- Needs collection Color MCM.AddSetting( "EID", - "Save Game", + "Repentogon", { Type = ModConfigMenu.OptionType.NUMBER, CurrentSetting = function() @@ -758,13 +728,83 @@ if MCMLoaded then Info = {"Color in which item names are colored to highlight that this item needs to be collected for the collection page"} } ) - else - MCM.AddSpace("EID", "Save Game") - MCM.AddSpace("EID", "Save Game") - MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "To enable savegame related features," end) - MCM.AddText("EID", "Save Game", "please run \"scripts\\savegame_reader.exe\"") - MCM.AddText("EID", "Save Game", "found in the EID mod folder") + EID:AddBooleanSetting("Repentogon", "RGON_ShowOnCollectionPage", "Show descriptions on collection page", { infoText = "Displays item effects when navigating the collection page in the main menu."}) end + --------------------------------------------------------------------------- + ----------------------------Savegame Config-------------------------------- + if not REPENTOGON then + if EID.SaveGame then + MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "Loaded savegame data:" end) + MCM.AddText("EID", "Save Game", function() return EID.SaveGame.Platform .." User: "..EID.SaveGame.UserName.." ("..EID.SaveGame.UserID..")" end) + MCM.AddSpace("EID", "Save Game") + + -- Show Item needs Collection + MCM.AddSetting( + "EID", + "Save Game", + { + Type = ModConfigMenu.OptionType.NUMBER, + CurrentSetting = function() + return EID.Config["SaveGameNumber"] + end, + Minimum = 0, + Maximum = 3, + Display = function() + if EID.Config["SaveGameNumber"] == 0 then + return "Current Save Game: 0 (Deactivated)" + end + return "Current Save Game: " .. EID.Config["SaveGameNumber"] + end, + OnChange = function(currentNum) + EID.MCM_OptionChanged = true + EID.Config["SaveGameNumber"] = currentNum + end, + Info = {"Save game you are currently on. This info needs to be set to get the correct lookup tables"} + } + ) + MCM.AddText("EID", "Save Game", function() + if EID.Config["SaveGameNumber"] == 0 then return "" end + local count = 0 + for k, v in pairs(EID.SaveGame[EID.Config["SaveGameNumber"]].ItemNeedsPickup) do + count = count + 1 + end + return "Collection page items missing: "..count end) + MCM.AddSpace("EID", "Save Game") + + EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items") + -- Needs collection Color + MCM.AddSetting( + "EID", + "Save Game", + { + Type = ModConfigMenu.OptionType.NUMBER, + CurrentSetting = function() + return AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]) + end, + Minimum = 0, + Maximum = 1000, + Display = function() + if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end + EID.MCMCompat_isDisplayingEIDTab = "Visuals"; + return "Collection Page Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")" + end, + OnChange = function(currentNum) + EID.MCM_OptionChanged = true + if currentNum == 0 then currentNum = #colorNameArray end + if currentNum > #colorNameArray then currentNum = 1 end + EID.Config["ItemCollectionColor"] = colorNameArray[currentNum] + end, + Info = {"Color in which item names are colored to highlight that this item needs to be collected for the collection page"} + } + ) + else + MCM.AddSpace("EID", "Save Game") + MCM.AddSpace("EID", "Save Game") + MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "To enable savegame related features," end) + MCM.AddText("EID", "Save Game", "please run \"scripts\\savegame_reader.exe\"") + MCM.AddText("EID", "Save Game", "found in the EID mod folder") + end + end -- if not repentogon --------------------------------------------------------------------------- diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 8a73ad5f..f7d591ef 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -805,7 +805,7 @@ local function EIDConditionsAB(descObj) -- Collectible Pedestal Callbacks if descObj.ObjVariant == PickupVariant.PICKUP_COLLECTIBLE then - if EID:requiredForCollectionPage(descObj.ObjSubType) then table.insert(callbacks, ItemCollectionPageCallback) end + if EID.Config["ItemCollectionIndicator"] and EID:requiredForCollectionPage(descObj.ObjSubType) then table.insert(callbacks, ItemCollectionPageCallback) end if descObj.ObjSubType == 297 then table.insert(callbacks, PandorasBoxCallback) end diff --git a/eid_repentogon.lua b/eid_repentogon.lua index b7007f1d..3bc4f955 100644 --- a/eid_repentogon.lua +++ b/eid_repentogon.lua @@ -53,7 +53,7 @@ end local skipItemIDs = {} function EID:OnMenuRender() - if MenuManager:GetActiveMenu() == MainMenuType.COLLECTION then + if EID.Config["RGON_ShowOnCollectionPage"] and MenuManager:GetActiveMenu() == MainMenuType.COLLECTION then if #skipItemIDs == 0 then -- build list of items not listed in the collectionpage local itemConfig = Isaac.GetItemConfig() for i = 1, EID:GetMaxCollectibleID(), 1 do