Originally Posted by Rakkerzero
I've a couple of panels that i want to hide in Pet Battles. How can do that?
|
You need to have the two events PET_BATTLE_CLOSE and PET_BATTLE_OPENING_START registered for a frame (one you want to hide). And assuming they're not secure frames then in its OnEvent function:
Code:
if event == "PET_BATTLE_CLOSE" then
if self.PetBattleHidden then
self.PetBattleHidden = nil
self:Show();
OtherPanel:Show()
-- Show other panels
return
end
end
if not self:IsVisible() then return; end
if event == "PET_BATTLE_OPENING_START" then
self.PetBattleHidden = true
self:Hide()
OtherPanel:Hide()
-- Hide other panels
end