View Single Post
05-27-18, 11:03 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
You could try calling this function on each of the Arena Frames. This is called when you adjust the CVAR variable
Lua Code:
  1. function ArenaEnemyFrames_Disable(self)
  2.   self.show = false;
  3.   ArenaEnemyFrames_UpdateVisible();
  4. end

This is the function that calls it in Blizzards addon.
Lua Code:
  1. function ArenaEnemyFrames_CheckEffectiveEnableState(self, cvarUpdate)
  2.   if (C_PvP.IsInBrawl()) then
  3.     ArenaEnemyFrames_Disable(self);
  4.   else
  5.     if ( GetCVarBool("showArenaEnemyFrames") or cvarUpdate ) then
  6.       ArenaEnemyFrames_Enable(self);
  7.     else
  8.       ArenaEnemyFrames_Disable(self);
  9.     end
  10.   end
  11. end

Which is called by the Event Manager function
Lua Code:
  1. if ( (event == "CVAR_UPDATE") and (arg1 == "SHOW_ARENA_ENEMY_FRAMES_TEXT") ) then
  2.     ArenaEnemyFrames_CheckEffectiveEnableState(self, arg2 == "1");

Your code should work I believe but you will need to have an frame to monitor the event ADDON_LOADED so that once you Load Blizzards addon it will trigger the event and its information should be available to use and adjust. I thought the SetCVar would trigger the CVAR_UPDATE event but it is looking for a different CVAR value to what you are setting which could explain why it isn't doing anything noticable. Maybe changing

SetCVar("showArenaEnemyFrames", 0)

to

SetCVar("SHOW_ARENA_ENEMY_FRAMES_TEXT", 0)

and see how that works, then try the ADDON_LOADED steps I suggested.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote