-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuffy.lua
58 lines (46 loc) · 1.39 KB
/
buffy.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
function updateBuffStatus( event )
local buffs = Inspect.Buff.List( "player" )
local buffDetail = Inspect.Buff.Detail( "player", buffs )
local counter = 1
local neededBuffs = {
"Lifebound Veil",
"Living Energy",
"Living Shell",
}
for key, buff in pairs( buffDetail ) do
if ( contains( neededBuffs, buff.name )) then
table.remove( neededBuffs, counter )
end
counter = counter + 1
end
createStatusNotifier( neededBuffs )
end
function createStatusNotifier( missingBuffs )
local context = UI.CreateContext( "BuffyWatchFrame" )
x = 0
y = 0
for _, buff in pairs( missingBuffs ) do
local frame = UI.CreateFrame( "Text", "BuffWatchContainer", context )
frame:SetText( buff )
-- x = x + frame:GetFullWidth()
-- frame:SetWidth( frame:GetFullWidth() )
-- frame:SetHeight( frame:GetHeight() )
frame:SetPoint( "TOPCENTER", UIParent, "TOPCENTER", x, y )
frame:SetBackgroundColor( 0, 0, 0, 1 )
end
end
function contains(table, element)
for k,v in pairs( table ) do
if v == element then
return true
end
end
return false
end
function printTable( table )
for k, v in pairs( table ) do
print(k, v)
end
end
updateBuffStatus()
-- Command.Event.Attach( Event.System.Update.Begin, updateBuffStatus, "BuffUpdate" )