-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGridStatusAggro.lua
More file actions
48 lines (38 loc) · 1.11 KB
/
GridStatusAggro.lua
File metadata and controls
48 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
local L = AceLibrary("AceLocale-2.2"):new("Grid")
GridStatusAggro = GridStatus:NewModule("GridStatusAggro")
GridStatusAggro.menuName = "Aggro"
--{{{ AceDB defaults
GridStatusAggro.defaultDB = {
debug = false,
alert_aggro = {
text = "Aggro",
enable = true,
color = { r = 1, g = 0, b = 0, a = 1 },
priority = 99,
range = true,
},
}
--}}}
GridStatusAggro.options = false
function GridStatusAggro:OnInitialize()
self.super.OnInitialize(self)
self:RegisterStatus("alert_aggro", L["Aggro alert"], nil, true)
end
function GridStatusAggro:OnEnable()
self:RegisterEvent("Banzai_UnitGainedAggro")
self:RegisterEvent("Banzai_UnitLostAggro")
end
function GridStatusAggro:Banzai_UnitGainedAggro(unitid)
local settings = self.db.profile.alert_aggro
self.core:SendStatusGained(UnitName(unitid), "alert_aggro",
settings.priority,
(settings.range and 40),
settings.color,
settings.text,
nil,
nil,
nil)
end
function GridStatusAggro:Banzai_UnitLostAggro(unitid)
self.core:SendStatusLost(UnitName(unitid), "alert_aggro")
end