Thread Tools Display Modes
02-12-19, 02:08 PM   #1
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
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):
Code:
	--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.
  Reply With Quote
02-12-19, 04:49 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
ActionButton.lua ~line 337
Code:
SetActionUIButton(self, action, self.cooldown);
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
02-15-19, 05:49 PM   #3
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Here's my code and it does not work:
Code:
<CheckButton parent="UIParent">
		<Size x="28" y="28"/>
		<Anchors>
			<Anchor point="BOTTOMLEFT" relativeTo="PlayerFrame" relativePoint="TOPLEFT" x="108" y="-16"/>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="myicon"/>
			</Layer>
		</Layers>
		<Frames>
			<Cooldown inherits="CooldownFrameTemplate" parentKey="mycooldown"/>
		</Frames>
		<Scripts>
			<OnLoad function="MUShieldSlam_OnLoad"/>
		</Scripts>
	</CheckButton>
Code:
function MUShieldSlam_OnLoad(self)
	local texture = GetActionTexture(2);
	self.myicon:SetTexture(texture);
	SetActionUIButton(self, 2, self.mycooldown);
end
I have shield slam ability on action button 2.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How does SetActionUIButton work?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off