Lua Code:
local function UpdateTargetMark(self)
local mark = self.targetMark
if not mark then return end
if UnitIsUnit(self.unit, "target") and not UnitIsUnit(self.unit, "player") then
mark:Show()
else
mark:Hide()
end
end
local function PostUpdatePlates(self, event, unit)
-- Update Mark
UpdateTargetMark(self)
-- Unit Classification
local class = UnitClassification(unit)
if self.creatureIcon then
if class and classtex[class] then
local tex, a, b, c, d = unpack(classtex[class])
self.creatureIcon:SetTexture(tex)
self.creatureIcon:SetTexCoord(a, b, c, d)
else
self.creatureIcon:SetTexture(nil)
end
end
-- Update PlayerPlate
if event == "NAME_PLATE_UNIT_ADDED" then
if UnitIsUnit(unit, "player") then
self.nameFrame:Hide()
self.Power:Show()
else
self.nameFrame:Show()
self.Power:Hide()
end
elseif event == "NAME_PLATE_UNIT_REMOVED" then
self.nameFrame:Hide()
self.Power:Hide()
end
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.