Thread: ShowOverlayGlow
View Single Post
Unread 12-07-12, 01:44 PM   #6
Clamsoda
A Cobalt Mageweaver
Join Date: Nov 2011
Posts: 248
I just did a bit of testing, and the posted code SHOULD work. I should say it worked for Blessing of Kings, and assuming Molten Armor is spelled correctly, and you are using the default Blizzard action bars, or an addon that reuses Blizzard's buttons, it should work for you as well.

This code should be exactly the same as Vlad's, I just copy and pasted what was working for me.
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterUnitEvent("UNIT_AURA", "player")
  3. f:SetScript("OnEvent", function()
  4.   if UnitBuff("player", "Molten Armor") then
  5.     ActionButton_ShowOverlayGlow(ActionButton1)
  6.   else
  7.     ActionButton_HideOverlayGlow(ActionButton1)
  8.   end
  9. end)

Also, in response to one of your changes, you don't need to define your frame "f" as a Button, unless you are trying to inherit certain properties of buttons. All you are doing is creating, and using a frame to register and watch for events.

EDIT: I also wanted to make sure that it is clear to you that "ActionButton1" is specifying to add the OverlayGlow to the first button, on the first(main) action bar. If you wanted it on the 5th button, it would be "ActionButton5", and if you wanted it on the 3rd button of the MultiBarBotttomRight action bar, it would be "MultiBarBotttomRightButton3".

Last edited by Clamsoda : 12-07-12 at 01:49 PM.
Clamsoda is offline   Reply With Quote