Added feature to change text colors via MCM
This commit is contained in:
1 parent
1fa60c6aaf
commit
47fb913db2
5 files changed
+134
-38
No files matched your search
+4
-24
@@ -664,40 +664,20 @@ end
|
|||||||
|
|
||||||
-- Get KColor object of "Entity Name" texts
|
-- Get KColor object of "Entity Name" texts
|
||||||
function EID:getNameColor()
|
function EID:getNameColor()
|
||||||
return KColor(
|
return EID:getColor(EID.Config["ItemNameColor"], EID.InlineColors["ColorEIDObjName"])
|
||||||
EID.Config["ItemNameColor"][1],
|
|
||||||
EID.Config["ItemNameColor"][2],
|
|
||||||
EID.Config["ItemNameColor"][3],
|
|
||||||
EID.Config["Transparency"]
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get KColor object of "Description" texts
|
-- Get KColor object of "Description" texts
|
||||||
function EID:getTextColor()
|
function EID:getTextColor()
|
||||||
return KColor(
|
return EID:getColor(EID.Config["TextColor"], EID.InlineColors["ColorEIDText"])
|
||||||
EID.Config["TextColor"][1],
|
|
||||||
EID.Config["TextColor"][2],
|
|
||||||
EID.Config["TextColor"][3],
|
|
||||||
EID.Config["Transparency"]
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get KColor object of "Transformation" texts
|
-- Get KColor object of "Transformation" texts
|
||||||
function EID:getTransformationColor()
|
function EID:getTransformationColor()
|
||||||
return KColor(
|
return EID:getColor(EID.Config["TransformationColor"], EID.InlineColors["ColorEIDTransform"])
|
||||||
EID.Config["TransformationColor"][1],
|
|
||||||
EID.Config["TransformationColor"][2],
|
|
||||||
EID.Config["TransformationColor"][3],
|
|
||||||
EID.Config["Transparency"]
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get KColor object of "Error" texts
|
-- Get KColor object of "Error" texts
|
||||||
function EID:getErrorColor()
|
function EID:getErrorColor()
|
||||||
return KColor(
|
return EID:getColor(EID.Config["ErrorColor"], EID.InlineColors["ColorEIDError"])
|
||||||
EID.Config["ErrorColor"][1],
|
|
||||||
EID.Config["ErrorColor"][2],
|
|
||||||
EID.Config["ErrorColor"][3],
|
|
||||||
EID.Config["Transparency"]
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
+12
-12
@@ -72,9 +72,9 @@ EID.DefaultConfig = {
|
|||||||
-- Toggle Display of Trinket descriptions
|
-- Toggle Display of Trinket descriptions
|
||||||
-- Default = true
|
-- Default = true
|
||||||
["DisplayTrinketInfo"] = true,
|
["DisplayTrinketInfo"] = true,
|
||||||
-- Set the RGB color of the Itemname text
|
-- Set the color-name of the Itemname description text. Color names can be found& defined in "eid_data.lua"
|
||||||
-- Default = {0.8, 0.3, 0.8}
|
-- Default = "ColorEIDObjName"
|
||||||
["ItemNameColor"] = {0.8, 0.3, 0.8},
|
["ItemNameColor"] = "ColorEIDObjName",
|
||||||
-------TRANSFORMATIONS---------
|
-------TRANSFORMATIONS---------
|
||||||
|
|
||||||
-- Toggle Display of Transformation text
|
-- Toggle Display of Transformation text
|
||||||
@@ -83,9 +83,9 @@ EID.DefaultConfig = {
|
|||||||
-- Toggle Display of Transformation icons
|
-- Toggle Display of Transformation icons
|
||||||
-- Default = true
|
-- Default = true
|
||||||
["TransformationIcons"] = true,
|
["TransformationIcons"] = true,
|
||||||
-- Set the RGB color of the Transformation text
|
-- Set the color-name of the Transformation description text. Color names can be found& defined in "eid_data.lua"
|
||||||
-- Default = { 0.5, 0.5, 1}
|
-- Default = "ColorEIDTransform"
|
||||||
["TransformationColor"] = {0.5, 0.5, 1},
|
["TransformationColor"] = "ColorEIDTransform",
|
||||||
------------CARDS--------------
|
------------CARDS--------------
|
||||||
|
|
||||||
-- Toggle Display of Card / Rune descriptions
|
-- Toggle Display of Card / Rune descriptions
|
||||||
@@ -120,12 +120,12 @@ EID.DefaultConfig = {
|
|||||||
-- Error message displayed when an error occurs
|
-- Error message displayed when an error occurs
|
||||||
-- Default = [Effect not defined]
|
-- Default = [Effect not defined]
|
||||||
["ErrorMessage"] = "[Effect not defined]",
|
["ErrorMessage"] = "[Effect not defined]",
|
||||||
-- Set the RGB color of the default description text
|
-- Set the color-name of the default description text. Color names can be found& defined in "eid_data.lua"
|
||||||
-- Default = { 1, 1, 1}
|
-- Default = "ColorEIDText"
|
||||||
["TextColor"] = {1, 1, 1},
|
["TextColor"] = "ColorEIDText",
|
||||||
-- Set the RGB color of the Error text
|
-- Set the color-name of the Error description text. Color names can be found& defined in "eid_data.lua"
|
||||||
-- Default = { 1, 0, 0}
|
-- Default = "ColorEIDError"
|
||||||
["ErrorColor"] = {1, 0.4, 0.4},
|
["ErrorColor"] = "ColorEIDError",
|
||||||
-- Enables or disables custom Descriptions for entities
|
-- Enables or disables custom Descriptions for entities
|
||||||
-- Default = true
|
-- Default = true
|
||||||
["EnableEntityDescriptions"] = true
|
["EnableEntityDescriptions"] = true
|
||||||
|
|||||||
@@ -137,6 +137,10 @@ EID.InlineColors = {
|
|||||||
["ColorObjName"] = function(_) return EID:getNameColor() end,
|
["ColorObjName"] = function(_) return EID:getNameColor() end,
|
||||||
["ColorReset"] = function(_) return EID.LastRenderCallColor end,
|
["ColorReset"] = function(_) return EID.LastRenderCallColor end,
|
||||||
-- Basic Colors
|
-- Basic Colors
|
||||||
|
["ColorEIDText"] = KColor(1, 1, 1, 1),
|
||||||
|
["ColorEIDTransform"] = KColor(0.5, 0.5, 1, 1),
|
||||||
|
["ColorEIDError"] = KColor(1, 0.4, 0.4, 1),
|
||||||
|
["ColorEIDObjName"] = KColor(0.8, 0.3, 0.8, 1),
|
||||||
["ColorBlack"] = KColor(0, 0, 0, 1),
|
["ColorBlack"] = KColor(0, 0, 0, 1),
|
||||||
["ColorWhite"] = KColor(1, 1, 1, 1),
|
["ColorWhite"] = KColor(1, 1, 1, 1),
|
||||||
["ColorRed"] = KColor(1, 0, 0, 1),
|
["ColorRed"] = KColor(1, 0, 0, 1),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local enableDebug = false
|
|||||||
|
|
||||||
require("eid_config")
|
require("eid_config")
|
||||||
EID.Config = EID.DefaultConfig
|
EID.Config = EID.DefaultConfig
|
||||||
EID.Config.Version = "3.0"
|
EID.Config.Version = "3.1"
|
||||||
EID.isHidden = EID.Config["Hidden"]
|
EID.isHidden = EID.Config["Hidden"]
|
||||||
|
|
||||||
-- general variables
|
-- general variables
|
||||||
|
|||||||
+113
-1
@@ -5,6 +5,7 @@ EID.MCMCompat_isDisplayingEIDTab = false
|
|||||||
local MCMCompat_isDisplayingDummyMCMObj = false
|
local MCMCompat_isDisplayingDummyMCMObj = false
|
||||||
local MCMCompat_oldPermanentObj = false
|
local MCMCompat_oldPermanentObj = false
|
||||||
EID.MCMLoaded = MCMLoaded
|
EID.MCMLoaded = MCMLoaded
|
||||||
|
local colorNameArray = {}
|
||||||
|
|
||||||
function EID:renderMCMDummyDescription()
|
function EID:renderMCMDummyDescription()
|
||||||
if MCMLoaded then
|
if MCMLoaded then
|
||||||
@@ -17,6 +18,7 @@ function EID:renderMCMDummyDescription()
|
|||||||
demoDescObj.Description = "A very cool description as a demonstration of the power of EID!#\1 This is also a cool line#This line loves you {{Heart}}"
|
demoDescObj.Description = "A very cool description as a demonstration of the power of EID!#\1 This is also a cool line#This line loves you {{Heart}}"
|
||||||
EID:displayPermanentText(demoDescObj)
|
EID:displayPermanentText(demoDescObj)
|
||||||
MCMCompat_isDisplayingDummyMCMObj = true
|
MCMCompat_isDisplayingDummyMCMObj = true
|
||||||
|
EID:buildColorArray()
|
||||||
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
|
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
|
||||||
if MCMCompat_oldPermanentObj == nil then
|
if MCMCompat_oldPermanentObj == nil then
|
||||||
EID:hidePermanentText()
|
EID:hidePermanentText()
|
||||||
@@ -26,10 +28,21 @@ function EID:renderMCMDummyDescription()
|
|||||||
EID.MCMCompat_isDisplayingEIDTab = false
|
EID.MCMCompat_isDisplayingEIDTab = false
|
||||||
MCMCompat_oldPermanentObj = nil
|
MCMCompat_oldPermanentObj = nil
|
||||||
MCMCompat_isDisplayingDummyMCMObj = false
|
MCMCompat_isDisplayingDummyMCMObj = false
|
||||||
|
colorNameArray = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EID:buildColorArray()
|
||||||
|
colorNameArray = {}
|
||||||
|
for k,v in pairs(EID.InlineColors) do
|
||||||
|
if k~="ColorText" and k~="ColorTransform" and k~="ColorError" and k~="ColorObjName" and k~="ColorReset" then
|
||||||
|
table.insert(colorNameArray,k)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.sort(colorNameArray)
|
||||||
|
end
|
||||||
|
|
||||||
if MCMLoaded then
|
if MCMLoaded then
|
||||||
function AnIndexOf(t, val)
|
function AnIndexOf(t, val)
|
||||||
for k, v in ipairs(t) do
|
for k, v in ipairs(t) do
|
||||||
@@ -64,6 +77,7 @@ if MCMLoaded then
|
|||||||
Minimum = 1,
|
Minimum = 1,
|
||||||
Maximum = #(EID.Languages),
|
Maximum = #(EID.Languages),
|
||||||
Display = function()
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = false;
|
||||||
return "Language: " .. displayLanguage[AnIndexOf(EID.Languages, EID.Config["Language"])]
|
return "Language: " .. displayLanguage[AnIndexOf(EID.Languages, EID.Config["Language"])]
|
||||||
end,
|
end,
|
||||||
OnChange = function(currentNum)
|
OnChange = function(currentNum)
|
||||||
@@ -200,6 +214,7 @@ if MCMLoaded then
|
|||||||
return EID.Config["DisplayItemInfo"]
|
return EID.Config["DisplayItemInfo"]
|
||||||
end,
|
end,
|
||||||
Display = function()
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = false;
|
||||||
local onOff = "False"
|
local onOff = "False"
|
||||||
if EID.Config["DisplayItemInfo"] then
|
if EID.Config["DisplayItemInfo"] then
|
||||||
onOff = "True"
|
onOff = "True"
|
||||||
@@ -383,6 +398,7 @@ if MCMLoaded then
|
|||||||
Minimum = 1,
|
Minimum = 1,
|
||||||
Maximum = #fontTypes,
|
Maximum = #fontTypes,
|
||||||
Display = function()
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = true;
|
||||||
return "Font Type: " .. EID.Config["FontType"]
|
return "Font Type: " .. EID.Config["FontType"]
|
||||||
end,
|
end,
|
||||||
OnChange = function(currentNum)
|
OnChange = function(currentNum)
|
||||||
@@ -405,7 +421,6 @@ if MCMLoaded then
|
|||||||
Minimum = 1,
|
Minimum = 1,
|
||||||
Maximum = 6,
|
Maximum = 6,
|
||||||
Display = function()
|
Display = function()
|
||||||
EID.MCMCompat_isDisplayingEIDTab = true;
|
|
||||||
return "Text Size: " .. EID.Config["Scale"]
|
return "Text Size: " .. EID.Config["Scale"]
|
||||||
end,
|
end,
|
||||||
OnChange = function(currentNum)
|
OnChange = function(currentNum)
|
||||||
@@ -520,6 +535,7 @@ if MCMLoaded then
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
-------TRANSFORMATION ICON---------
|
||||||
MCM.AddSetting(
|
MCM.AddSetting(
|
||||||
"EID",
|
"EID",
|
||||||
"Visuals",
|
"Visuals",
|
||||||
@@ -540,4 +556,100 @@ if MCMLoaded then
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
---------------------------------Visuals-----------------------------------
|
||||||
|
|
||||||
|
-- Text Color
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Colors",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenuOptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return AnIndexOf(colorNameArray, EID.Config["TextColor"])
|
||||||
|
end,
|
||||||
|
Minimum = 0,
|
||||||
|
Maximum = 1000,
|
||||||
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = true;
|
||||||
|
return "Descriptions: " .. string.gsub(EID.Config["TextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TextColor"]).."/"..#colorNameArray..")"
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
if currentNum == 0 then currentNum = #colorNameArray end
|
||||||
|
if currentNum > #colorNameArray then currentNum = 1 end
|
||||||
|
EID.Config["TextColor"] = colorNameArray[currentNum]
|
||||||
|
end,
|
||||||
|
Info = {"Changes the color of normal texts."}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- Name Color
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Colors",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenuOptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return AnIndexOf(colorNameArray, EID.Config["ItemNameColor"])
|
||||||
|
end,
|
||||||
|
Minimum = 0,
|
||||||
|
Maximum = 1000,
|
||||||
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = true;
|
||||||
|
return "Names: " .. string.gsub(EID.Config["ItemNameColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemNameColor"]).."/"..#colorNameArray..")"
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
if currentNum == 0 then currentNum = #colorNameArray end
|
||||||
|
if currentNum > #colorNameArray then currentNum = 1 end
|
||||||
|
EID.Config["ItemNameColor"] = colorNameArray[currentNum]
|
||||||
|
end,
|
||||||
|
Info = {"Changes the color of name texts."}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- Transform Color
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Colors",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenuOptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return AnIndexOf(colorNameArray, EID.Config["TransformationColor"])
|
||||||
|
end,
|
||||||
|
Minimum = 0,
|
||||||
|
Maximum = 1000,
|
||||||
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = true;
|
||||||
|
return "Transformations: " .. string.gsub(EID.Config["TransformationColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TransformationColor"]).."/"..#colorNameArray..")"
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
if currentNum == 0 then currentNum = #colorNameArray end
|
||||||
|
if currentNum > #colorNameArray then currentNum = 1 end
|
||||||
|
EID.Config["TransformationColor"] = colorNameArray[currentNum]
|
||||||
|
end,
|
||||||
|
Info = {"Changes the color of transformation texts."}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- Error Color
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Colors",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenuOptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return AnIndexOf(colorNameArray, EID.Config["ErrorColor"])
|
||||||
|
end,
|
||||||
|
Minimum = 0,
|
||||||
|
Maximum = 1000,
|
||||||
|
Display = function()
|
||||||
|
EID.MCMCompat_isDisplayingEIDTab = true;
|
||||||
|
return "Errors: " .. string.gsub(EID.Config["ErrorColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ErrorColor"]).."/"..#colorNameArray..")"
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
if currentNum == 0 then currentNum = #colorNameArray end
|
||||||
|
if currentNum > #colorNameArray then currentNum = 1 end
|
||||||
|
EID.Config["ErrorColor"] = colorNameArray[currentNum]
|
||||||
|
end,
|
||||||
|
Info = {"Changes the color of error messages like Unknown pills"}
|
||||||
|
}
|
||||||
|
)
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user