View Single Post
04/13/15, 05:45 PM   #14
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,028
Ok, as I said you don't need the weapon switch event anymore, because you can exchange the textures 1 time at the player activated event. After they are changed from original textures to NONE they won't show up anymore, even if you change the weapons.
And if you reload or rezone the player activated event will be fired again and replace the texturs with NONE again, so you should be fine.

Here is the result:
Lua Code:
  1. --Just a function to reduce redundant code
  2. local function RemoveActionbarBorders()
  3.     --remove borders at action buttons
  4.     for slotNum = 3, 9 do
  5.         local button = ZO_ActionBar_GetButton(slotNum).button
  6.         button:SetNormalTexture("")
  7.         button:SetPressedTexture("")
  8.         button:SetDisabledTexture("")
  9.     end
  10.     --Remove the border texturs now until next ReloadUI or zone change
  11.     RedirectTexture("/esoui/art/actionbar/ability_ultimate_framedecobg.dds", "")
  12.     RedirectTexture("/esoui/art/actionbar/abilityinset.dds", "")
  13.     RedirectTexture("/esoui/art/actionbar/abilityframe64_up.dds", "")
  14. end
  15.  
  16. --Callback function for the player activated event (upon zone change or logging in new)
  17. local function Callback_Player_Activated(...)
  18.     RemoveActionbarBorders()
  19. end
  20.  
  21. --Put this somewhere where your addon gets initialized, e.g. inside callback function of EVENT_ADDON_ON_LOAD or just at the bottom of your addon
  22. --Register for the zone change/player ready event
  23. EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_PLAYER_ACTIVATED, Callback_Player_Activated)
  24.  
  25. --Callback function for the addon loaded event (executes for EVERY addon that loads!)
  26. local function Addon_Loaded(eventCode, addOnName)
  27. --Is THIS addon HERE found?
  28.     if(addOnName ~= "NoActionbarBorders") then
  29.         return
  30.     end
  31.     --If you got here your addon is found so execute the following code lines:
  32.     --Unregister this event again so it isn't fired again after this addon has beend loaded
  33.     EVENT_MANAGER:UnregisterForEvent("NoActionbarBorders", EVENT_ADD_ON_LOADED)
  34.     --Register for the zone change/player ready event
  35.     EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_PLAYER_ACTIVATED, Callback_Player_Activated)
  36. end
  37.  
  38. --Register the event ADD_ON_LOADED to get started with your addon. As this event will be called for EVERY addon you need to
  39. --check your addon#s name inside the cllback function so it won't execute your code for EVERY addon!
  40. EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_ADD_ON_LOADED, Addon_Loaded)

Btw: there is still one small texture line left beyond the ultimate skill
  Reply With Quote