Added colorblind mode

This commit is contained in:
Wofsauge committed 2023-11-30 17:52:01 +01:00
1 parent 2f07c40633
commit 6e72f7edd9
4 files changed
+25 -1

No files matched your search

+3
View File
@@ -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
+5
View File
@@ -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",
+14 -1
View File
@@ -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:
+3
View File
@@ -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")