Hello again!
I've been trying to change the texture of my PetFrame but because the whole frame reloads every time you call it its not done this simple:
Lua Code:
PetFrameTexture:SetTexture("xxxxx");
So what I've tried is to take a look at the PetFrame.lua from blizzard and copied the following code into my addon:
Lua Code:
function PetFrame_Update (self, override)
if ( (not PlayerFrame.animating) or (override) ) then
if ( UnitIsVisible(self.unit) and PetUsesPetFrame() and not PlayerFrame.vehicleHidesPet ) then
if ( self:IsShown() ) then
UnitFrame_Update(self);
else
self:Show();
end
--self.flashState = 1;
--self.flashTimer = PET_FLASH_ON_TIME;
if ( UnitPowerMax(self.unit) == 0 ) then
PetFrameTexture:SetTexture("xxxxxx");
PetFrameManaBarText:Hide();
else
PetFrameTexture:SetTexture("xxxxxx");
end
PetAttackModeTexture:Hide();
RefreshDebuffs(self, self.unit, nil, nil, true);
else
self:Hide();
end
end
end
It works but I get the following error sometimes and the ToT Frame vanishs.
Lua Code:
240x [ADDON_ACTION_BLOCKED] AddOn "GhettoFrames" tried to call the protected function "TargetFrameToT:Show()".!BugGrabber-r198-release\BugGrabber.lua:552: in function FrameXML\TargetFrame.lua:924: in function "TargetofTarget_Update"FrameXML\TargetFrame.lua:109: in function "TargetFrame_Update"FrameXML\TargetFrame.lua:154: in function "OnEvent"FrameXML\UnitFrame.lua:673: in function :"TARGETNEARESTFRIEND":1: in function :"TARGETNEARESTFRIEND":1Locals:nil
Anyone who got an idea to fix this? thanks alot!greetings