Thread Tools Display Modes
06-26-20, 09:16 AM   #1
area1t
A Kobold Labourer
Join Date: Jun 2020
Posts: 1
Arena Numbers in ArenaEnemyFrame

Hi I am new here

I was wondering if anyone could help me create an addon I haven't been able to find.
I'm trying to make the player names on the arena frames change to the corresponding arena numbers.
The same way the addon "Arena Nameplate Numbers" works for nameplates but for the arena frames.


but for the arena frame names:


Here is the LUA for the addon "Arena Nameplate Numbers":
Lua Code:
  1. local U=UnitIsUnit hooksecurefunc("CompactUnitFrame_UpdateName",function(F)if IsActiveBattlefieldArena()and F.unit:find("nameplate")then for i=1,5 do if U(F.unit,"arena"..i)then F.name:SetText(i)F.name:SetTextColor(1,1,0)break end end end end)
  Reply With Quote
06-26-20, 06:09 PM   #2
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
I don't really know much about arena, but after taking a look at FrameXML/Blizzard_ArenaUI.lua for the first time, I would guess that a crude answer is maybe something like this?

Lua Code:
  1. for i=1,5 do
  2.   local frame = _G["ArenaEnemyFrame"..i]
  3.   frame:HookScript("OnEvent", function(__, event, arg1)
  4.     if arg1 == frame.unit and event == "UNIT_NAME_UPDATE" then
  5.      frame.name:SetText(i)
  6.     end
  7.   end)
  8. end

Again, I know nothing about arena so I could be totally off.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Arena Numbers in ArenaEnemyFrame

Thread Tools
Display Modes

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