I seem to be getting some LUA errors from a little custom add-on of mine. Specifically, I am getting errors such as 'tried to call the protected function "PartyMemberFrame1:SetAttribute()"' and 'tried to call the protected function "PartyMemberFrame1PetFrame:SetAttribute()"'. It seems to be from the following code, which just flashes a frame when rage is more then 60. I can think of no reason it should be looking at the party frame...
Code:
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"); --Interface\\FullScreenTextures\\LowHealth Interface\\FullScreenTextures\\OutofControl
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();
Code:
function MyAddon_OnEvent(self, event, unitID, ...)
if (unitID == "player") then
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
...