Thread: UnitPowerAlt
View Single Post
02-19-11, 02:14 PM   #13
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Sacrife, why don't you add a tooltip for it as in the standart interface instead of displaying powerName on the bar itself?

lua Code:
  1. self.AltPowerBar.Tooltip = function(self)
  2.     local powerName = select(10, UnitAlternatePowerInfo(self.__owner.unit))
  3.     local powerTooltip = select(11, UnitAlternatePowerInfo(self.__owner.unit))
  4.        
  5.     GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 5)
  6.     GameTooltip:AddLine(powerName)
  7.     GameTooltip:AddLine("\n"..powerTooltip, nil, nil, nil, true)
  8.     GameTooltip:Show()
  9. end
  10.    
  11. self.AltPowerBar:EnableMouse()
  12. self.AltPowerBar:HookScript("OnLeave", GameTooltip_Hide)
  13. self.AltPowerBar:HookScript("OnEnter", self.AltPowerBar.Tooltip)
  Reply With Quote