The action buttons inherit from ActionBarButtonCodeTemplate and ActionButtonTemplate.
The old and the new ActionButtonTemplate sets OnClick to the function SecureActionButton_OnClick.
The old ActionBarButtonCodeTemplate doesn't had an Onclick script.
The new ActionBarButtonCodeTemplate sets OnClick to this script
Lua Code:
<OnClick>
if (not self.draenorZoneDisabled) then
SecureActionButton_OnClick(self, button);
end
</OnClick>
I've read somewhere that the 'inherits' attribute just copies the tags from the template. So, with using two templates something that is specified in both must be overwritten. As Blizzard specifies all templates from the most common to the most specific from the right to the left I guess again that the tags are copied from the right to the left.
Keeping that in mind I would say it overwrites the Onclick from ActionButtonTemplate (as the 'inherits' attribute is "ActionBarButtonCodeTemplate, ActionButtonTemplate").
That means your code
Lua Code:
local button = SecureActionButton_OnClick
local function register(val)
if val.IsProtected and val.GetObjectType and val.GetScript and val:GetObjectType()=="CheckButton" and val:IsProtected() then
local script = val:GetScript("OnClick")
if script==button then
val:HookScript("OnEnter", function(self) bind:Update(self) end)
elseif script==stance then
val:HookScript("OnEnter", function(self) bind:Update(self, "STANCE") end)
elseif script==pet then
val:HookScript("OnEnter", function(self) bind:Update(self, "PET") end)
end
end
end
won't trigger as the action buttons OnClick is not longer equal to SecureActionButton_OnClick.
Maybe you could fix this with
Lua Code:
local button = ActionButton1:GetScript("OnClick")
I'm not sure if this is correct.
It's just a guess.
btw: What is draenorZoneDisabled good for?
[e] Ah, it's for handling garrison action Buttons.