View Single Post
06-29-13, 01:30 PM   #358
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Originally Posted by Rakkerzero View Post
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
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-29-13 at 01:32 PM.
  Reply With Quote