-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathManaBalanceDruid.lua
62 lines (55 loc) · 1.77 KB
/
ManaBalanceDruid.lua
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
local module = ArcHUD:NewModule("ManaBalanceDruid")
module.version = "5.0 (@file-abbreviated-hash@)"
module.unit = "player"
module.noAutoAlpha = nil
module.defaults = {
profile = {
Enabled = true,
Outline = true,
Flash = false,
Side = 2,
Level = 1,
ShowSeparators = false,
Color = PowerBarColor["MANA"],
ShowTextHuge = false
}
}
module.options = {
attach = true
}
module.localized = true
module.class = "DRUID"
module.specs = nil -- array of SPEC_... constants; nil if this ring is available for all specs
module.powerType = Enum.PowerType.Mana
module.powerTypeString = "MANA"
module.flashAt = nil
function module:Initialize()
self.InitializePowerRing = ArcHUD.templatePowerRing.InitializePowerRing
self.OnModuleUpdate = ArcHUD.templatePowerRing.OnModuleUpdate
self.OnModuleEnable = ArcHUD.templatePowerRing.OnModuleEnable
self.UpdatePowerRing = ArcHUD.templatePowerRing.UpdatePowerRing
self.UpdatePower = ArcHUD.templatePowerRing.UpdatePower
self.UpdateActive = ArcHUD.templatePowerRing.UpdateActive
self:InitializePowerRing()
end
--
-- Can be overridden in case more events must be registered (e.g., for detecting shapeshifts)
--
function module:OnActiveChanged(oldState, newState)
if newState then
-- Register additional events
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "UpdateActive")
self:RegisterEvent("UPDATE_SHAPESHIFT_FORMS", "UpdateActive")
else
-- Unregister additional events
self:UnregisterEvent("UPDATE_SHAPESHIFT_FORM")
self:UnregisterEvent("UPDATE_SHAPESHIFT_FORMS")
end
end
--
-- Can be overridden in case other conditions apply (e.g., shapeshift form)
--
function module:CheckVisible()
local powerType = UnitPowerType(self.unit)
return powerType == Enum.PowerType.LunarPower
end