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
that should fix it