Add Void option, reduce some simple boolean option line counts

This commit is contained in:
Buurazu authored and GitHub committed 2022-01-26 00:42:35 -05:00
1 parent eef4b549e1
commit 9771a77a76
1 file changed
+29 -219
+29 -219
View File
@@ -115,27 +115,27 @@ function EID:buildColorArray()
table.sort(colorNameArray) table.sort(colorNameArray)
end end
function EID:AddBooleanSetting(category, optionName, displayText, onText, offText, infoText) function EID:AddBooleanSetting(category, optionName, displayText, params)
if (type(infoText) == "string") then infoText = {infoText} end if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end
MCM.AddSetting( MCM.AddSetting(
"EID", "EID", category,
category,
{ {
Type = ModConfigMenu.OptionType.BOOLEAN, Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = params.currentSettingFunc or function()
return EID.Config[optionName] return EID.Config[optionName]
end, end,
Display = function() Display = params.displayFunc or function()
local onOff = offText local onOff = params.offText or "False"
if EID.Config[optionName] then if EID.Config[optionName] then
onOff = onText onOff = params.onText or "True"
end end
return displayText .. ": " .. onOff return displayText .. ": " .. onOff
end, end,
OnChange = function(currentBool) OnChange = params.onChangeFunc or function(currentBool)
EID.Config[optionName] = currentBool EID.Config[optionName] = currentBool
end, end,
Info = infoText Info = params.infoText or {}
} }
) )
end end
@@ -580,190 +580,21 @@ if MCMLoaded then
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------------Display----------------------------------- ---------------------------------Display-----------------------------------
------------Collectibles-------------- -- Simple toggles of what descriptions the user wants displayed
EID:AddBooleanSetting("Display", "DisplayItemInfo", "Collectible Infos")
MCM.AddSetting( EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Trinket Infos")
"EID", EID:AddBooleanSetting("Display", "DisplayCardInfo", "Card Infos")
"Display", EID:AddBooleanSetting("Display", "DisplayPillInfo", "Pill Infos")
{ EID:AddBooleanSetting("Display", "DisplayGlitchedItemInfo", "Glitched Item Infos", {repOnly = true,
Type = ModConfigMenu.OptionType.BOOLEAN, infoText = "Note: The --luadebug launch option is required for more detailed glitched item descriptions; this can be dangerous!"})
CurrentSetting = function() EID:AddBooleanSetting("Display", "DisplaySacrificeInfo", "Sacrifice Room Infos")
return EID.Config["DisplayItemInfo"] EID:AddBooleanSetting("Display", "DisplayDiceInfo", "Dice Room Infos")
end, EID:AddBooleanSetting("Display", "DisplayCraneInfo", "Crane Game Infos", {repOnly = true})
Display = function() EID:AddBooleanSetting("Display", "DisplayVoidStatInfo", "Void Stat Increase Infos")
EID.MCMCompat_isDisplayingEIDTab = "";
local onOff = "False"
if EID.Config["DisplayItemInfo"] then
onOff = "True"
end
return "Collectible Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayItemInfo"] = currentBool
end
}
)
------------Trinkets--------------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayTrinketInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayTrinketInfo"] then
onOff = "True"
end
return "Trinket Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayTrinketInfo"] = currentBool
end
}
)
------------CARDS--------------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayCardInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayCardInfo"] then
onOff = "True"
end
return "Card Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayCardInfo"] = currentBool
end
}
)
------------PILLS--------------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayPillInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayPillInfo"] then
onOff = "True"
end
return "Pill Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayPillInfo"] = currentBool
end
}
)
if REPENTANCE then
------------Glitched Items--------------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayGlitchedItemInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayGlitchedItemInfo"] then
onOff = "True"
end
return "Glitched Item Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayGlitchedItemInfo"] = currentBool
end,
Info = {"Note: The --luadebug launch option is required for more detailed glitched item descriptions"}
}
)
end
--------Sacrifice Room---------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplaySacrificeInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplaySacrificeInfo"] then
onOff = "True"
end
return "Sacrifice Room Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplaySacrificeInfo"] = currentBool
end
}
)
--------Dice Room---------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayDiceInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayDiceInfo"] then
onOff = "True"
end
return "Dice Room Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayDiceInfo"] = currentBool
end
}
)
local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
if REPENTANCE then if REPENTANCE then
--------Crane Game---------
MCM.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisplayCraneInfo"]
end,
Display = function()
local onOff = "False"
if EID.Config["DisplayCraneInfo"] then
onOff = "True"
end
return "Crane Game Infos: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisplayCraneInfo"] = currentBool
end
}
)
MCM.AddSpace("EID", "Display") MCM.AddSpace("EID", "Display")
-- Spindown Dice results -- Spindown Dice results
@@ -788,27 +619,8 @@ if MCMLoaded then
-- --
-- Spindown Dice skip locked items -- Spindown Dice skip locked items
MCM.AddSetting( EID:AddBooleanSetting("Display", "SpindownDiceSkipLocked", "Skip Locked Items",
"EID", {repOnly = true, infoText = "Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"})
"Display",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["SpindownDiceSkipLocked"]
end,
Display = function()
local onOff = "False"
if EID.Config["SpindownDiceSkipLocked"] then
onOff = "True"
end
return "Skip Locked Items: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["SpindownDiceSkipLocked"] = currentBool
end,
Info = {"Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"}
}
)
end end
--------Obstruction--------- --------Obstruction---------
@@ -1369,15 +1181,13 @@ if MCMLoaded then
} }
) )
-- Bag of Crafting Hide in Battle -- Bag of Crafting Hide in Battle
EID:AddBooleanSetting("Crafting", EID:AddBooleanSetting("Crafting", "BagOfCraftingHideInBattle", "Hide in Battle",
"BagOfCraftingHideInBattle", {onText = "Yes", offText = "No",
"Hide in Battle", "Yes", "No", infoText = "Hides the recipe list when in a fight"})
"Hides the recipe list when in a fight")
-- Bag of Crafting 8 icons toggle -- Bag of Crafting 8 icons toggle
EID:AddBooleanSetting("Crafting", EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayIcons", "Show Recipes/Best Bag as",
"BagOfCraftingDisplayIcons", {onText = "8 Icons", offText = "Groups",
"Show Recipes/Best Bag as", "8 Icons", "Groups", infoText = "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients"})
"Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients")
MCM.AddSpace("EID", "Crafting") MCM.AddSpace("EID", "Crafting")
MCM.AddText("EID", "Crafting", function() return "Recipe List Options" end) MCM.AddText("EID", "Crafting", function() return "Recipe List Options" end)