Add optional !ClassColors support.
This commit is contained in:
@@ -149,6 +149,7 @@ local defaults = {
|
||||
AggroBarColor = {r = 1, g = 0, b = 0, a = 1,},
|
||||
PetBarColor = {r = 0.77, g = 0, b = 1, a = 1},
|
||||
FadeBarColor = {r = 0.5, g = 0.5, b = 0.5, a = 1},
|
||||
UseCustomClassColors = true,
|
||||
},
|
||||
ShowWith = {
|
||||
UseShowWith = true,
|
||||
@@ -475,10 +476,17 @@ function Omen:PLAYER_LOGIN()
|
||||
self:UpdateBackdrop()
|
||||
self:UpdateTitleBar()
|
||||
self:UpdateGrips()
|
||||
self:UpdateRaidClassColors()
|
||||
self:ClearAll()
|
||||
self:UnregisterEvent("PLAYER_LOGIN")
|
||||
if not db.Shown then self.Anchor:Hide() end -- Auto-show/hide will override this later if enabled
|
||||
|
||||
-- Optional !ClassColors addon support
|
||||
if CUSTOM_CLASS_COLORS then
|
||||
CUSTOM_CLASS_COLORS:RegisterCallback("UpdateBars", self)
|
||||
end
|
||||
|
||||
-- LDB launcher
|
||||
if LDB then
|
||||
OmenLauncher = LDB:NewDataObject("Omen", {
|
||||
type = "launcher",
|
||||
@@ -848,6 +856,15 @@ function Omen:ToggleFocus()
|
||||
Omen:UpdateBars()
|
||||
end
|
||||
|
||||
function Omen:UpdateRaidClassColors()
|
||||
if CUSTOM_CLASS_COLORS and db.Bar.UseCustomClassColors then
|
||||
RAID_CLASS_COLORS = CUSTOM_CLASS_COLORS
|
||||
else
|
||||
RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS
|
||||
end
|
||||
Omen:UpdateBars()
|
||||
end
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Omen warnings
|
||||
@@ -2610,6 +2627,17 @@ local options = {
|
||||
end,
|
||||
disabled = function() return not db.Bar.UseClassColors end,
|
||||
},
|
||||
UseCustomClassColors = {
|
||||
type = "toggle",
|
||||
order = 23,
|
||||
name = L["Use !ClassColors"],
|
||||
desc = L["Use !ClassColors addon for class colors for the background color of threat bars"],
|
||||
set = function(info, v)
|
||||
db.Bar.UseCustomClassColors = v
|
||||
Omen:UpdateRaidClassColors()
|
||||
end,
|
||||
disabled = function() return not db.Bar.UseClassColors or not CUSTOM_CLASS_COLORS end,
|
||||
},
|
||||
FadeBarColor = {
|
||||
type = "color",
|
||||
order = 26,
|
||||
|
||||
Reference in New Issue
Block a user