/trunk
self:GuiUpdate(); |
--end |
self.LastUpdate = 0; |
end |
function RuneWatch:OnEnable() |
self:Print("Loaded..."); |
self:Print("Loaded, type /rune for options."); |
--if (UnitClass("Player") == "DEATHKNIGHT") then |
self:GuiUpdate(); |
local _, uclass = UnitClass("Player"); |
if (uclass ~= "DEATHKNIGHT") then |
--self:Print("Not a Deathknight"); |
self.Gui.Anchor:Hide(); |
else |
--self:Print("Deathknight"); |
self.Gui.Anchor:Show(); |
end |
end |
end |
function RuneWatch:OnUpdate(self, elapsed) |
RuneWatch.LastUpdate = RuneWatch.LastUpdate + elapsed; |
if (RuneWatch.LastUpdate > 0.5) then |
RuneWatch.LastUpdate = 0; |
-- Update the GUI |
RuneWatch:UNIT_RUNIC_POWER("UNIT_RUNIC_POWER", "player"); |
end |
end |
function RuneWatch:RUNE_POWER_UPDATE(event, ...) |
local rune, usable = ...; |
if not usable then |
self.Gui.Anchor:SetHeight(100); |
self.Gui.Anchor:SetPoint("CENTER", UIParent, "CENTER"); |
--self.Gui.Anchor:SetFrameStrata("LOW"); |
self.Gui.Anchor:SetScript("OnUpdate", function(self, elapsed) RuneWatch:OnUpdate(self, elapsed) end); |
self.Gui.Anchor:Show(); |
--self.Gui.Art.Bar = artBar; |
self:InitRPBar(); |
self:Print("Initialized Art...") |
end |
function RuneWatch:InitRPBar() |