diff --git a/eid_api.lua b/eid_api.lua index dee108b3..1529340e 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -896,6 +896,9 @@ function EID:getColor(str, baseKColor) else if EID.InlineColors[strTrimmed] then colorFunc = nil end color = EID.InlineColors[strTrimmed] or color + if EID.Config["ColorblindMode"] > 0 then + color = EID.ColorBlindColors[EID.Config["ColorblindMode"]][strTrimmed] or color + end end isColorMarkup = type(EID.InlineColors[strTrimmed]) ~= type(nil) end diff --git a/eid_config.lua b/eid_config.lua index a7d1a557..db856786 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -91,6 +91,10 @@ EID.UserConfig = { -- Current warnings are: Achievements are locked, outdated game version, and potentially having inaccurate modded Bag of Crafting recipes -- Default = false ["DisableStartOfRunWarnings"] = false, + -- ColorblindMode + -- Values: 0 = Off, 1 = Protanopia (red weak), 2 = Deuteranopia (green weak), 3 = Tritanopia (blue weak) + -- Default = 0 + ["ColorblindMode"] = 0, ---------- Co-op / Multiple Descriptions ----------- @@ -496,6 +500,7 @@ EID.DefaultConfig = { ["YPosition"] = 45, ["LineHeight"] = 11, ["DisplayMode"] = "default", + ["ColorblindMode"] = 0, ["LocalModeSize"] = 0.5, ["LocalModeCentered"] = true, ["MarkupSize"] = "default", diff --git a/eid_data.lua b/eid_data.lua index 7bb79675..61696e79 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -746,7 +746,20 @@ EID.InlineColors = { return color end, } - +EID.ColorBlindColors = { + { -- Protanopia + ["ColorBagComplete"] = KColor(0.2, 0.2, 1, 0.6), -- blue-ish + ["ColorBagOverfill"] = KColor(1, 0, 0, 0.6), -- red + }, + { -- Deuteranopia + ["ColorBagComplete"] = KColor(0.2, 0.2, 1, 0.6), -- blue-ish + ["ColorBagOverfill"] = KColor(1, 0, 0, 0.6), -- red + }, + { -- Tritanopia + --["ColorBagComplete"] = KColor(0, 1, 0, 0.6), -- no changes needed + --["ColorBagOverfill"] = KColor(1, 0.5, 0.1, 0.6), -- no changes needed + } +} -- Data table for a trinket's ability to be doubled/tripled by Mom's Box or being Golden -- Due to only a few exceptions needing special rules, most of these are just a single number, which will be found in the description and multiplied -- Exceptions will use a table to figure out what to do with them: diff --git a/eid_mcm.lua b/eid_mcm.lua index 318f53f9..779a5573 100644 --- a/eid_mcm.lua +++ b/eid_mcm.lua @@ -535,6 +535,9 @@ if MCMLoaded then -- Transparency local transparencies = {0.1, 0.175, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 0.8, 0.9, 1} EID:AddScrollSetting("Visuals", "Transparency", "Transparency", transparencies) + -- Color blind + local colorBlindModes = {[0] = "Off", "Protanopia (red weak)", "Deuteranopia (green weak)", "Tritanopia (blue weak)"} + EID:AddNumberSetting("Visuals", "ColorblindMode", "Colorblind Mode", 0, #colorBlindModes, {displayTable = colorBlindModes, infoText = "Changes some colors to enable colorblind people to use some features of the mod easier."}) MCM.AddSpace("EID", "Visuals")