WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF - Layout discussion (https://www.wowinterface.com/forums/showthread.php?t=18363)

haste 10-01-08 08:57 AM

oUF - Layout discussion
 
The old oUF thread over at WoWace has become, quite a monster to say it softly. It's a mess of bug reports, layout issues and general issues/feature people have/want.

Please use this thread for layout discussion only.

Related forum thread: oUF - General discussion
Bug reports and feature requests should be posted over at the author portal. Issues with specific layouts should be posted in their respective place (not here, unless you are the author of the layout in question (and don't you dare to bend this exception! :p)).

MoonWitch 10-01-08 10:27 AM

Haste, is there actually a way to overwrite/override the pvp functions, because I prefer a textual tag, but would like to do that by not editting the oUF core?

haste 10-01-08 10:54 AM

There isn't any internal functions for that on PvP, mostly because it's a shared event, and the shared event system is still to be written.

You can however do: self.UNIT_FACTION = myOwnUpdatePvPFunction;. Setting functions directly on the layout doesn't touch the core at all.

MoonWitch 10-01-08 11:41 AM

Quote:

Originally Posted by haste (Post 103198)
There isn't any internal functions for that on PvP, mostly because it's a shared event, and the shared event system is still to be written.

You can however do: self.UNIT_FACTION = myOwnUpdatePvPFunction;. Setting functions directly on the layout doesn't touch the core at all.

Thanks :) I'll do that. I still get freaked out when I see the pvp icon, so I figured it'd be better for my heart to use text. :P

Caellian 10-02-08 02:52 AM

Is it possible to change the level of a text (fontstring) the same way it works for frames (SetFrameLevel).
I'm toying with portraits and would like to display something over it, but right now the portrait comes above of the text.

zork 10-02-08 04:06 AM

Maybe I can help you out here. You could just use a helperframe that lays between portrait and text.

Code:

   
    --I don't know the Portrait call but it should be similar
    self.pm1 = CreateFrame("PlayerModel", nil, self)
    self.pm1:SetFrameStrata("BACKGROUND")
    self.pm1:SetAllPoints(self)
    self.pm1:SetUnit(unit)
    --self.pm1:SetModelScale(1)
    self.pm1:SetCamera(0)   
    --self.pm1:SetRotation(0)   
   
    self.pm1helper = CreateFrame("FRAME", nil, self.pm1)
    self.pm1helper:SetFrameStrata("LOW")
    self.pm1helper:SetAllPoints(self.pm1)
   
    self.pm1helper.Text = SetFontString(self.pm1helper, nil, 13, "THINOUTLINE")
    self.pm1helper.Text:SetPoint('CENTER', 0, 0)


Caellian 10-02-08 05:33 AM

Ahhh, clever, gonna give it a try right now :)

Actually it's not really helping much in my case, here's what i'm trying to do.



Unfortunately i already had to lower the portrait's alpha to 0.25 to be able to read the value and see the healthbar progression.

zork 10-02-08 08:47 AM

Quote:

Originally Posted by Caellian (Post 103308)
Ahhh, clever, gonna give it a try right now :)
Unfortunately i already had to lower the portrait's alpha to 0.25 to be able to read the value and see the healthbar progression.

Please post the code of your fontstring, helper and the portrait.

Caellian 10-02-08 08:54 AM

Quote:

Originally Posted by zork (Post 103316)
Please post the code of your fontstring, helper and the portrait.

In the example above i didn't use any helper, here it is though

Code:

        self.Health.value = SetFontString(self.Health, font,(unit == 'player' or unit == 'target') and 10 or 9)
Code:

                        self.Portrait = CreateFrame('PlayerModel', nil, self)
                        self.Portrait.type = '3D'
                        self.Portrait:SetAlpha(.25)
                        self.Portrait:SetPoint('TOPLEFT', self.Health, 'TOPLEFT', 0, -.5)
                        self.Portrait:SetPoint('BOTTOMRIGHT', self.Health, 'BOTTOMRIGHT', .5, -.5)

In this case, it looks ok but isn't really useable, if i increase the alpha, the value and also the health bar progression are impossible to see.

haste 10-02-08 09:09 AM

At what layer is your font-strings created? OVERLAY should position your text above the model just fine.

Caellian 10-02-08 09:11 AM

Quote:

Originally Posted by haste (Post 103318)
At what layer is your font-strings created? OVERLAY should position your text above the model just fine.

Yes
Code:

local fs = parent:CreateFontString(nil, 'OVERLAY')
But you made me think i had to do this to have my mouseover highlight to work corectly
Code:

        self.Health:SetFrameLevel(unit and 1 or 2)
Code:

        self.Highlight = self:CreateTexture(nil, 'HIGHLIGHT')
        self.Highlight:SetAllPoints(self.Health)
        self.Highlight:SetBlendMode('ADD')
        self.Highlight:SetTexture('Interface\\AddOns\\oUF_Caellian\\media\\mouseoverHighlight')


haste 10-02-08 09:27 AM

Then it's probably your portrait that has a rather high frame level. You can do the following however:
a) Change the frame level of the portrait.
or
b) Create the font-strings with the portrait as parent.

Caellian 10-02-08 10:08 AM

Weird, i'm sure i tried to change the portrait level before and it didn't work for some reason, now it does. Anyway thanks, though i don't know yet if i like the result or not :)

Anyway, i'd like to understand something, since i've added portraits, i've created a "fake" frame above them so they don't look so flat, i've anchored a few things to that "fake" frame, like health value, power value and so on and it works just fine. But, when i try to do the same with Druidmana, it works but return an error. I'm not sure to understand it because it works for everything else using the exact same method, why not for Druidmana.

Code:

Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:56: attempt to index local 'parent' (a nil value)
Count: 1

Call Stack:
[C]: ?
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:56: in function <Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:55>
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:464: in function `style'
Interface\AddOns\oUF\ouf.lua:212: in function <Interface\AddOns\oUF\ouf.lua:206>
Interface\AddOns\oUF\ouf.lua:269: in function <Interface\AddOns\oUF\ouf.lua:266>
Interface\AddOns\oUF\ouf.lua:323: in function `Spawn'
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:614: in main chunk

Line 464 being my SetFontString
Code:

        if(IsAddOnLoaded('oUF_DruidMana')) then
                if(portraits == true) then
                        self.DruidManaText = SetFontString(self.Portrait2, font, 10)
                        self.DruidManaText:SetPoint('CENTER', 0, 1)
                        self.DruidManaText:SetTextColor(1, .49, .04)
                else
                        self.DruidManaText = SetFontString(self.Health, font, 10)
                        self.DruidManaText:SetPoint('CENTER', 0, 1)
                        self.DruidManaText:SetTextColor(1, .49, .04)
                end
        end

In the following example it's working just fine
Code:

                if(portraits == true) then
                        self.CombatFeedbackText = SetFontString(self.Portrait2, fontnum, 18, 'OUTLINE')
                        self.CombatFeedbackText:SetPoint('CENTER', 0, 1)
                else
                        self.CombatFeedbackText = SetFontString(self.Health, fontnum, 18, 'OUTLINE')
                        self.CombatFeedbackText:SetPoint('CENTER', 0, 1)
                end

Another question, i want to hide my target's name if it's casting and display the castbar text instead.
This didn't work, apparently self.Castbar.Text:GetText()) is not correct, is there any other way ? (only the hide part doesn't work here, the rest is fine, i just paste the whole thing)
Code:

        if(unit == 'target') then
                self.Name:ClearAllPoints()
                if(not self.Castbar.Text:GetText()) then
                        if(self.Power.value:GetText()) then
                                self.Name:SetPoint('CENTER', 0, 1)
                        else
                                self.Name:SetPoint('LEFT', 1, 1)
                        end
                else
                        self.Name:Hide()
                end
        end

Note: WTB [tt] tag plz ? :)

vadda 10-03-08 03:57 PM

Creating Frame
 
Hi!

I wanted to create a black frame under player and target-frame.

It worked for the player-frame, as you can see on the screenshot:


But I'm not able to get it working for the target-frame.
Any ideas how the code should look like?

Here's my noobish code for the player-frame:
Code:

blackbar = CreateFrame("Frame", nil, self)
blackbar:SetHeight(15)
blackbar:SetWidth(230)
blackbar:SetFrameStrata("LOW")
t = blackbar:CreateTexture(nil,"BACKGROUND")
t:SetTexture(0,0,0)
t:SetAllPoints(blackbar)
blackbar.texture = t
blackbar:SetPoint('TOP', self, 'BOTTOM', 0, -9)

thx,
Vadda

Coldfury 10-03-08 05:07 PM

Quote:

Originally Posted by vadda (Post 103408)
Hi!
Any ideas how the code should look like?

im pretty sure its the :SetPoint('TOP', self, 'BOTTOM', 0, -9) part. You should use the name of the frames instead(names are defined where you spawn the frame) or use "oUF.units.player" and "oUF.units.target".

something like
blackframe:SetPoint('TOP', oUF.units.player, 'BOTTOM', 0, -9)
blackframe2:SetPoint('TOP', oUF.units.target, 'BOTTOM', 0, -9)

Coldfury 10-03-08 05:15 PM

@Caellian:

try using "SetFont" instead of "SetFontString".

ie.: self.DruidManaText = SetFont(font, 10)





which lead me to the question... why use setfontstring? what does it have more than setfont? whats the point of setting a parent there?

p3lim 10-03-08 05:26 PM

Quote:

Originally Posted by Coldfury (Post 103415)
@Caellian:

try using "SetFont" instead of "SetFontString".

ie.: self.DruidManaText = SetFont(font, 10)





which lead me to the question... why use setfontstring? what does it have more than setfont? whats the point of setting a parent there?


Its a function to create the whole fontstring

vadda 10-03-08 05:37 PM

Quote:

Originally Posted by Coldfury (Post 103414)

something like
blackframe:SetPoint('TOP', oUF.units.player, 'BOTTOM', 0, -9)
blackframe2:SetPoint('TOP', oUF.units.target, 'BOTTOM', 0, -9)

I created a second blackbar like this:

Code:

blackbar2 = CreateFrame("Frame", nil, oUF.units.target)
blackbar2:SetHeight(150)
blackbar2:SetWidth(300)
blackbar2:SetFrameStrata("LOW")
bla = blackbar2:CreateTexture(nil,"BACKGROUND")
bla:SetTexture(0,0,0)
bla:SetAllPoints(blackbar2)
blackbar2.texture = bla
blackbar2:SetPoint('TOP', oUF.units.target, 'BOTTOM', 0, 90)


Now I see the second black-bar constantly on the bottom of the screen.
Even if I have no target selected. Quite weird.

Caellian 10-03-08 05:43 PM

Quote:

Originally Posted by Coldfury (Post 103415)
@Caellian:

try using "SetFont" instead of "SetFontString".

ie.: self.DruidManaText = SetFont(font, 10)

which lead me to the question... why use setfontstring? what does it have more than setfont? whats the point of setting a parent there?

I use SetFontString instead of CreateFontString because i have a SetFontString function at the top of my layout including all the default i want for all my fonts, so i don't have to repeat them each time. I don't know if it's a good reason but that's why i do that :)

Code:

self.DruidManaText = SetFont(self.Portrait2, font, 10)
Didn't work

Code:

Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:458: attempt to call global 'SetFont' (a nil value)
But anyway, i really have no clue why it works for everything but DruidMana.

zynix 10-04-08 12:44 AM

some help please
 
how in the earth do you move stuff, do you need to edit something in the .lua files or something


would love you help

Zynix

zhr 10-04-08 02:41 AM

i have a trouble with target names, they run on target hp http://img139.imageshack.us/my.php?image=lolnv5.jpg
how it to correct?
P.S. sorry for my english (:

haste 10-04-08 04:30 AM

Caellian, you really need to stop using that edit button :p. Especially when you add ten pages of text (and that 3 hours after it's been posted).

1) "Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:56: attempt to index local 'parent' (a nil value)" tells you that you should take a look at line 56 in your layout code.

2) :GetText() returns a string containing the text of the fontstring, it won't do some magic updating for you. What you could do is to remove .Name, and use the castbar .Text to display name. You can do this with a post hook in the stop functions. Remember that you will have to do all the name updating yourself, and that is has to be aware of casts/channels.

vaddn, use locals and not globals when you create those frames. The initial code should work fine with that.

zhz, it's because your fontstrings have no width limitations. You can set these with :SetWidth and/or :SetPoint.

zynix, read up on :SetPoint, and look for it in the layout. Usually placed at the bottom.

vadda 10-04-08 05:43 AM

Quote:

Originally Posted by haste (Post 103448)
vaddn, use locals and not globals when you create those frames. The initial code should work fine with that.

Works like a charm...thx...made my day

Frayol 10-05-08 03:22 AM

Quote:

Originally Posted by MoonWitch (Post 103205)
Thanks :) I'll do that. I still get freaked out when I see the pvp icon, so I figured it'd be better for my heart to use text. :P

Did you get this to work? I'd be really interested to see the code you used if you did as it is something that I'd like to add as well. I too would prefer to see a text tag rather than the icon... for some reason the icon doesn't always register in my brain whereas text does. :o

On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.

p3lim 10-05-08 04:42 AM

Quote:

Originally Posted by Frayol (Post 103486)
Did you get this to work? I'd be really interested to see the code you used if you did as it is something that I'd like to add as well. I too would prefer to see a text tag rather than the icon... for some reason the icon doesn't always register in my brain whereas text does. :o

On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.

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.

Slakah 10-05-08 06:33 AM

Quote:

On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.
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.

p3lim 10-05-08 06:44 AM

Quote:

Originally Posted by Slakah (Post 103496)
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.

PLAYER_FLAGS_CHANGED is the event

(dont be fooled by the name of the event, it works for any unit)

Caellian 10-05-08 08:18 AM

One question, i would like to have my experience bar to show but only when i mouseover it.

I've tried something like the code below but obviously it doesn't work, i know it's wrong but that's all i could come up with using wowwiki and unfortunately i couldn't find any better information on how to do this.


Code:

local OnEnter = function(self)
 self.Experience_OnEnter(self)
 self.Experience:Show()
end

local OnLeave = function(self)
 self.Experience_OnLeave(self)
 self.Experience:Hide()
end


haste 10-05-08 08:35 AM

Quote:

Originally Posted by Caellian (Post 103504)
One question, i would like to have my experience bar to show but only when i mouseover it.
end[/code]

I don't know the code for your .Experience, so I'm just assuming it's a frame. The following will make it appear/disappear when you hover it:
Code:

self.Experience:SetScript('OnEnter', function(self) self:SetAlpha(1) end)
self.Experience:SetScript('OnLeave', function(self) self:SetAlpha(0) end)

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.

Caellian 10-05-08 08:40 AM

Thanks a lot i will give it a try, it's a statusbar btw. (here's the main part of it)

Code:

                if(IsAddOnLoaded('oUF_Experience')) then
                        self.Experience = CreateFrame('StatusBar', nil, self)
                        self.Experience:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', 0, -2.5)
                        self.Experience:SetPoint('BOTTOMRIGHT', self.Power, 'BOTTOMRIGHT', 0, -7.5)
                        self.Experience:SetStatusBarTexture(texturebar)
                        self.Experience:SetBackdrop({bgFile = 'Interface\\Tooltips\\UI-Tooltip-Background', insets = {top = -1, left = -1, bottom = -1, right = -1}})
                        self.Experience:SetBackdropColor(.15,.15,.15)
                        self.Experience.Tooltip = true


p3lim 10-05-08 08:40 AM

Quote:

Originally Posted by Caellian (Post 103508)
Thanks a lot i will give it a try, it's a statusbar btw.

Thats a frame

Caellian 10-05-08 09:39 AM

Quote:

Originally Posted by p3lim (Post 103509)
Thats a frame

Yes sry, but that didn't do anything, i've added this to the experience block, tried with both alpha-show/hide.

Slakah 10-05-08 10:14 AM

You'll need to set the alpha to 0 when it's loaded as well, or else it will be shown until moused over.

soo:

Code:

self.Experience:SetScript('OnEnter', function(self) self:SetAlpha(1) end)
self.Experience:SetScript('OnLeave', function(self) self:SetAlpha(0) end)
self.Experience:SetAlpha(0)


Caellian 10-05-08 10:22 AM

...I am not editing, i am not editing, i am not editing...

Nvm the above, actually i didn't even need to use that, i just edited my current OnEnter/OnLeave, thanks for the hints.

Code:

        self:SetScript("OnEnter", function(self)
                if(unit == 'player') then self.Experience:Show() end
                UnitFrame_OnEnter(self)
        end)

        self:SetScript("OnLeave", function(self)
                if(unit == 'player') then self.Experience:Hide() end
                UnitFrame_OnLeave(self)
        end)

Quote:

Originally Posted by Slakah (Post 103513)
You'll need to set the alpha to 0 when it's loaded as well, or else it will be shown until moused over.

I've added self.Experience:Hide() to the exp block but it still is shown on login though.

Slakah 10-05-08 10:46 AM

Quote:

I've added self.Experience:Hide() to the exp block but it still is shown on login though.
Line 72 of oUF_Experience bar:Show().

So you'll need to force it to hide when shown i.e.

Code:

local function Hide(f)
  f:Hide()
  f:SetScript("OnShow", f.Hide)
end
local function Show(f)
        f:Show()
        f:SetScript("OnShow", nil)
end

Hide(self.Experience)

self:SetScript("OnEnter", function(self)
        if(unit == 'player') then Show(self.Experience) end
        UnitFrame_OnEnter(self)
end)
self:SetScript("OnLeave", function(self)
        if(unit == 'player') then Hide(self.Experience) end
        UnitFrame_OnLeave(self)
end)


Caellian 10-05-08 02:30 PM

Hmm this doesn't work at all

Code:

local function Hide(f)
  f:Hide()
  f:SetScript("OnShow", f.Hide)
end
local Show(f)
        f:Show() -- LINE 280
        f:SetScript("OnShow", nil)
end

Hide(self.Experience)

Code:

Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:280: syntax error near 'f'
Count: 1


p3lim 10-05-08 02:34 PM

Quote:

Originally Posted by Caellian (Post 103524)
Hmm this doesn't work at all

Code:

local function Hide(f)
  f:Hide()
  f:SetScript("OnShow", f.Hide)
end
local Show(f)
        f:Show() -- LINE 280
        f:SetScript("OnShow", nil)
end

Hide(self.Experience)

Code:

Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:280: syntax error near 'f'
Count: 1


Code:

local function Hide(f)
  f:Hide()
  f:SetScript("OnShow", function() f.Hide end)
end
local Show(f)
        f:Show() -- LINE 280
        f:SetScript("OnShow", nil)
end

Hide(self.Experience)


Slakah 10-05-08 02:36 PM

Quote:

Originally Posted by Caellian (Post 103524)
Hmm this doesn't work at all


I forgot the "function" bit, amoung other things :P.

Post edited so it'll work now.

Caellian 10-05-08 03:33 PM

Yes yes now it works, it's hidden on login, but it won't show up anymore :D

Caellian 10-05-08 04:02 PM

This is what i've got, hidden on login, but doesn't show up on mouseover.

Beginning of the style (where the OnEnter/OnLeave were)

Code:

        local function Hide(f)
                f:Hide()
                f:SetScript("OnShow", f.Hide)
        end

        local function Show(f)
                f:Show()
                f:SetScript("OnShow", nil)
        end

        self:SetScript("OnEnter", function(self)
                if(unit == 'player') then Show(self.Experience) end
                UnitFrame_OnEnter(self)
        end)

        self:SetScript("OnLeave", function(self)
                if(unit == 'player') then Hide(self.Experience) end
                UnitFrame_OnLeave(self)
        end)

And at the end of the self.Experience block

Code:

Hide(self.Experience)
P3lim, if i use yours with
Code:

f:SetScript("OnShow", function() f.Hide end)
i get a
Code:

Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:282: '=' expected near 'end'
. Line 282 is yours just above.

garnerh42 10-05-08 06:11 PM

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?

p3lim 10-05-08 06:19 PM

Code:

local function PostCreateAuraIcon(self, button, icons, index, debuff)
        button.cd:Hide()
end

drycoded

MoonWitch 10-05-08 06:46 PM

Quote:

Originally Posted by p3lim (Post 103536)
Code:

local function PostCreateAuraIcon(self, button, icons, index, debuff)
        button.cd:Hide()
end

drycoded

That's what I have to disable omnicc cd counts.

garnerh42 10-05-08 07:43 PM

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!

Slakah 10-06-08 01:16 AM

Quote:

Originally Posted by MoonWitch (Post 103537)
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

Caellian 10-06-08 03:46 AM

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
Quote:

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 ?

Kellen 10-06-08 06:46 AM

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.

haste 10-06-08 08:27 AM

Quote:

Originally Posted by Kellen (Post 103560)
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.

Kellen 10-06-08 09:07 AM

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.

Slakah 10-06-08 09:11 AM

Code:


       
Quote:

       
       
               
       
       

                       

                       
                                        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)


Seerah 10-06-08 11:54 AM

Quote:

Originally Posted by Kellen (Post 103560)
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.

Kellen 10-06-08 12:16 PM

Quote:

Originally Posted by Seerah (Post 103571)
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!

Frayol 10-07-08 06:47 AM

Quote:

Originally Posted by p3lim (Post 103488)
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. :confused:

Quote:

Originally Posted by Slakah (Post 103496)
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.

Quote:

Originally Posted by p3lim (Post 103497)
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. :(

Quokka 10-07-08 08:39 AM

Is there a way to show temp enhancements (Weapon Buffs) in the aura?

p3lim 10-07-08 08:41 AM

Take a look at my raid layout (oUF Perfect), its based on pure tags for text

haste 10-08-08 09:01 AM

Quote:

Originally Posted by Quokka (Post 103642)
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/

Alanor 10-09-08 03:57 AM

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!

haste 10-09-08 04:11 AM

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 :).

Caellian 10-09-08 12:44 PM

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)


haste 10-09-08 02:56 PM

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.


All times are GMT -6. The time now is 07:59 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI