I have a problem with it. When i summon the pet the window doesn't
appear. I have to ReloadUI() to make it show. And when i dispand
pet the window doesnt disappear.
Could someone look at my attached files and point out what i did wrong?
I'm new to lua so please bare with me.
hmm don't know if found your bug already but i will try answering
From what i can see you call PetWindow_Update (which is responsible for showing hidding your frame) only OnLoad for your frame.
Code:
function PetWindow_OnLoad()
[cut]
this.attackModeCounter = 0;
this.attackModeSign = -1;
--this.flashState = 1;
--this.flashTimer = 0;
PetWindow_Update();
CombatFeedback_Initialize(PetHitIndicator, 30);
[cut]
end
But OnLoad happens much earlier then UnitExist("pet") returns true so it won't show... You should call PetWindow_Update at least on event: "PLAYER_PET_CHANGED"
here:
Code:
function PetWindow_OnEvent()
PeW_OnEvent(event);
if ( event == "PLAYER_PET_CHANGED" ) then
PeW_Update();
PetWindow_Update();
return;
end
if ( event == "PLAYER_ENTERING_WORLD" ) then
PeW_Update();
return;
end
end