Thread Tools Display Modes
10-21-10, 02:30 AM   #1
Korby
A Murloc Raider
Join Date: Jun 2008
Posts: 9
AggroDisplay

Long ago when I started playing WoW, one of the first addons I downloaded from this site was named AggroDisplay. That addon has worked flawlessly up until 4.01 hit.

I am not a programmer, though I do understand enough to see how things work, and what this addon does is very simple. If PLAYER_REGEN_ENABLED is true (essentially meaning that the player is not in combat and is regening health and mana at a normal rate), then the addon just displays an * on the screen. However, if you happen to tick something off and PLAYER_REGEN_DISABLED is true, then the message "Aggro!" is shown on screen. Nothing more, nothing less, short and simple.

Could somebody please take a look at it, the lua is only 25 lines long, and see if you can get it working for 4.01? I would really appreciate it.
  Reply With Quote
10-21-10, 02:56 AM   #2
moggan
A Murloc Raider
Join Date: Feb 2009
Posts: 4
It's a rar archive which means I can't even open it :/

You might consider bar4threat or Simple Threat Meter (both on this site).
  Reply With Quote
10-21-10, 06:21 AM   #3
Korby
A Murloc Raider
Join Date: Jun 2008
Posts: 9
Except I don't want a threat meter, I have Omen for that, and even Omen doesn't do what this does unless I have the mob targeted.

Also, I should have just put this here in the first post, since it's so short.

Code:
function aggroFrame_OnEvent()
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()
    this:RegisterEvent("PLAYER_REGEN_DISABLED");
    this:RegisterEvent("PLAYER_REGEN_ENABLED")
    DEFAULT_CHAT_FRAME:AddMessage("Aggro Display loaded -OK-");
end
That's the whole thing. I doubt the XML needs any editing though.
  Reply With Quote
10-21-10, 06:40 AM   #4
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
I'll give a drycode try (meaning I didn't try it ingame). :P

aggrodisplay.xml
xml Code:
  1. <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/">
  2. <Script file="aggrodisplay.lua" />
  3.  
  4.     <Frame name="aggroFrame" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
  5.         <Size x="76" y="30" />
  6.         <Anchors>
  7.             <Anchor point="TOPLEFT">
  8.             </Anchor>
  9.         </Anchors>
  10.         <Scripts>
  11.             <OnMouseDown>self:StartMoving();</OnMouseDown>
  12.             <OnMouseUp>self:StopMovingOrSizing();</OnMouseUp>
  13.             <OnLoad>aggroFrame_OnLoad(self);</OnLoad>
  14.             <OnEvent>aggroFrame_OnEvent(self, event, ...);</OnEvent>
  15.         </Scripts>
  16.  
  17.         <Layers>
  18.             <Layer>
  19.                 <FontString name="aggro" inherits="GameFontNormalSmall" font="Fonts\ARIALN.TTF" text="*" justifyH="RIGHT">
  20.                     <FontHeight>
  21.                         <AbsValue val="26"/> -- text size
  22.                     </FontHeight>
  23.                     <Size x="76" y="30" />
  24.                 </FontString>
  25.                                    
  26.             </Layer>
  27.         </Layers>
  28.     </Frame>
  29.  
  30. </Ui>

aggrodisplay.lua
lua Code:
  1. function aggroFrame_OnEvent(self, event, ...)
  2.     local aggro_TRUE = "Aggro !";
  3.     local aggro_FALSE = "*";
  4.  
  5.     if (event == "PLAYER_REGEN_DISABLED") then
  6.         aggro_TRUE = "Aggro !";
  7.  
  8.         aggro:SetText(aggro_TRUE);
  9.     end
  10.  
  11.     if (event == "PLAYER_REGEN_ENABLED") then
  12.         aggro_FALSE = "*";
  13.    
  14.         aggro:SetText(aggro_FALSE);
  15.     end
  16.  
  17. end
  18.  
  19. function aggroFrame_OnLoad(self)
  20.     self:RegisterEvent("PLAYER_REGEN_DISABLED");
  21.     self:RegisterEvent("PLAYER_REGEN_ENABLED")
  22.     DEFAULT_CHAT_FRAME:AddMessage("Aggro Display loaded -OK-");
  23. end
__________________
Oh, the simulated horror!
  Reply With Quote
10-21-10, 08:44 PM   #5
Korby
A Murloc Raider
Join Date: Jun 2008
Posts: 9
Thumbs up

Beautiful! Works perfectly. Thank you so much.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » AggroDisplay


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off