Code:
local percentFrame=CreateFrame("MESSAGEFRAME",nil,UIParent)
percentFrame:RegisterEvent("UNIT_HEALTH")
percentFrame:SetWidth(200)
percentFrame:SetHeight(200)
percentFrame:SetPoint("CENTER",UIParent)
percentFrame:SetInsertMode("TOP")
percentFrame:SetBackdropColor(0,0,0,1);
percentFrame:Show()
function unitPercentHook()
if UnitGUID("target")==UnitGUID(arg1) then
percentFrame:AddMessage("Test message",1,0,0,10,5)
end
end
percentFrame:SetScript("OnEvent",unitPercentHook)
a:SetScript("OnEvent",b)
For testing, it's supposed to show a message whenever your targets HP changes. The frame itself though doesn't seem to be showing up.
No comments:
Post a Comment