Commit 42c9590b authored by Benik's avatar Benik

Added Covenant colors for the Datatexts

parent 214a6c48
......@@ -49,6 +49,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -49,6 +49,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -48,6 +48,7 @@ L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
L['Covenant Color'] = true
L['DataText Color'] = true
L["Are you sure you want to disable ElvUI_DTColors?"] = true
L["This module can alter all ElvUI DataText text color"] = true
......
......@@ -3,20 +3,49 @@ local ENB = E:GetModule("NutsAndBolts");
local DT = E:GetModule('DataTexts');
local mod = E:NewModule('NB_DataTextColors', 'AceEvent-3.0');
local C_Covenants_GetCovenantData = C_Covenants.GetCovenantData
local C_Covenants_GetActiveCovenantID = C_Covenants.GetActiveCovenantID
local classColor = E:ClassColor(E.myclass, true)
local function getCovenantColor()
local covenantData = C_Covenants_GetCovenantData(C_Covenants_GetActiveCovenantID())
local kit = covenantData and covenantData.textureKit or nil
local r, g, b
if kit then
if kit == "Kyrian" then
r, g, b = 0.1647, 0.6353, 1.0
elseif kit == "Venthyr" then
r, g, b = 0.8941, 0.0510, 0.0549
elseif kit == "NightFae" then
r, g, b = 0.5020, 0.7098, 0.9922
elseif kit == "Necrolord" then
r, g, b = 0.0902, 0.7843, 0.3922
end
else
r, g, b = 1, 1, 1 -- fall back to white
end
return r, g, b
end
function mod:ColorFont()
local db = E.db.NutsAndBolts.DataTextColors
local r, g, b
for panelName, panel in pairs(DT.RegisteredPanels) do
for i = 1, panel.numPoints do
if panel.dataPanels[i] then
if db.customColor == 1 then
panel.dataPanels[i].text:SetTextColor(classColor.r, classColor.g, classColor.b)
r, g, b = classColor.r, classColor.g, classColor.b
elseif db.customColor == 2 then
panel.dataPanels[i].text:SetTextColor(ENB:unpackColor(db.userColor))
r, g, b = ENB:unpackColor(db.userColor)
elseif db.customColor == 3 then
r, g, b = ENB:unpackColor(E.db.general.valuecolor)
else
panel.dataPanels[i].text:SetTextColor(ENB:unpackColor(E.db.general.valuecolor))
r, g, b = getCovenantColor()
end
panel.dataPanels[i].text:SetTextColor(r, g, b)
end
end
DT:UpdatePanelInfo(panelName, panel)
......
......@@ -61,6 +61,7 @@ local function ConfigTable()
[1] = CLASS_COLORS,
[2] = CUSTOM,
[3] = L["Value Color"],
[4] = L['Covenant Color'],
},
get = function(info) return E.db.NutsAndBolts["DataTextColors"][ info[#info] ] end,
set = function(info, value) E.db.NutsAndBolts["DataTextColors"][ info[#info] ] = value; mod:ColorFont(); end,
......@@ -69,7 +70,7 @@ local function ConfigTable()
order = 2,
type = "color",
name = COLOR_PICKER,
disabled = function() return E.db.NutsAndBolts.DataTextColors.customColor == 1 or E.db.NutsAndBolts.DataTextColors.customColor == 3 end,
disabled = function() return E.db.NutsAndBolts.DataTextColors.customColor ~= 2 end,
get = function(info)
local t = E.db.NutsAndBolts["DataTextColors"][ info[#info] ]
return t.r, t.g, t.b, t.a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment