View Single Post
07-19-23, 03:48 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,333
The "checked" texture is the yellow/white border around the icon when the ability is active. The pushed and highlight textures are similar border styles and not the actual icon either.

Hooking directly into the function that sets the icons worked for me.
Lua Code:
  1. hooksecurefunc("StanceBar_UpdateState",function()
  2.     for i=1,math.min(NUM_STANCE_SLOTS,GetNumShapeshiftForms()) do
  3.         local _,active,_,spellid=GetShapeshiftFormInfo(i);
  4.         local icon=StanceBarFrame.StanceButtons[i].icon;
  5.         icon:SetTexture(GetSpellTexture(spellid));
  6.         icon:SetDesaturated(active);
  7.     end
  8. end);

The actionbars on the other hand don't have a clear way to identify if a toggled ability is active. You could compare the action texture with the spell texture and see if they differ, but this causes some false positives for auto-attack type abilities that show the equipped weapon's icon instead of their internal spell texture.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 07-19-23 at 04:11 AM.
  Reply With Quote