View Single Post
04/13/15, 05:34 PM   #13
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
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.     RedirectTexture("/esoui/art/actionbar/ability_ultimate_framedecobg.dds", "")
  11.     RedirectTexture("/esoui/art/actionbar/abilityinset.dds", "")
  12.     RedirectTexture("/esoui/art/actionbar/abilityframe64_up.dds", "")  
  13. end
  14.  
  15. --Callback function for the player activated event (upon zone change or logging in new)
  16. local function Callback_Player_Activated(...)
  17.     RemoveActionbarBorders()
  18. end
  19.  
  20. --Callback function for the weapon swap event
  21. local function Weapon_Swapped(...)
  22.     RemoveActionbarBorders()
  23. end
  24.  
  25. --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
  26. --Register for the zone change/player ready event
  27.     EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_PLAYER_ACTIVATED, Callback_Player_Activated)
  28.  
  29. --Callback function for the addon loaded event (executes for EVERY addon that loads!)
  30. local function Addon_Loaded(eventCode, addOnName)
  31.     --Is THIS addon HERE found?
  32.     if(addOnName ~= "NoActionbarBorders") then
  33.         return
  34.     end
  35.     --If you got here your addon is found so execute the following code lines:
  36.     --Unregister this event again so it isn't fired again after this addon has beend loaded
  37.     EVENT_MANAGER:UnregisterForEvent("NoActionbarBorders", EVENT_ADD_ON_LOADED)
  38.     --Register for the zone change/player ready event
  39.     EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_PLAYER_ACTIVATED, Callback_Player_Activated)
  40.     --Register the callback function for the weapon bar switch
  41.     EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_ACTIVE_WEAPON_PAIR_CHANGED, Weapon_Swapped)
  42. end
  43.  
  44. --Register the event ADD_ON_LOADED to get started with your addon. As this event will be called for EVERY addon you need to
  45. --check your addon#s name inside the cllback function so it won't execute your code for EVERY addon!
  46. EVENT_MANAGER:RegisterForEvent("NoActionbarBorders", EVENT_ADD_ON_LOADED, Addon_Loaded)

Last edited by blakbird : 04/13/15 at 05:48 PM.
  Reply With Quote