Originally Posted by
Arielle
That's why everyone loves WeakAuras ^.^
Even that I find too "heavy". Frankly it's only a hand full of lines o' code to get a full screen texture flash when I'm at more then 60 rage. Took me a bit to find out how the LUA methods have changed since I last did such an add on, but in the end it's fairly straight forward. I also now have the events for when Savage Defense is applied, refreshed and lost so I can add alerts/flashes for those as well if I choose.
Textured frame,
Code:
-- Rage flash frame
local f = CreateFrame("Frame","rageFrame",WorldFrame);
f:SetFrameStrata("BACKGROUND");
f:SetClampedToScreen(true)
f:SetAllPoints(UIParent)
local t = f:CreateTexture(nil,"BACKGROUND");
t:SetTexture("Interface\\AddOns\\TankScripts\\Textures\\rage.tga");
t:SetAlpha(0.5);
t:SetBlendMode("ADD");
t:SetVertexColor(1, 0.1, 0.1);
t:SetAllPoints(frame);
f.texture = t;
f:SetPoint("CENTER",0,0);
f:Hide();
Then trap the UNIT_POWER event to start the flashing when over 60 rage and stop it when under or not in bear form.
Code:
if (event=="UNIT_POWER") then
if(UnitPowerType("player")==1 and TS_SAVAGE=="on") then
if(UnitPower("player")>=60) then
if (UIFrameIsFlashing(f)) then
-- f.fadeInTime = 0.4;
-- f.fadeOutTime = 0.6;
-- f.flashInHoldTime = 1;
else
UIFrameFlash(f, 0.5, 0.5, -1);
end
else
if (UIFrameIsFlashing(f)) then
UIFrameFlashStop(f);
end
end
else
if (UIFrameIsFlashing(f)) then
UIFrameFlashStop(f);
end
end
end