No. One of the caveats of SetVertexColor is that instead of replacing the color like you'd think, it adjusts the color by amount you specify, in percent. So, for example:
Say the original is:
Texture:SetVertexColor(1, 0, 0.5, 0.5)
If you were to do something like this:
Texture:SetVertexColor(1, 1, 0.5, 0.5)
The end result would be:
{1, 0, 0.25, 0.25}
Because 1x1=1, 0x1=0, 0.5x0.5=0.25
Hence the link I posted. By setting each one of those to nil, it basically wipes the color which allows your color to be fully applied (i just threw it in there to see if it would work, don't know if there'll be any side effects. :p).
Edit: The code I posted in my previous post is what needs to be changed in Core.lua of InlineAura. This will keep you from having to fool with LBF at all. Of course, if there's some adverse side effects, I know nothing! :p
Hrm... I think one side effect could be to reset the LBF skin color of Checked texture.
I thought about that, too. Thing is, that there's never going to be a "Checked" state on a spell/ability that applies a debuff, so that state will never be used on that button. Unless, of course, the user moves an ability that has one into that slot...
The only thing I can think of to ensure that no issues arise is to store the "old" colors in a local table by buttonid or something.
So, when the aura border is applied, use :GetVertexColor to store the colors in the table. Then, nil out the colors and then apply the aura's colors. When the aura is removed, nil out the aura's colors and then reapply the old colors. Something like this, though this is just dry coded. You might have to play with it:
local oldColors = {}
local function ActionButton_UpdateBorder(self, spell)
if spell then
local aura, auraType = GetAuraToDisplay(spell)
if aura then
local color = db.profile['color'..auraType..(aura.isMine and 'Mine' or 'Others')]
oldColors[self.id] = self:GetCheckedTexture():GetVertexColor()
self:GetCheckedTexture():SetVertexColor(nil, nil, nil, nil)
self:GetCheckedTexture():SetVertexColor(unpack(color))
ActionButton_UpdateTimer(self, aura)
return true
end
end
ActionButton_UpdateTimer(self, nil)
if (oldColors[self.id]) then
self:GetCheckedTexture():SetVertexColor(nil, nil, nil, nil)
self:GetCheckedTexture():SetVertexColor(oldColors[self.id])
end
end
Note that "self.id" is just there to represent that button's id. You'll have to figure out how to handle that yourself. Also, I'm not exactly sure how GetVertexColor returns its values. It should be a table. You'll have to play with it. The above is just an idea. /shrug
Thing is, that there's never going to be a "Checked" state on a spell/ability that applies a debuff, so that state will never be used on that button.
When you press the button to perform its action (either by mouse click or key binding), it gets checked. Now I guess I just have to check if it does really reset the color or not.
Thanks guys. Getting an error in r28 though when I cast Mend Pet:
[2009/03/12 17:34:22-5278-x5]: ...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:206: attempt to perform arithmetic on local 'r' (a nil value):
<in C code>: in function `SetVertexColor'
InlineAura-r28 \Core.lua:456: in function <Interface\AddOns\InlineAura\Core.lua:451>
(tail call): ?:
InlineAura-r28 \Core.lua:600: in function <Interface\AddOns\InlineAura\Core.lua:598>
<in C code>: in function `ActionButton_UpdateState'
InlineAura-r28 \Core.lua:515: in function <Interface\AddOns\InlineAura\Core.lua:505>
---
Getting loads of errors. This one for example when I cast my Hawkstrider:
[02:01:31] ...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:411: attempt to perform arithmetic on local 'r' (a nil value)
[C]: ?
...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:411: in function <...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:401>
[C]: in function `SetVertexColor'
Interface\AddOns\InlineAura\Core.lua:456: in function <Interface\AddOns\InlineAura\Core.lua:451>
(tail call): ?
Interface\AddOns\InlineAura\Core.lua:600: in function <Interface\AddOns\InlineAura\Core.lua:598>
[C]: in function `ActionButton_UpdateState'
Interface\AddOns\InlineAura\Core.lua:515: in function <Interface\AddOns\InlineAura\Core.lua:505>
Edit: Uhm... mostly the same that HunterZ posted. Nvm. ^_^
When you press the button to perform its action (either by mouse click or key binding), it gets checked. Now I guess I just have to check if it does really reset the color or not.
Ah, yes. I forgot about that. Let me see what I can come up with and maybe solve these errors as well.
Alright, I think I finally have it figured out. One has to simply do some reverse math on the SetVertexColor for the debuffs. So, the new function for Core.lua in InlineAura is like this:
local function ActionButton_UpdateBorder(self, spell)
if spell then
local aura, auraType = GetAuraToDisplay(spell)
if aura then
local color = db.profile['color'..auraType..(aura.isMine and 'Mine' or 'Others')]
local R, G, B, A = unpack(color)
if auraType == "Debuff" then
local r, g, b, a = self:GetCheckedTexture():GetVertexColor()
self:GetCheckedTexture():SetVertexColor(R*r, G*g, B*b, A*(a or 1))
else
self:GetCheckedTexture():SetVertexColor(R, G, B, A)
end
ActionButton_UpdateTimer(self, aura)
return true
end
end
ActionButton_UpdateTimer(self, nil)
self:GetCheckedTexture():SetVertexColor(1, 1, 1)
end
Note that you shouldn't have to worry about resetting the color. It seems that LBF is handling that. Test it hard. I found no bugs and it worked perfectly.
Changing line 439 of Core.lua in InlineAura to:
Will make it work. It's a hack. :p
Say the original is:
If you were to do something like this:
The end result would be:
Because 1x1=1, 0x1=0, 0.5x0.5=0.25
Hence the link I posted. By setting each one of those to nil, it basically wipes the color which allows your color to be fully applied (i just threw it in there to see if it would work, don't know if there'll be any side effects. :p).
Edit: The code I posted in my previous post is what needs to be changed in Core.lua of InlineAura. This will keep you from having to fool with LBF at all. Of course, if there's some adverse side effects, I know nothing! :p
Hrm... I think one side effect could be to reset the LBF skin color of Checked texture.
I thought about that, too. Thing is, that there's never going to be a "Checked" state on a spell/ability that applies a debuff, so that state will never be used on that button. Unless, of course, the user moves an ability that has one into that slot...
The only thing I can think of to ensure that no issues arise is to store the "old" colors in a local table by buttonid or something.
So, when the aura border is applied, use :GetVertexColor to store the colors in the table. Then, nil out the colors and then apply the aura's colors. When the aura is removed, nil out the aura's colors and then reapply the old colors. Something like this, though this is just dry coded. You might have to play with it:
Note that "self.id" is just there to represent that button's id. You'll have to figure out how to handle that yourself. Also, I'm not exactly sure how GetVertexColor returns its values. It should be a table. You'll have to play with it. The above is just an idea. /shrug
When you press the button to perform its action (either by mouse click or key binding), it gets checked. Now I guess I just have to check if it does really reset the color or not.
Edit: Uhm... mostly the same that HunterZ posted. Nvm. ^_^
Ah, yes. I forgot about that. Let me see what I can come up with and maybe solve these errors as well.
Note that you shouldn't have to worry about resetting the color. It seems that LBF is handling that. Test it hard. I found no bugs and it worked perfectly.
hey btw, could you make your magic work with Procborder ?
http://www.wowinterface.com/downloads/info12566-ProcBorders.html