I'll give a drycode try (meaning I didn't try it ingame). :P
aggrodisplay.xml
xml Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="aggrodisplay.lua" />
<Frame name="aggroFrame" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
<Size x="76" y="30" />
<Anchors>
<Anchor point="TOPLEFT">
</Anchor>
</Anchors>
<Scripts>
<OnMouseDown>self:StartMoving();</OnMouseDown>
<OnMouseUp>self:StopMovingOrSizing();</OnMouseUp>
<OnLoad>aggroFrame_OnLoad(self);</OnLoad>
<OnEvent>aggroFrame_OnEvent(self, event, ...);</OnEvent>
</Scripts>
<Layers>
<Layer>
<FontString name="aggro" inherits="GameFontNormalSmall" font="Fonts\ARIALN.TTF" text="*" justifyH="RIGHT">
<FontHeight>
<AbsValue val="26"/> -- text size
</FontHeight>
<Size x="76" y="30" />
</FontString>
</Layer>
</Layers>
</Frame>
</Ui>
aggrodisplay.lua
lua Code:
function aggroFrame_OnEvent(self, event, ...)
local aggro_TRUE = "Aggro !";
local aggro_FALSE = "*";
if (event == "PLAYER_REGEN_DISABLED") then
aggro_TRUE = "Aggro !";
aggro:SetText(aggro_TRUE);
end
if (event == "PLAYER_REGEN_ENABLED") then
aggro_FALSE = "*";
aggro:SetText(aggro_FALSE);
end
end
function aggroFrame_OnLoad(self)
self:RegisterEvent("PLAYER_REGEN_DISABLED");
self:RegisterEvent("PLAYER_REGEN_ENABLED")
DEFAULT_CHAT_FRAME:AddMessage("Aggro Display loaded -OK-");
end