View Single Post
10-07-20, 11:35 AM   #1
Ayacoz
A Murloc Raider
Join Date: Nov 2019
Posts: 5
Simple Nameplate Addon help needed

Hi there, i need some advice/help about an addon that i use.

Someone here in the forums did the code for me

local NamePlateHealthText={};
hooksecurefunc(NamePlateDriverFrame,"OnNamePlateCreated",function(self,base)-- Hook Nameplate creation
local unitframe=base.UnitFrame;

local health=unitframe.healthBar:CreateFontString(nil,"OVERLAY");
health:SetFont("Fonts\\FRIZQT__.TTF",12,"OUTLINE");-- Fonts are easier to read when made from scratch rather than resizing an inherited one
health:SetPoint("CENTER");
health:SetTextColor(1,1,1);

NamePlateHealthText[unitframe]=health;
end);

hooksecurefunc("CompactUnitFrame_UpdateHealth",function(self)-- This is a shared function with other UnitFrames
if NamePlateHealthText[self] then
local cur,max=UnitHealth(self.displayedUnit),UnitHealthMax(self.displayedUnit);
NamePlateHealthText[self]:SetFormattedText("%d - %.0f%%",cur,100*cur/max); end
end);


It works great for BfA, but ion Shadowlands, it doesnt, can anyone help me out ?

  Reply With Quote