View Single Post
06-09-17, 12:55 AM   #12
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 126
Lua Code:
  1. local function UpdateTargetMark(self)
  2.     local mark = self.targetMark
  3.     if not mark then return end
  4.  
  5.     if UnitIsUnit(self.unit, "target") and not UnitIsUnit(self.unit, "player") then
  6.         mark:Show()
  7.     else
  8.         mark:Hide()
  9.     end
  10. end
  11.  
  12. local function PostUpdatePlates(self, event, unit)
  13.     -- Update Mark
  14.     UpdateTargetMark(self)
  15.  
  16.     -- Unit Classification
  17.     local class = UnitClassification(unit)
  18.     if self.creatureIcon then
  19.         if class and classtex[class] then
  20.             local tex, a, b, c, d = unpack(classtex[class])
  21.             self.creatureIcon:SetTexture(tex)
  22.             self.creatureIcon:SetTexCoord(a, b, c, d)
  23.         else
  24.             self.creatureIcon:SetTexture(nil)
  25.         end
  26.     end
  27.  
  28.     -- Update PlayerPlate
  29.     if event == "NAME_PLATE_UNIT_ADDED" then
  30.         if UnitIsUnit(unit, "player") then
  31.             self.nameFrame:Hide()
  32.             self.Power:Show()
  33.  
  34.         else
  35.             self.nameFrame:Show()
  36.             self.Power:Hide()
  37.         end
  38.     elseif event == "NAME_PLATE_UNIT_REMOVED" then
  39.         self.nameFrame:Hide()
  40.         self.Power:Hide()
  41.     end
  42. end

"self.nameFrame" is the parent for healthBar's name and health value.

How to disable castbar for playerplate? It seems like not working if I just simply show/hide in callbacks.
  Reply With Quote