View Single Post
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