View Single Post
11-08-14, 02:30 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
From DUF:

Code:
	if (event == "PET_BATTLE_OPENING_START" and self.unit ~= "target") then
		if DUF_Settings[DUF_INDEX].PetBattleHide then
			self.PetBattleHidden = true
			RegisterUnitWatch(self, true)
			RegisterStateDriver(self, "visibility", "[petbattle] hide; default")
		end
	end
Code:
if (event == "PET_BATTLE_CLOSE") then
		if (self.PetBattleHidden) then
			UnregisterStateDriver(self, "visibility")
			UnregisterUnitWatch(self)
			self.PetBattleHidden = nil
			self:Show();
			return
		end
...
DUF is over complicated in some things but this should give the context for pet battle/unit frame interaction.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 11-08-14 at 03:03 AM.