tullamods / tullaRange

Colors actionbuttons when out of range
https://tullamods.com/tullaRange
MIT License
18 stars 6 forks source link

[10.1.0] ActionBarActionButtonMixin => ActionBarActionButtonDerivedMixin #22

Closed Wetxius closed 1 year ago

Wetxius commented 1 year ago

On latest PTR build changed ActionBarActionButtonMixin. Now Blizzard use ActionBarActionButtonDerivedMixin https://github.com/Gethe/wow-ui-source/commit/9e8c71b7ef6c8dd03796d27bcae292e0ec0b75ba#diff-b1cfbbf99c2cbb68ef9f30e85812e5a736154dec48da4d5ff2ed082c6e89c54eL91 Need to change all hook ActionBarActionButtonMixin to ActionBarActionButtonDerivedMixin. Without that color not worked on PTR.

Tuller commented 1 year ago

We should be okay for the moment. As far as I can tell, the entire point of that mixin is to define OnDragStop as a function that does nothing.

ActionBarActionButtonDerivedMixin = CreateFromMixins(ActionBarActionButtonMixin);
function ActionBarActionButtonDerivedMixin:OnDragStop() end 

in tullaRange, we hook the OnLoad event from ActionBarActionButtonMixin

local f = EnumerateFrames()

while f do
    if f.OnLoad == ActionBarActionButtonMixin.OnLoad then
        actionButton_OnLoad(f)
    end

    f = EnumerateFrames(f)
end

-- grab later ones, too
hooksecurefunc(ActionBarActionButtonMixin, "OnLoad", actionButton_OnLoad)

Because ActionBarActionButtonDerivedMixin doesn't redefine OnLoad, the code should still work as expected.

Wetxius commented 1 year ago

For me, color not worked on PTR until I manually change mixin to new one.

Wetxius commented 1 year ago

10.1.0-beta1

![image](https://user-images.githubusercontent.com/1249672/235157690-4e890dcf-afac-4db2-88b7-cf78ea482a24.png)

With mixin change:

![image](https://user-images.githubusercontent.com/1249672/235158267-14e59932-5fd6-4b19-8712-6cc2ea953395.png)