WoWInterface (
-   Lua/XML Help (
-   -   How does SetActionUIButton work? (

Ethly 02-12-19 02:08 PM

How does SetActionUIButton work?
I was analyzing ActionButton.lua and I've found that Blizzard uses something different for handling their action bar cooldowns instead of events (event code is there, but the following code suggests that they rewrote it):

        --self:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN");                not updating cooldown from lua anymore, see SetActionUIButton
I tried to find any information about that function but did not find anything. Is it possible to use this function for my own frames? I understand that I can inherit from ActionButtonTemplate, but there's a lot of stuff there that I don't need so instead of disabling it, I'd prefer just to cut it all. Basically I want to display icon with radial cooldown and nothing else.

Fizzlemizz 02-12-19 04:49 PM

ActionButton.lua ~line 337

SetActionUIButton(self, action, self.cooldown);

Ethly 02-15-19 05:49 PM

Here's my code and it does not work:

<CheckButton parent="UIParent">
                <Size x="28" y="28"/>
                        <Anchor point="BOTTOMLEFT" relativeTo="PlayerFrame" relativePoint="TOPLEFT" x="108" y="-16"/>
                        <Layer level="BACKGROUND">
                                <Texture parentKey="myicon"/>
                        <Cooldown inherits="CooldownFrameTemplate" parentKey="mycooldown"/>
                        <OnLoad function="MUShieldSlam_OnLoad"/>


function MUShieldSlam_OnLoad(self)
        local texture = GetActionTexture(2);
        SetActionUIButton(self, 2, self.mycooldown);

I have shield slam ability on action button 2.

All times are GMT -6. The time now is 03:01 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI