CreateFrame('frame'):SetScript('OnUpdate', function(self, elapsed)
for index = 1, select('#', WorldFrame:GetChildren()) do
local f = select(index, WorldFrame:GetChildren())
if f:GetName() and f:GetName():find('NamePlate%d') then
f.h = select(1, select(1, f:GetChildren()):GetChildren())
if f.h then
if not f.h.v then
f.h.v = f.h:CreateFontString(nil, "ARTWORK")
f.h.v:SetPoint("RIGHT")
f.h.v:SetFont(STANDARD_TEXT_FONT, 9, 'OUTLINE')
else
local _, maxh = f.h:GetMinMaxValues()
local val = f.h:GetValue()
f.h.v:SetText(string.format(math.floor((val/maxh)*100)).." %")
end
end
end
end
end)
무거운 다른 기능들도 있는 애드온 안쓰고 딱 기본 네임플레이트에 현재 체력퍼센트만 표시되게끔 해서 쓰려고 합니다.
그래서 위에 처럼 해서 애드온으로 적용시키면 예전엔 문제가 없었는데, 최근에는 인던만 들어가면 in function `GetName' 무한에러가 뜹니다..
어떻게 수정하면 에러 없이 제대로 쓸 수 있을까요? 도와주실 수 있는 분 계세요?