Add optional !ClassColors support.

This commit is contained in:
Xinhuan
2009-02-15 06:07:09 +08:00
parent ea923fbede
commit 740ef06a5a
3 changed files with 31 additions and 1 deletions
+2
View File
@@ -174,6 +174,8 @@ L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Pet Bar Color"] = true
L["The background color for pets"] = true
L["Use !ClassColors"] = true
L["Use !ClassColors addon for class colors for the background color of threat bars"] = true
L["Fade/MI Bar Color"] = true
L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true
L["Bar BG Color"] = true
+28
View File
@@ -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,
+1 -1
View File
@@ -8,7 +8,7 @@
## Notes-zhTW: 一個輕量級、有彈性、可監視多個目標的仇恨統計插件。
## Notes-koKR: 다중-대상에 대한 위협수준 미터기로 보여줍니다.
## Author: Xinhuan
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSink-2.0, LibDBIcon-1.0
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSink-2.0, LibDBIcon-1.0, !ClassColors
## X-eMail: xinhuan @ gmail DOT com
## X-Donate: PayPal:xinhuan @ gmail DOT com
## X-Category: Combat