Fixed MCM demo description not showing/working correctly

This commit is contained in:
Wofsauge committed 2024-08-30 23:42:49 +02:00
1 parent b3f3a30c3c
commit c66de2753b
2 files changed
+16 -18

No files matched your search

+13 -15
View File
@@ -107,13 +107,14 @@ function EID:renderMCMDummyDescription()
clearRenderDummyDesc() clearRenderDummyDesc()
EID:renderHUDLocationIndicators() EID:renderHUDLocationIndicators()
MCMCompat_isDisplayingDummyMCMObj = true MCMCompat_isDisplayingDummyMCMObj = true
elseif EID.MCMCompat_isDisplayingEIDTab == "Visuals" and EID.permanentDisplayTextObj == nil then
renderDummyDesc()
MCMCompat_isDisplayingDummyMCMObj = true
elseif EID.MCMCompat_isDisplayingEIDTab == "Crafting" then elseif EID.MCMCompat_isDisplayingEIDTab == "Crafting" then
clearRenderDummyDesc() clearRenderDummyDesc()
renderDummyBagOfCraftingDesc() renderDummyBagOfCraftingDesc()
MCMCompat_isDisplayingDummyMCMObj = true MCMCompat_isDisplayingDummyMCMObj = true
elseif EID.permanentDisplayTextObj == nil then
-- any other tab
renderDummyDesc(false)
MCMCompat_isDisplayingDummyMCMObj = true
end end
EID:buildColorArray() EID:buildColorArray()
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
@@ -310,7 +311,7 @@ if MCMLoaded then
Minimum = 1, Minimum = 1,
Maximum = #(EID.Languages) + 1, -- add "auto" language Maximum = #(EID.Languages) + 1, -- add "auto" language
Display = function() Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Visuals" EID.MCMCompat_isDisplayingEIDTab = "General"
if EID.Config["Language"] == "auto" then if EID.Config["Language"] == "auto" then
return "Language: Auto (" .. displayLanguage[AnIndexOf(EID.Languages, EID:getLanguage())] .. ")" return "Language: Auto (" .. displayLanguage[AnIndexOf(EID.Languages, EID:getLanguage())] .. ")"
else else
@@ -353,7 +354,7 @@ if MCMLoaded then
local refreshRateSteps = {1, 2, 3, 4, 6, 10, 12, 15, 20, 30, 60} local refreshRateSteps = {1, 2, 3, 4, 6, 10, 12, 15, 20, 30, 60}
EID:AddScrollSetting("General", "RefreshRate", "Description Refresh Rate", refreshRateSteps, EID:AddScrollSetting("General", "RefreshRate", "Description Refresh Rate", refreshRateSteps,
{displayingTab = "", infoText = "How many times per second EID updates descriptions."}) {infoText = "How many times per second EID updates descriptions."})
--------Reset to default --------Reset to default
@@ -383,7 +384,7 @@ if MCMLoaded then
-- Simple toggles of what descriptions the user wants displayed -- Simple toggles of what descriptions the user wants displayed
EID:AddBooleanSetting("Display", "DisableStartOfRunWarnings", "Start of Run Warnings", {offText = "Enabled", onText = "Disabled", EID:AddBooleanSetting("Display", "DisableStartOfRunWarnings", "Start of Run Warnings", {displayingTab = "", offText = "Enabled", onText = "Disabled",
repOnly = true, infoText = "Toggles warnings for achievements being disabled, the game being outdated, and modded crafting recipes."}) repOnly = true, infoText = "Toggles warnings for achievements being disabled, the game being outdated, and modded crafting recipes."})
MCM.AddSpace("EID", "Display") MCM.AddSpace("EID", "Display")
@@ -406,7 +407,7 @@ if MCMLoaded then
MCM.AddSpace("EID", "Display") MCM.AddSpace("EID", "Display")
MCM.AddText("EID", "Display", "Description visibility") MCM.AddText("EID", "Display", "Description visibility")
EID:AddBooleanSetting("Display", "DisplayItemInfo", "Show Item Info", {displayingTab = ""}) EID:AddBooleanSetting("Display", "DisplayItemInfo", "Show Item Info")
EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Show Trinket Info") EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Show Trinket Info")
EID:AddBooleanSetting("Display", "DisplayCardInfo", "Show Card Info") EID:AddBooleanSetting("Display", "DisplayCardInfo", "Show Card Info")
EID:AddBooleanSetting("Display", "DisplayPillInfo", "Show Pill Info") EID:AddBooleanSetting("Display", "DisplayPillInfo", "Show Pill Info")
@@ -768,13 +769,13 @@ if MCMLoaded then
if EID.isRepentance then if EID.isRepentance then
if not REPENTOGON then if not REPENTOGON then
-- show disclaimer, but also show available features -- show disclaimer, but also show available features
MCM.AddText("EID", "Repentogon", "You need to install REPENTOGON") MCM.AddText("EID", "Repentogon", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "You need to install REPENTOGON" end)
MCM.AddText("EID", "Repentogon", "to use the following features:") MCM.AddText("EID", "Repentogon", "to use the following features:")
MCM.AddSpace("EID", "Repentogon") MCM.AddSpace("EID", "Repentogon")
end end
MCM.AddText("EID", "Repentogon", "Uncollected Items") MCM.AddText("EID", "Repentogon", "Uncollected Items")
EID:AddBooleanSetting("Repentogon", "HideUncollectedItemDescriptions", "Hide uncollected items", { infoText = "Hide descriptions of items that are not yet on the collection page."}) EID:AddBooleanSetting("Repentogon", "HideUncollectedItemDescriptions", "Hide uncollected items", {displayingTab = "", infoText = "Hide descriptions of items that are not yet on the collection page."})
EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items", { infoText = "Highlights items that are not yet on the collection page."}) EID:AddBooleanSetting("Repentogon", "ItemCollectionIndicator", "Highlight uncollected items", { infoText = "Highlights items that are not yet on the collection page."})
-- Needs collection Color -- Needs collection Color
MCM.AddSetting( MCM.AddSetting(
@@ -789,7 +790,6 @@ if MCMLoaded then
Maximum = 1000, Maximum = 1000,
Display = function() Display = function()
if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")" return "Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
@@ -865,7 +865,6 @@ if MCMLoaded then
Maximum = 1000, Maximum = 1000,
Display = function() Display = function()
if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end 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..")" return "Collection Page Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
@@ -880,7 +879,7 @@ if MCMLoaded then
else else
MCM.AddSpace("EID", "Save Game") MCM.AddSpace("EID", "Save Game")
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", "To enable savegame related features,")
MCM.AddText("EID", "Save Game", "please run \"scripts\\savegame_reader.exe\"") MCM.AddText("EID", "Save Game", "please run \"scripts\\savegame_reader.exe\"")
MCM.AddText("EID", "Save Game", "found in the EID mod folder.") MCM.AddText("EID", "Save Game", "found in the EID mod folder.")
end end
@@ -889,7 +888,7 @@ if MCMLoaded then
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-----------------------------Mouse Controls-------------------------------- -----------------------------Mouse Controls--------------------------------
MCM.AddText("EID", "Mouse", "! THIS FEATURE IS IN EARLY DEVELOPMENT !") MCM.AddText("EID", "Mouse", function() EID.MCMCompat_isDisplayingEIDTab = "Mouse"; return "! THIS FEATURE IS IN EARLY DEVELOPMENT !" end )
MCM.AddSpace("EID", "Mouse") MCM.AddSpace("EID", "Mouse")
MCM.AddText("EID", "Mouse", "MCM -> General -> Hud Offset") MCM.AddText("EID", "Mouse", "MCM -> General -> Hud Offset")
MCM.AddText("EID", "Mouse", "to adjust Hud Offset") MCM.AddText("EID", "Mouse", "to adjust Hud Offset")
@@ -904,7 +903,6 @@ if MCMLoaded then
return EID.Config["EnableMouseControls"] return EID.Config["EnableMouseControls"]
end, end,
Display = function() Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Mouse";
local onOff = "False" local onOff = "False"
if EID.Config["EnableMouseControls"] then if EID.Config["EnableMouseControls"] then
onOff = "True" onOff = "True"
@@ -954,8 +952,8 @@ if MCMLoaded then
Minimum = 0, Minimum = 0,
Maximum = 1000, Maximum = 1000,
Display = function() Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Colors";
if EID.Config["TextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["TextColor"] end if EID.Config["TextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["TextColor"] end
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Descriptions: " .. string.gsub(EID.Config["TextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TextColor"]).."/"..#colorNameArray..")" return "Descriptions: " .. string.gsub(EID.Config["TextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TextColor"]).."/"..#colorNameArray..")"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
+3 -3
View File
@@ -1241,7 +1241,7 @@ function EID:OnRender()
end end
-- Do not check our hide or scale hotkeys while a tab that can modify them is open -- Do not check our hide or scale hotkeys while a tab that can modify them is open
if EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" then if EID.MCMCompat_isDisplayingEIDTab ~= "General" then
-- scale key must be handled before resetting to non-local mode -- scale key must be handled before resetting to non-local mode
handleScaleKey() handleScaleKey()
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then
@@ -1251,8 +1251,8 @@ function EID:OnRender()
EID.TabPreviewID = 0 EID.TabPreviewID = 0
EID.TabDescThisFrame = false EID.TabDescThisFrame = false
-- If MCM is open, don't show anything unless we're in a tab labeled as "Visuals" or "Crafting" -- If MCM is open, don't show anything unless we are on a tab that explicitely writes its name in the MCMCompat_isDisplayingEIDTab variable
if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab == "" then
return return
end end
if EID.isRepentance then if EID.isRepentance then