Skip to content

Commit

Permalink
new function custom class colors
Browse files Browse the repository at this point in the history
  • Loading branch information
mBlinkii committed Nov 20, 2022
1 parent 92f2c70 commit 16904ba
Show file tree
Hide file tree
Showing 5 changed files with 382 additions and 1 deletion.
23 changes: 23 additions & 0 deletions core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ end

-- addon laden
function mMT:Initialize()
if E.db[mPlugin].mCustomClassColors.enable then
mMT:SetCustomColors()

function E:ClassColor(class, usePriestColor)
if not class then return end

local color = (E.db[mPlugin].mCustomClassColors.colors and E.db[mPlugin].mCustomClassColors.colors[class]) or (_G.CUSTOM_CLASS_COLORS and _G.CUSTOM_CLASS_COLORS[class]) or _G.RAID_CLASS_COLORS[class]
if type(color) ~= 'table' then return end

if not color.colorStr then
color.colorStr = E:RGBToHex(color.r, color.g, color.b, 'ff')
elseif strlen(color.colorStr) == 6 then
color.colorStr = 'ff'..color.colorStr
end

if usePriestColor and class == 'PRIEST' and tonumber(color.colorStr, 16) > tonumber(E.PriestColors.colorStr, 16) then
return E.PriestColors
else
return color
end
end
end

mMT:mMisc() -- module laden

if E.Retail then
Expand Down
14 changes: 14 additions & 0 deletions core/mOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ local function OptionsCore()
childGroups = "tab",
args = {},
},
customclasscolors = {
order = 6,
type = "group",
name = L["Custom Class colors"],
childGroups = "tab",
args = {},
},
},
},
about = {
Expand Down Expand Up @@ -847,6 +854,13 @@ local function OptionsCoreClassic()
childGroups = "tab",
args = {},
},
customclasscolors = {
order = 5,
type = "group",
name = L["Custom Class colors"],
childGroups = "tab",
args = {},
},
},
},
about = {
Expand Down
20 changes: 19 additions & 1 deletion core/mSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,23 @@ P[mPlugin] = {
["power"] = {["enable"] = false, ["texture"] = "mMediaTag M1"},
["castbar"] = {["enable"] = false, ["texture"] = "mMediaTag P4"}
},
["mCustomCombatIcons"] = 1
["mCustomCombatIcons"] = 1,
["mCustomClassColors"] = {
["enable"] = false, ["emediaenable"] = false,
["colors"] = {
["HUNTER"] = {["r"] = 0.67, ["g"] = 0.83, ["b"] = 0.45},
["WARLOCK"] = {["r"] = 0.53,["g"] = 0.53,["b"] = 0.93},
["PRIEST"] = {["r"] = 1.00,["g"] = 1.00,["b"] = 1.00},
["PALADIN"] = {["r"] = 0.96,["g"] = 0.55,["b"] = 0.73},
["MAGE"] = {["r"] = 0.20, ["g"] = 0.78, ["b"] = 0.92},
["ROGUE"] = {["r"] = 1.00,["g"] = 0.96,["b"] = 0.41},
["DRUID"] = {["r"] = 1.00, ["g"] = 0.49, ["b"] = 0.04},
["SHAMAN"] = {["r"] = 0.00,["g"] = 0.44,["b"] = 0.87},
["WARRIOR"] = {["r"] = 0.78,["g"] = 0.61,["b"] = 0.43},
["DEATHKNIGHT"] = {["r"] = 0.77, ["g"] = 0.12, ["b"] = 0.23},
["MONK"] = {["r"] = 0.00, ["g"] = 1.00, ["b"] = 0.60},
["DEMONHUNTER"] = {["r"] = 0.64, ["g"] = 0.19, ["b"] = 0.79},
["EVOKER"] = {["r"] = 0.20, ["g"] = 0.58, ["b"] = 0.50},
}
},
}
1 change: 1 addition & 0 deletions misc/load_misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Script file="mCombatTime.lua"/>
<Script file="mCoordinatesX.lua"/>
<Script file="mCoordinatesY.lua"/>
<Script file="mCustomClassColors.lua"/>
<Script file="mBGTexture.lua"/>
<Script file="mCastbar.lua"/>
<Script file="mCombatIcon.lua"/>
Expand Down
Loading

0 comments on commit 16904ba

Please sign in to comment.