Quantcast Cooldown spiral no longer inherit alpha? - WoWInterface
Thread Tools Display Modes
09-20-14, 04:54 PM   #1
Ereki
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 24
Cooldown spiral no longer inherit alpha?

Hi I have an addon for moving around DK runes and fading them out of combat. But now i WoD the cooldown spiral no longer seems to inherit the alpha from the frame it self, the scale also seems off (but I'm not sure on that)

Pic: http://i.imgur.com/IYZoR19.jpg

The code I'm using is just a simple RuneFrame:SetAlpha(RHaic) where RHaic is a local variable, this works fine on live but results in the cooldown spiral still showing when I'm testing it on the WoD beta. Is this related to the changes to animation and if so how do I fix it?

Code:
if (event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_REGEN_ENABLED") and not UnitInVehicleControlSeat("player") then
	RuneFrame:SetAlpha(RHaoc) 	
	RuneFrame:SetScale(RHs)		
elseif event == "PLAYER_REGEN_DISABLED" and not UnitInVehicleControlSeat("player") then
	RuneFrame:SetAlpha(RHaic)
	RuneFrame:SetScale(RHs)
end
	
if ((event == "UNIT_ENTERING_VEHICLE") and UnitInVehicleControlSeat("player"))  then
	local unitID = ...
	if unitID == "player" then
		RuneFrame:SetAlpha(RHaiv)	
	end
elseif event == "PLAYER_ENTERING_WORLD" then
	if InCombatLockdown() then
		RuneFrame:SetAlpha(RHaic)
		RuneFrame:SetScale(RHs)	
	else 
		RuneFrame:SetAlpha(RHaoc) 
		RuneFrame:SetScale(RHs)
	end
elseif event == "UNIT_EXITED_VEHICLE" then
	local unitID = ...
	if unitID == "player" then
		if InCombatLockdown() then
			RuneFrame:SetAlpha(RHaic)
			RuneFrame:SetScale(RHs)
		else
			RuneFrame:SetAlpha(RHaoc) 
			RuneFrame:SetScale(RHs)
		end
	end
end
  Reply With Quote
09-20-14, 07:06 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
Don't quote me on this, but you might try something like this..
Lua Code:
  1. for i = 1, 6 do
  2.     local cooldown = _G['RuneButtonIndividual' .. i .. 'Cooldown']
  3.     cooldown:SetSwipeTexture('', 0, 0, 0, RHaoc)
  4.     local start, duration, runeReady = GetRuneCooldown(i)
  5.     if not runeReady and start then
  6.         CooldownFrame_SetTimer(cooldown, start, duration, 1)
  7.     end
  8. end
I don't think it will update the texture unless you call SetCooldown on it afterward, but there might be a better way to do this.

Last edited by semlar : 09-20-14 at 07:49 PM.
  Reply With Quote
09-22-14, 05:45 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
https://code.google.com/p/rothui/sou...n.lua&old=1281

Lua Code:
  1. <widget>:SetSwipeColor(r, g, b, [a])
  2. <widget>:SetSwipeTexture(file, [r, g, b, a])
  3. <widget>:SetDrawSwipe(boolean)
  4. --<widget>:SetEdgeColor(r, g, b, [a])
  5. <widget>:SetEdgeTexture(file, [r, g, b, a])
  6. <widget>:SetDrawEdge(boolean)
  7. <widget>:SetCooldown(start,duration)

Source: http://www.wowinterface.com/forums/s...ad.php?t=49501
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-22-14 at 05:51 AM.
  Reply With Quote
09-22-14, 09:57 AM   #4
Ereki
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 24
Originally Posted by zork View Post
https://code.google.com/p/rothui/sou...n.lua&old=1281

Lua Code:
  1. <widget>:SetSwipeColor(r, g, b, [a])
  2. <widget>:SetSwipeTexture(file, [r, g, b, a])
  3. <widget>:SetDrawSwipe(boolean)
  4. --<widget>:SetEdgeColor(r, g, b, [a])
  5. <widget>:SetEdgeTexture(file, [r, g, b, a])
  6. <widget>:SetDrawEdge(boolean)
  7. <widget>:SetCooldown(start,duration)

Source: http://www.wowinterface.com/forums/s...ad.php?t=49501
Thanks <widget>:SetSwipeColor(r, g, b, [a]) fixes the alpha of the cooldown spiral but the coodown spiral is still square and doesn't really fit the runes at all which isn't the case on live. On live the sprial is contained within the borders of the rune.

Although I just tested it and it seems to be on the standard RuneFrame as well so I guess this is a bug on Blizzards side.
  Reply With Quote
09-22-14, 10:19 AM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
Originally Posted by Ereki View Post
On live the sprial is contained within the borders of the rune.
Find a round texture to use with cooldown:SetSwipeTexture.

The swipe texture isn't round on live, its corners are just being covered by the round border. It's not actually possible to create a round cooldown texture on live.

This seems to work, although I have managed to crash the client several times attempting to change the swipe texture while it was running.
Lua Code:
  1. for i = 1, 6 do
  2.     local cooldown = _G['RuneButtonIndividual' .. i .. 'Cooldown']
  3.     cooldown:SetSwipeTexture('interface/CHARACTERFRAME/TempPortraitAlphaMaskSmall')
  4.     cooldown:SetSwipeColor(0, 0, 0, 0.3)
  5. end
After you set the texture you should only need to call SetSwipeColor when you want to update its alpha. Unlike SetSwipeTexture, it appears to update the swipe immediately.

Last edited by semlar : 09-22-14 at 10:35 AM.
  Reply With Quote
09-22-14, 11:31 AM   #6
Ereki
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 24
Woho that works great, thanks alot for the help guys! Weird that the spiral is bigger on the beta than on live though..

Oh well it works great with the texture you found now anyways!
  Reply With Quote
09-23-14, 01:00 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
Holy cow you crash the client changing a texture. WoW.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-23-14, 06:40 AM   #8
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by zork View Post
Holy cow you crash the client changing a texture. WoW.
Does the bug with very large textures (like 4092x4092) on a Mac that crashes the client still exist?
  Reply With Quote
10-14-14, 07:57 PM   #9
Tuller
A Black Drake
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 89
So, SetSwipeColor does make it possible to hide the normal spiral, but it doesn't actually do anything about the shine effect at the end of a cooldown.
  Reply With Quote
10-14-14, 08:13 PM   #10
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
I'll just document some of the other cooldown methods that you might be interested in here.
Lua Code:
  1. -- Hides flash animation (bling) at the end of the cooldown
  2. Cooldown:SetDrawBling(false)
  3. -- Hides background (swipe texture) of the cooldown
  4. Cooldown:SetDrawSwipe(false)
  5. -- Hides the glowing line that marks the edge of the cooldown swipe
  6. Cooldown:SetDrawEdge(false)
  7. -- Hides the countdown numbers regardless of the cvar setting
  8. Cooldown:SetHideCountdownNumbers(true)

Last edited by semlar : 10-14-14 at 08:22 PM.
  Reply With Quote
10-15-14, 03:25 PM   #11
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
Have you found a solution? Because I need one for rActionBarStyler. Buttons with alpha 0 will still have the cooldown visible.

Do I actually have to check if the frame is a button with a cooldown and change it via swipecolor? Meh.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-16-14 at 04:45 AM.
  Reply With Quote
10-15-14, 04:25 PM   #12
Tuller
A Black Drake
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 89
Bartender appears to update the swipe color when updating a cooldown.
In Dominos, I reparent the cooldown to a hidden frame when alpha == 0.
  Reply With Quote
10-16-14, 01:52 AM   #13
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
I thought about it. This may fix the issue. According to the ActionButtonTemplate.xml the cooldown is available as button.cooldown.

There is a problem though. There may be any sort of inate alpha. We need to save that.

Lua Code:
  1. --SetCooldownSwipeAlpha
  2. local function SetCooldownSwipeAlpha(self,alpha)
  3.   local r,g,b = self.cooldown:GetSwipeColor()
  4.   self.cooldown:SetSwipeColor(r,g,b,self.cooldown.alpha*alpha)
  5. end
  6.  
  7. --ApplyButtonCooldownAlphaFix
  8. local function ApplyButtonCooldownAlphaFix(button)
  9.   if not button then return end
  10.   if not button.cooldown then return end
  11.   local r,g,b,a = button.cooldown:GetSwipeColor()
  12.   button.cooldown.alpha = a
  13.   hooksecurefunc(button, "SetAlpha", SetCooldownSwipeAlpha)
  14. end
  15.  
  16. do
  17.   --style the actionbar buttons
  18.   for i = 1, NUM_ACTIONBAR_BUTTONS do
  19.     ApplyButtonCooldownAlphaFix(_G["ActionButton"..i])
  20.     ApplyButtonCooldownAlphaFix(_G["MultiBarBottomLeftButton"..i])
  21.     ApplyButtonCooldownAlphaFix(_G["MultiBarBottomRightButton"..i])
  22.     ApplyButtonCooldownAlphaFix(_G["MultiBarRightButton"..i])
  23.     ApplyButtonCooldownAlphaFix(_G["MultiBarLeftButton"..i])
  24.   end
  25.   --override buttons
  26.   for i = 1, 6 do
  27.     ApplyButtonCooldownAlphaFix(_G["OverrideActionBarButton"..i])
  28.   end
  29.   --petbar buttons
  30.   for i=1, NUM_PET_ACTION_SLOTS do
  31.     ApplyButtonCooldownAlphaFix(_G["PetActionButton"..i])
  32.   end
  33.   --stancebar buttons
  34.   for i=1, NUM_STANCE_SLOTS do
  35.     ApplyButtonCooldownAlphaFix(_G["StanceButton"..i])
  36.   end
  37.   --possess buttons
  38.   for i=1, NUM_POSSESS_SLOTS do
  39.     ApplyButtonCooldownAlphaFix(_G["PossessButton"..i])
  40.   end
  41. end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-16-14 at 11:01 AM.
  Reply With Quote
10-16-14, 07:47 AM   #14
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
Originally Posted by Tuller View Post
In Dominos, I reparent the cooldown to a hidden frame when alpha == 0.
Don't do this, you're breaking my ability to detect what action button a cooldown frame belongs to.
  Reply With Quote
10-16-14, 11:13 AM   #15
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
Err. There is actually no get method for the swipe color. Grmpf.

Here is my working fix for now.

lua Code:
  1. --cooldown spiral alpha fix
  2.  
  3.   --SetCooldownSwipeAlpha
  4.   local function SetCooldownSwipeAlpha(self,cooldown,alpha)
  5.     cooldown:SetSwipeColor(0,0,0,0.8*alpha)
  6.   end
  7.    
  8.   --ApplyButtonCooldownAlphaFix
  9.   local function ApplyButtonCooldownAlphaFix(button)
  10.     if not button then return end
  11.     if not button.cooldown then return end
  12.     local parent = button:GetParent():GetParent()
  13.     hooksecurefunc(parent, "SetAlpha", function(self,alpha) SetCooldownSwipeAlpha(self,button.cooldown,alpha) end)
  14.   end
  15.    
  16.   do
  17.     --style the actionbar buttons
  18.     for i = 1, NUM_ACTIONBAR_BUTTONS do
  19.       ApplyButtonCooldownAlphaFix(_G["ActionButton"..i])
  20.       ApplyButtonCooldownAlphaFix(_G["MultiBarBottomLeftButton"..i])
  21.       ApplyButtonCooldownAlphaFix(_G["MultiBarBottomRightButton"..i])
  22.       ApplyButtonCooldownAlphaFix(_G["MultiBarRightButton"..i])
  23.       ApplyButtonCooldownAlphaFix(_G["MultiBarLeftButton"..i])
  24.     end
  25.     --override buttons
  26.     for i = 1, 6 do
  27.       ApplyButtonCooldownAlphaFix(_G["OverrideActionBarButton"..i])
  28.     end
  29.     --petbar buttons
  30.     for i=1, NUM_PET_ACTION_SLOTS do
  31.       ApplyButtonCooldownAlphaFix(_G["PetActionButton"..i])
  32.     end
  33.     --stancebar buttons
  34.     for i=1, NUM_STANCE_SLOTS do
  35.       ApplyButtonCooldownAlphaFix(_G["StanceButton"..i])
  36.     end
  37.     --possess buttons
  38.     for i=1, NUM_POSSESS_SLOTS do
  39.       ApplyButtonCooldownAlphaFix(_G["PossessButton"..i])
  40.     end
  41.   end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-16-14 at 11:34 AM.
  Reply With Quote
10-16-14, 11:48 AM   #16
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Hm. Do I miss something here?
Whats with Cooldown:SetDrawSwipe(false)?
I'm doing it on SPELL_UPDATE_COOLDOWN for my Buttons and it seems to work.

Last edited by Duugu : 10-16-14 at 11:53 AM.
  Reply With Quote
10-16-14, 11:51 AM   #17
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
Well. Don't you think that Blizzard would just set it to true if a new cooldown is started?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
10-16-14, 11:54 AM   #18
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Sorry. See my edit.

[e]
Oh, and I'm using self:HookScript('OnShow',... to do it there too.

Last edited by Duugu : 10-16-14 at 01:42 PM.
  Reply With Quote
10-19-14, 07:51 AM   #19
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
Btw my solution works but it seems to reset the swipecolor and thus the alpha value on instance change.

Sounds like a bug to me that the cooldown does not take the parented alpha value into account.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
10-19-14, 08:25 AM   #20
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
It doesn't even take its own alpha into account, it's definitely bugged.

You can call cooldown:SetAlpha() directly and it won't have any effect on it.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Cooldown spiral no longer inherit alpha?

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