View Single Post
11-29-13, 10:39 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Assuming you are using the default party frames:

OnLoad
Code:
-- Change this value for each frame to match the party unit ID:
self.id = 1

-- Don't need to edit below here.
self:RegisterEvent("PLAYER_TARGET_CHANGED")

self.unit = "party"..self.id
self.frame = _G["PartyFrame"..self.id]

self.frame:HookScript("OnEnter", function()
     self:Show()
end)
self.frame:HookScript("OnLeave", function()
     if not UnitIsUnit("target", self.unit) then
          self:Hide()
     end
end)
OnEvent
Code:
self:SetShown(self:IsMouseOver() or UnitIsUnit("target", self.unit))
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote