WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Arena Numbers in ArenaEnemyFrame (https://www.wowinterface.com/forums/showthread.php?t=58066)

area1t 06-26-20 09:16 AM

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)

DahkCeles 06-26-20 06:09 PM

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.


All times are GMT -6. The time now is 02:37 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI