Thread Tools Display Modes
03-23-10, 11:15 AM   #1
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Hide spell timer on target debuff?

Hi all. I am trying to find the area of code in my oUF layout to hide or relocate the target spell timers on debuff icons. Can someone direct me to the right variable to edit? I've been able to find the stack counts and cooldowns, but not the aura timers. Thanks.

Code:
local auraIcon = function(self, button, icons)
	icons.showDebuffType = true -- show debuff border type color  

	button.icon:SetTexCoord(.07, .93, .07, .93)
	button.icon:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -1)
	button.icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1)

    button.count:ClearAllPoints()

    button.count:SetPoint("TOPRIGHT", 0 , -1)    -- Stacks text will be on top of icon
    button.count:SetJustifyH("CENTER")
    button.count:SetFont(font, fontsize, "THINOUTLINE")
    button.count:SetTextColor(.8, .8, .8)   -- Color for stacks text

    button.icon:SetTexCoord(0, 1, 0, 1)

	button.overlay:SetTexture(bufftex)
	button.overlay:SetTexCoord(0,1,0,1)
	button.overlay.Hide = function(self) self:SetVertexColor(0.4, 0.4, 0.4) end

	button.cd:SetReverse()
	button.cd:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2) 
	button.cd:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)   

    if(not isDebuff and self.unit=="player") then     -- Cancel buffs on right click
        button:SetScript("OnMouseUp", CancelBuff)
    end    
end

local PostUpdateAuraIcon = function(self, icons, unit, icon, index, offset, filter, isDebuff)

    if(icon.cd:IsShown() and self.unit=="target" and isDebuff and not icon.isPlayer) then

        icon.cd:Hide() -- we hide cooldown for debuffs that are not ours

    end
end


local CancelBuff = function(self, button) -- cancel buffs on right click
    if(button=="RightButton") then
       CancelUnitBuff("player", self:GetID())
    end
end

Last edited by Toran : 03-23-10 at 12:16 PM.
  Reply With Quote
04-04-10, 07:49 PM   #2
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Duh. Figured it out. OmniCC was the culprit. Couldn't figure out how to have it not show the timer on by unitframe buttons, so just removed it. Using SexyCooldown anyway.
  Reply With Quote
04-04-10, 09:40 PM   #3
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
You can use

button.cd.noCooldownCount = true -- or any non-nil value
  Reply With Quote
04-05-10, 08:33 AM   #4
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Thanks. Do I need to remove this part from my code (as shown above)?

Code:
	button.cd:SetReverse()
	button.cd:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2) 
	button.cd:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
Not sure if adding that nil will negate the above or just have no effect.
  Reply With Quote
04-05-10, 09:01 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Toran View Post
Thanks. Do I need to remove this part from my code (as shown above)?

Code:
	button.cd:SetReverse()
	button.cd:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2) 
	button.cd:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
Not sure if adding that nil will negate the above or just have no effect.
Has no effect, but you can remove it if you want to clean up your code.
  Reply With Quote
04-05-10, 08:38 PM   #6
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Waverian View Post
You can use

button.cd.noCooldownCount = true -- or any non-nil value
Tried adding that in the "auraIcon" code above and it did nothing. I wonder if OmniCC is overriding this. Or do I have it placed in the wrong spot?

Edit: This did the trick to stop the timers on my target frame:
self.Buffs.disableCooldown = true
self.Debuffs.disableCooldown = true

Last edited by Toran : 04-05-10 at 08:44 PM.
  Reply With Quote
04-06-10, 04:12 AM   #7
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Originally Posted by Toran View Post
Tried adding that in the "auraIcon" code above and it did nothing. I wonder if OmniCC is overriding this.
No. noCooldownCount is something that's explicitly handled by OmniCC. http://code.google.com/p/tullamods/wiki/OmniCC

disableCooldown is an internal oUF flag that just completely disables the cooldown spiral itself (which also has the side effect of disabling the count because of how omnicc works) - which you might be fine with as long as you don't want to know how much time unit auras have remaining.
  Reply With Quote
04-06-10, 02:18 PM   #8
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Waverian View Post
No. noCooldownCount is something that's explicitly handled by OmniCC. http://code.google.com/p/tullamods/wiki/OmniCC

disableCooldown is an internal oUF flag that just completely disables the cooldown spiral itself (which also has the side effect of disabling the count because of how omnicc works) - which you might be fine with as long as you don't want to know how much time unit auras have remaining.
So do I use the noCooldownCount inside OmniCC instead of oUF? If so, won't that disable text on all buttons including Dominos? I just want no text on my oUF auras.
  Reply With Quote
04-06-10, 03:31 PM   #9
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Originally Posted by Toran View Post
So do I use the noCooldownCount inside OmniCC instead of oUF? If so, won't that disable text on all buttons including Dominos? I just want no text on my oUF auras.
No, you still use it inside the confines of your own addon. OmniCC hooks the cooldown model (the radial button shading) internally to create its timers, but any Cooldown frame object that has the noCooldownCount flag as a non-nil value (regardless of where the value is set) then it hides the timer.

I'm not sure why you're not having success with your previous code. Your auraIcon is being called as PostCreateAuraIcon I assume?
  Reply With Quote
04-06-10, 07:58 PM   #10
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Waverian View Post
No, you still use it inside the confines of your own addon. OmniCC hooks the cooldown model (the radial button shading) internally to create its timers, but any Cooldown frame object that has the noCooldownCount flag as a non-nil value (regardless of where the value is set) then it hides the timer.

I'm not sure why you're not having success with your previous code. Your auraIcon is being called as PostCreateAuraIcon I assume?
What you say makes complete sense. Yes, my auraicon is being called as PostCreateAuraIcon. No effect and no error.

Does it matter that I use the "self.Buffs" and "self.Debuff" calls for my target frame instead of "auras"?
  Reply With Quote
04-06-10, 09:27 PM   #11
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Originally Posted by Toran View Post
Does it matter that I use the "self.Buffs" and "self.Debuff" calls for my target frame instead of "auras"?
Nope. Auras is just a term that encompasses all buffs and debuffs together. Similarly oUF pairs the icons together when using an Auras element over Buffs or Debuffs. This won't matter for a PostUpdateAuraIcon (or any other aura pre/post/override).

Just to confirm I was able to disable OmniCC on only auras in my layout with the following:

Code:
-- Only the noCooldownCount is relevant. The rest is just adding a pixel border around my icon
local PostCreateAuraIcon = function(self, icon)
	icon.cd:SetReverse()
	icon.cd.noCooldownCount = true
	icon.icon:SetTexCoord(.1, .9, .1, .9)	
	icon.icon:SetDrawLayer('ARTWORK')
	icon:SetBackdrop(Backdrop)
	icon:SetBackdropColor(0, 0, 0)
end

-- Inside layout function
self.PostCreateAuraIcon = PostCreateAuraIcon
--
  Reply With Quote
04-07-10, 05:48 PM   #12
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Figured it out. I was using a modified version of OmniCC from Neav (i think). Swapped out for Tuller's and all is good.

Waverian, thanks for your persistence - very much appreciate your help.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Hide spell timer on target debuff?


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