View Single Post
03-15-19, 11:45 PM   #22
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
I hate to pseudonecro this thread, but I found a solution to this if you still cared.

I did some intense digging, and came up with:
Lua Code:
  1. hooksecurefunc('ActionBarController_UpdateAll', function()  
  2.     for i = 1, 12 do
  3.         local button = _G['ActionButton'..i]
  4.         local overrideButton = _G['OverrideActionBarButton'..i]
  5.         local _, spellID
  6.         if overrideButton then
  7.             _, spellID = GetActionInfo(overrideButton.action)
  8.         end
  9.  
  10.         if ((HasOverrideActionBar() or HasVehicleActionBar()) and (spellID and spellID > 0)) or (not HasOverrideActionBar() and not HasVehicleActionBar()) then
  11.             button:SetAttribute('statehidden', false)
  12.             button:Show()
  13.         else
  14.             button:SetAttribute('statehidden', true)
  15.             button:Hide()
  16.         end
  17.     end
  18. end)

the key thing is the SetAttribute('statehidden') for the buttons. The page changes early on in this quest (as soon as you mount the gryphon) but then the attributes are changed after the page change. I found the function above to hook and it works

HOWEVER, by using SetAttribute outside of a secure environment, this does cause tainting.


I've conversely come up with:
Lua Code:
  1. frame:SetAttribute('_onattributechanged', [[
  2.         for i = 1, 12 do
  3.             local button = _G['ActionButton'..i]
  4.             local overrideButton = _G['OverrideActionBarButton'..i]
  5.             local _, spellID
  6.             if overrideButton then
  7.                 _, spellID = GetActionInfo(overrideButton.action)
  8.             end
  9.  
  10.             if ((HasOverrideActionBar() or HasVehicleActionBar()) and (spellID and spellID > 0)) or (not HasOverrideActionBar() and not HasVehicleActionBar()) then
  11.                 button:SetAttribute('statehidden', false)
  12.                 button:Show()
  13.             else
  14.                 button:SetAttribute('statehidden', true)
  15.                 button:Hide()
  16.             end
  17.         end
  18.     ]])

but IDK if it works and it takes like 2-3 hours of questing to get to that particular quest to test it. If anyone can test that, let me know, if not, I'll post back when I have the time to get another character to that quest.
  Reply With Quote