Commit 601e4cb6 authored by Benik's avatar Benik

Added Datatext Colors

parent c36d07d0
Pipeline #3 canceled with stages
......@@ -27,6 +27,7 @@ end
ENB.LL = ENB:IsAddOnEnabled('ElvUI_LocLite')
ENB.LP = ENB:IsAddOnEnabled('ElvUI_LocPlus')
ENB.BU = ENB:IsAddOnEnabled('ElvUI_BenikUI')
ENB.DT = ENB:IsAddOnEnabled('ElvUI_DTColors')
-- Options
function ENB:ConfigTable()
......
......@@ -53,3 +53,9 @@ L["This module can alter ElvUI Databar statusbars to any color"] = true
-- ElvUI Panels
L['ElvUI Panels'] = true
L["This module can alter ElvUI Top and Bottom Panels Transparency and Height"] = true
-- DataText Colors
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
L["It looks like ElvUI_DatatextColors addon is loaded. It is strongly suggested to disable it, by clicking the button below.\n|cff00c0faNOTE:|r The standalone ElvUI_DatatextColors addon is not gonna be available anymore on Tukui.org."] = true
local E, L, V, P, G = unpack(ElvUI);
local ENB = E:GetModule("NutsAndBolts");
local DT = E:GetModule('DataTexts');
local mod = E:NewModule('NB_DataTextColors', 'AceEvent-3.0');
local classColor = E.myclass == 'PRIEST' and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
function mod:ColorFont()
local db = E.db.NutsAndBolts.DataTextColors
for panelName, panel in pairs(DT.RegisteredPanels) do
for i = 1, panel.numPoints do
local pointIndex = DT.PointLocation[i]
if db.customColor == 1 then
panel.dataPanels[pointIndex].text:SetTextColor(classColor.r, classColor.g, classColor.b)
elseif db.customColor == 2 then
panel.dataPanels[pointIndex].text:SetTextColor(ENB:unpackColor(db.userColor))
else
panel.dataPanels[pointIndex].text:SetTextColor(ENB:unpackColor(E.db.general.valuecolor))
end
end
end
end
function mod:PLAYER_ENTERING_WORLD()
self:ColorFont()
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
end
function mod:Initialize()
self:RegisterEvent('PLAYER_ENTERING_WORLD')
self.initialized = true
end
local function InitializeCallback()
if E.db.NutsAndBolts.DataTextColors.enable ~= true then return end
mod:Initialize()
end
E:RegisterModule(mod:GetName(), InitializeCallback)
\ No newline at end of file
local E, L, V, P, G = unpack(ElvUI);
local ENB = E:GetModule("NutsAndBolts");
local mod = E:GetModule('NB_DataTextColors');
-- Defaults
P["NutsAndBolts"]["DataTextColors"] = {
['enable'] = false,
['userColor'] = { r = 1, g = 1, b = 1 },
['customColor'] = 1,
}
local function ConfigTable()
local description = ""
if ENB.DT then
description = L["It looks like ElvUI_DatatextColors addon is loaded. It is strongly suggested to disable it, by clicking the button below.\n|cff00c0faNOTE:|r The standalone ElvUI_DatatextColors addon is not gonna be available anymore on Tukui.org."]
end
E.Options.args.NutsAndBolts.args.DataTextColors = {
order = 30,
type = 'group',
name = L['DataText Color'],
childGroups = 'tab',
args = {
name = {
order = 1,
type = 'description',
name = L["This module can alter all ElvUI DataText text color"],
},
spacer1 = {
order = 2,
type = "description",
name = "\n",
},
enable = {
order = 3,
type = 'toggle',
name = ENABLE,
get = function(info) return E.db.NutsAndBolts["DataTextColors"][ info[#info] ] end,
set = function(info, value) E.db.NutsAndBolts["DataTextColors"][ info[#info] ] = value; E:StaticPopup_Show('PRIVATE_RL'); end,
},
spacer2 = {
order = 4,
type = "description",
name = description.."\n",
},
toggleButton = {
order = 5,
type = "execute",
name = DISABLE.." ".."ElvUI_DTColors\n",
hidden = function() return not ENB.DT end,
func = function() StaticPopup_Show("ElvUI_DTColors") end,
},
dtcolor = {
order = 6,
type = 'group',
name = L['DataText Color'],
disabled = function() return not E.db.NutsAndBolts.DataTextColors.enable or not mod.initialized end,
args = {
customColor = {
order = 1,
type = "select",
name = COLOR,
values = {
[1] = CLASS_COLORS,
[2] = CUSTOM,
[3] = L["Value 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,
},
userColor = {
order = 2,
type = "color",
name = COLOR_PICKER,
disabled = function() return E.db.NutsAndBolts.DataTextColors.customColor == 1 or E.db.NutsAndBolts.DataTextColors.customColor == 3 end,
get = function(info)
local t = E.db.NutsAndBolts["DataTextColors"][ info[#info] ]
return t.r, t.g, t.b, t.a
end,
set = function(info, r, g, b)
local t = E.db.NutsAndBolts["DataTextColors"][ info[#info] ]
t.r, t.g, t.b = r, g, b
mod:ColorFont();
end,
},
spacer = {
order = 3,
type = "header",
name = "",
},
elvuiOption = {
order = 4,
type = "execute",
name = L["ElvUI"].." "..L["Datatexts"],
func = function() LibStub("AceConfigDialog-3.0-ElvUI"):SelectGroup("ElvUI", "datatexts", "generalGroup") end,
},
},
},
},
}
E.Options.args.datatexts.args.general.args.nbShortcut = {
order = 30,
type = "execute",
width = "double",
name = L["Change Datatext text Color"],
func = function() LibStub("AceConfigDialog-3.0-ElvUI"):SelectGroup("ElvUI", "NutsAndBolts", "DataTextColors") end,
}
end
ENB.Config["DataTextColors"] = ConfigTable
StaticPopupDialogs["ElvUI_DTColors"] = {
text = L["Are you sure you want to disable ElvUI_DTColors?"],
button1 = YES,
button2 = NO,
OnAccept = function()
DisableAddOn("ElvUI_DTColors");ReloadUI()
end,
OnCancel = E.noop,
timeout = 0,
whileDead = 1,
hideOnEscape = false,
preferredIndex = 3,
}
\ No newline at end of file
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