Thread Tools Display Modes
09-04-17, 09:02 AM   #1
Colmbus
A Defias Bandit
Join Date: Sep 2017
Posts: 3
Spell Icon Shading

Hi guys - I was wondering if anyone would be able to help me out with a personal project =) As you know when a spell is unavailable it is either shaded in grey or grey/blue. The latter usually denotes the ability requires more of a certain resource to operate.

I am hoping to create an add-on so all unusable abilities are shaded in grey as opposed to grey and grey/blue. Does anyone know whether this is possible? I am fairly new to add-on development so any assistance would be greatly appreciated!

Thanks for reading!
  Reply With Quote
09-04-17, 01:28 PM   #2
Colmbus
A Defias Bandit
Join Date: Sep 2017
Posts: 3
Using photoshop I was able to draft up a bit of an example;

This is what it currently looks like:
http://imgur.com/LAnQjXx

And ideally this is how i'd like it to look with the addon:
http://imgur.com/VCs9SLo
  Reply With Quote
09-04-17, 06:16 PM   #3
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
I THINK that could be done using Masque. It has a layer for "Disabled", but I don't know if it works yet. Masque also, I don't think so anyway, doesn't work with the default action bars. However, it does work with just about every action bar addon.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
09-04-17, 08:51 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Have a look at http://www.wowinterface.com/download...ullaRange.html
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-05-17, 09:02 AM   #5
Colmbus
A Defias Bandit
Join Date: Sep 2017
Posts: 3
Hi - thanks for the responses =) tullarange isn't quite what i'm after, and to be honest I quite like working with the default action bars (sorry for being so picky). A guy on reddit posted

First off you'll want to learn about the /fstack command. It's really useful for figuring out what interface elements are actually called internally.

From this you can find out by hovering over the action bar that your action bar ability icons are referred to as ActionButton1 through 12.

You can dump the interface code yourself by enabling the -console command line argument (easier done through battle.net client, under settings --> game settings), or you can browse it over at (townlong-yak)[https://www.townlong-yak.com/framexml/live] (this also lets you download the interface code from there.)

Either way, using what you've figured out earlier, ctrl+f for ActionButton; this brings up ActionButton.lua and ActionButtonTemplate.xml

Take a look inside ActionButton.lua and try to figure out which part of the code is responsible for adding that shade of blue over abilities which you don't have enough resources to use.

In my case, I scrolled down until I spotted the ActionButton_Update function; more specifically, what captured my attention was the SetDesaturated() function that's being called and applied to the action button's icon. Close but not quite what I was looking for, so I did a ctrl+f search for icon:Set. This brought me down to the ActionButton_UpdateUsable function. This is what's responsible for fading out abilities when they're not useable. More specifically, lines 517-519 are responsible for the blue shading you're seeing.

You'll want to override what happens when the interface calls that function so you can get a different outcome. The best and easiest way to do that is to make use of hooksecurefunc. This lets you run your own code after the fact, whenever the specified function runs, with the same variables that are passed to the original function.

hooksecurefunc("ActionButton_UpdateUsable", function (self)
local isUsable, notEnoughMana = IsUsableAction(self.action)
if (notEnoughMana) then
self.icon:SetVertexColor(0.4, 0.4, 0.4)
self.NormalTexture:SetVertexColor(1.0, 1.0, 1.0)
end
end)

(In this case, self refers to the ActionButton for the ability that's currently being processed.)

The change happens quickly enough in memory that the client will never display the original blue shading, not even for 1 frame.


However i'm not sure how to implement this - my coding skills are mediocre to say the least. Does anyone know what he was talking about?
  Reply With Quote
09-05-17, 10:13 AM   #6
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
@jeffy162 you are correct sir. Masque does not (can not) work with the default buttons. Here is a quote from
Masque is an add-on for World of Warcraft that provides a skinning engine for button-based add-ons. Note that you must have an add-on that supports Masque installed in order to use it. Masque does not support the default interface.
However, you can use Dominos or Bartender to look almost exactly like the default action bars. There is a difference, albeit slight.

From there, yes, you could use the disabled flag within a button skin to achieve the desired effect.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Spell Icon Shading

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