WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (http://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF - Layout discussion (http://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


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

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC