Closed Thread
Thread Tools Display Modes
Unread 10-05-08, 06:11 PM   #41
garnerh42
A Deviate Faerie Dragon
 
garnerh42's Avatar
Join Date: Nov 2006
Posts: 11
Hiding Cooldown

Starting with latest oUF and oUF_Ammo layout. I'm using OmniCC for cooldown numbers, but I'd prefer not to show the numbers or clock animation.

I found the block of code in aura.lua that shows or hides the cooldown on the icon, but I haven't been able to figure out what code to call in oUF_Ammo to turn it off permanently. I can, of course, comment out the block of code, but then I'd have to do that every time I get a new version.

I also tried creating my own PostUpdateAuraIcon like looked like this:

Code:
-- params omitted for brevity
local function myPostUpdateAuraIcon ( ... )
    if icon.cd then
        icon.cd:Hide()
    end
end
But that code didn't work. Can someone point me in the right direction, please?
__________________
Grynn (80 Druid), Trig (80 Rogue), Krajen (80 Warrior), Jovix (80 Hunter), Sqeeve (80 Mage) on Cenarion Circle
garnerh42 is offline  
Unread 10-05-08, 06:19 PM   #42
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,313
Code:
local function PostCreateAuraIcon(self, button, icons, index, debuff)
	button.cd:Hide()
end
drycoded
p3lim is offline  
Unread 10-05-08, 06:46 PM   #43
MoonWitch
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 412
Originally Posted by p3lim View Post
Code:
local function PostCreateAuraIcon(self, button, icons, index, debuff)
	button.cd:Hide()
end
drycoded
That's what I have to disable omnicc cd counts.
MoonWitch is offline  
Unread 10-05-08, 07:43 PM   #44
garnerh42
A Deviate Faerie Dragon
 
garnerh42's Avatar
Join Date: Nov 2006
Posts: 11
Well, phooey. I originally tried adding button.cd:Hide() to auraIcon in oUF_Ammo. That's the name of the function that overloaded PostCreateAuraIcon.

Here is what I tried for that:

Code:
local function auraIcon(self, button, icons, index, debuff)
	button.cd:SetReverse()
	button.icon:SetTexCoord(.07, .93, .07, .93) --zoom icon
	button.overlay:SetTexture(bordertexture)
	button.overlay:SetTexCoord(0,1,0,1)
	button.overlay.Hide = noHide
	button.cd:Hide()
end
All I did was add that last line. Thanks for the help!
__________________
Grynn (80 Druid), Trig (80 Rogue), Krajen (80 Warrior), Jovix (80 Hunter), Sqeeve (80 Mage) on Cenarion Circle
garnerh42 is offline  
Unread 10-06-08, 01:16 AM   #45
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by MoonWitch View Post
That's what I have to disable omnicc cd counts.
If you want to disable OmniCC for a cooldown frame.

Add a "noCooldownCount" entry for it.

i.e.
Code:
<cooldownframe>.noCooldownCount = true
Slakah is offline  
Unread 10-06-08, 03:46 AM   #46
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 268
Aight, progress, by using
Code:
	self:SetScript("OnEnter", function(self)
		if(unit == 'player') then self.Experience:SetAlpha(1) end
		UnitFrame_OnEnter(self)
	end)

	self:SetScript("OnLeave", function(self)
		if(unit == 'player') then self.Experience:SetAlpha(0) end
		UnitFrame_OnLeave(self)
	end)
And then self.Experience:SetAlpha(0) in the Experience block, it's correctly hidden on login, and show/hide when i mouseover the player frame. Also, the experience tooltip shows up when i mouse over the experience bar position but the bar stays hidden, or even better have the tooltip shown when i mouse over the player frame, but i don't think it's doable.

Haste explained this
Originally Posted by Haste
You will have to use the OnEnter/OnLeave handler on the frame if you want it to show/hide when you enter the unit frame as a whole however. The above will only work for when you hover the position for the actual frame. You should also use :Hide/:Show in that case, and not :SetAlpha.
But i'm not sure to understand it correctly. What should i change to have the experience bar shown when i mouse over it instead of the player frame ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-06-08, 06:46 AM   #47
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
I'm setting up player auras and wanted to have them displayed with a numeric duration next to them, like Elk's BuffBars (just time, I don't care about bars).

Looking at the Blizzard API's, it seems like you're only supposed to be able to get durations for things you cast. Elk's code gets around this (I think) with the follow type of code:

Code:
local buffIndex, untilCancelled = GetPlayerBuff(index, "HELPFUL")
local name, rank = GetPlayerBuffName(buffIndex)
local timeleft = GetPlayerBuffTimeLeft(buffIndex)
local timemax = timeleft
It also looks like there's a lookup table in there for recording/comparing the maximum time. Furthermore, I'm aware that the way you get aura information and calculate duration is changing, but until it does, I'd like to do things for the Live server.

I think I can duplicate this, but I'd love two pointers:

1. Is PostUpdateAuraIcon() the hook I want to be using for this? It seems to have the information I want and is per-aura.
2. If so, why is the 'index' parameter a table?

Still noobish with this stuff.
Kellen is offline  
Unread 10-06-08, 08:27 AM   #48
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
Originally Posted by Kellen View Post
2. If so, why is the 'index' parameter a table?
It isn't.

Code:
self:PostUpdateAuraIcon(icons, unit, icon, index, offset, filter, isDebuff)
-- is equal to:
self.PostUpdateAuraIcon(self, icons, unit, icon, index, offset, filter, isDebuff)
You're missing an argument in your function, hence to offset. Also do note that EBB only operates on your buffs, and that the index of GetPlayerBuff doesn't equal that of UnitBuff.
haste is offline  
Unread 10-06-08, 09:07 AM   #49
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Fixing my faulty parameterization makes complete sense.

As to EBB, I suppose it's a good thing that I'm only interested in Buffs then. That code snippet was from EBB code, but likely from a incorrect context. Since I could can query the auras now *cough*, it should be easier to play with and figure out.

Last edited by Kellen : 10-06-08 at 09:13 AM.
Kellen is offline  
Unread 10-06-08, 09:11 AM   #50
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Code:
self:SetScript("OnEnter", function(self) if(unit == 'player') then self.Experience:SetAlpha(1) end UnitFrame_OnEnter(self) end) self:SetScript("OnLeave", function(self) if(unit == 'player') then self.Experience:SetAlpha(0) end UnitFrame_OnLeave(self) end)
If you want the experience to be shown when the cursor is over the exp bar as well, then I would add:

Code:
self.Experience:SetScript("OnEnter", function(self)
	self:SetAlpha(1)
end)
self.Experience:SetScript("OnLeave", function(self)
	self:SetAlpha(0)
end)
Slakah is offline  
Unread 10-06-08, 11:54 AM   #51
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,691
Originally Posted by Kellen View Post
I'm setting up player auras and wanted to have them displayed with a numeric duration next to them, like Elk's BuffBars (just time, I don't care about bars).

Looking at the Blizzard API's, it seems like you're only supposed to be able to get durations for things you cast. Elk's code gets around this (I think) with the follow type of code:
You always have the time for auras on yourself and your pet(?). It's when the auras are on other units that you only get the time for ones you cast. That's how the API works. And EBB does work for target, but if it's something you didn't cast, it won't have a time for it.
__________________
"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

Seerah is offline  
Unread 10-06-08, 12:16 PM   #52
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Originally Posted by Seerah View Post
You always have the time for auras on yourself and your pet(?). It's when the auras are on other units that you only get the time for ones you cast. That's how the API works. And EBB does work for target, but if it's something you didn't cast, it won't have a time for it.
My confusion stemmed from the that I'd only be able to query the duration on the auras on myself that I cast.

I was looking through the aura.lua code, saw only references to UnitBuff() and the like. Those functions only return durations on stuff cast by the player, so I thought that was the limitation. Getting information in a general way seems like the best method of doing things, so I didn't even think to search for a player specific version of those functions. GetPlayerBuffTimeLeft() is the ticket. Lesson learned. Thanks for the help!
Kellen is offline  
Unread 10-07-08, 06:47 AM   #53
Frayol
A Deviate Faerie Dragon
 
Frayol's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 10
Originally Posted by p3lim View Post
You can easily do this with custom tags, but it doesnt really have anything to do with unitframes, so thats the reason haste havent implemented it.
I wasn't aware of that, but fair enough. I have been trying to wrap my head around custom tags, but keep hitting a brick wall.

Originally Posted by Slakah View Post
You could add some custom tags:

Code:
oUF.Tags["[AFK]"] = function(u) return UnitIsAFK(u) and "AFK" or ""
oUF.Tags["[DND]"] = function(u) return UnitIsDND(u) and "DND" or ""

oUF.TagEvents["[AFK]"] = "UNIT_FLAGS"
oUF.TagEvents["[DND]"] = "UNIT_FLAGS"
(note: I'm not certain if the event is correct as I don't have access to WoW currently.)

and then use those tags as you would normally.
Originally Posted by p3lim View Post
PLAYER_FLAGS_CHANGED is the event

(dont be fooled by the name of the event, it works for any unit)
Is there a good example of how to implement this that you know of and I could take a look at? The theory seemed simple enough, but I have failed miserably to understand it.
Frayol is offline  
Unread 10-07-08, 08:39 AM   #54
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
Is there a way to show temp enhancements (Weapon Buffs) in the aura?
Quokka is offline  
Unread 10-07-08, 08:41 AM   #55
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,313
Take a look at my raid layout (oUF Perfect), its based on pure tags for text
p3lim is offline  
Unread 10-08-08, 09:01 AM   #56
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
Originally Posted by Quokka View Post
Is there a way to show temp enhancements (Weapon Buffs) in the aura?
Not without you doing all the work. The current weapon enchant API is _horrible_, and requires polling to even work. They are completely disconnected from the unit auras, and oUF will _never_ support them as long as that's the case/
haste is offline  
Unread 10-09-08, 03:57 AM   #57
Alanor
A Murloc Raider
Join Date: Oct 2008
Posts: 8
I came across a bizzare situation while setting up oUF. I don't think it's strictly related to oUF, but hopefully the bright minds reading this thread will have an idea as to why it happens.

Basically I spawned the party header, and no matter what I did the party members didn't show up. Calling :Show() on the party header manually would show the party for a split second then it would be hidden again. After long time of scratching my head, I decided to disable the other addons I use, and the party showed just fine. Then I enabled my addons one by one and narrowed down the problem to ClearFont2: if I have ClearFont2 enabled, oUF party header won't show up, if I disable it, the party shows up.

This strikes me as quite a strange issue, I can't see what the link is between a secure party header and ClearFont2. Could it be that enabling CF2 loads a library that messes the header up? I'd appreciate if anybody has an idea on the cause of this, and even more how I could go about debugging this issue. What can affect the visibility of the header, generally speaking?

Thanks in advance!
Alanor is offline  
Unread 10-09-08, 04:11 AM   #58
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
A easy way to debug it is by doing the following on your header:
Code:
local Hide = party.hide
party.Hide = function(self) ChatFrame1:AddMessage(debugstack()) Hide(self) end
Then you just have to analyze the debug stack :).
haste is offline  
Unread 10-09-08, 12:44 PM   #59
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 268
Exp mouseover take 2

Aight, still on about the experience mouseover thingy, but with some progress this time.

It's now working correctly, 'almost', with the following code in the exp block of the layout, the exp bar + tooltip shows and hides on mouseover as expected.
There is one very small issue left, on login or /rl, i have to mouseover the player frame before it starts working. If i don't do that, when i mouseover the exp bar only the tooltip is shown, not the bar itself.

Code:
			self:SetScript("OnEnter", function(self)
				local origonenter, origonleave = self.Experience:GetScript("OnEnter"), self.Experience:GetScript("OnLeave")
				self.Experience:SetScript('OnEnter', function(self,...) self:SetAlpha(1) origonenter(self, ...) end)
			end)

			self:SetScript("OnLeave", function(self)
				local origonenter, origonleave = self.Experience:GetScript("OnEnter"), self.Experience:GetScript("OnLeave")
				self.Experience:SetScript('OnLeave', function(self, ...) self:SetAlpha(0) origonleave(self,...) end)
			end)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-09-08, 02:56 PM   #60
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
Not to be completely evil (but quite a bit). Think about exactly what you logically want to do (all the steps of hooking and calling), and what you are doing now.

Or put in another way: Explain to yourself exactly what your code does every time you execute those two functions.
haste is offline  
Closed Thread

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion

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