Thread Tools Display Modes
07-18-10, 02:57 PM   #41
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
Originally Posted by Dawn View Post
Try to set name:SetHeight(set it to yourfontsize). This should prevent the name from switching to a second line, in theory. However, the best solution would be to abbreviate names.
Hi thanks for the reply, I'm a complete noob, how do I abbreviate names?
  Reply With Quote
07-18-10, 10:47 PM   #42
Politig
A Chromatic Dragonspawn
AddOn Compiler - Click to view compilations
Join Date: May 2009
Posts: 176
It's been a while since I looked at some coding, but I've added this into lib.lua:

Code:
  --gen hp strings func
  lib.gen_hpstrings = function(f)
    --health/name text strings
    local name = lib.gen_fontstring(f.Health, cfg.font, 13, "THINOUTLINE")
    name:SetPoint("LEFT", f.Health, "LEFT", 2, 0)
    name:SetJustifyH("LEFT")
    
    local hpval = lib.gen_fontstring(f.Health, cfg.font, 13, "THINOUTLINE")
    hpval:SetPoint("RIGHT", f.Health, "RIGHT", -2, 0)
    --this will make the name go "..." when its to long
    name:SetPoint("RIGHT", hpval, "LEFT", -5, 0)
    
    f:Tag(name, "[name]")
    f:Tag(hpval, "[curhp]/[perhp]%")

    if self.mystyle == "player" then
        name:Hide()
    else
        name:Show()
    end
end
Inserted the red portion. For some reason, adding that makes the frames not show up at all. What am I doing wrong
  Reply With Quote
07-19-10, 11:18 AM   #43
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
I had to use the following to get it to show the name in different loactions depending updon frame.
Code:
 --gen name string func
  	lib.gen_namestring = function(f)
	--name text string
		local name = lib.gen_fontstring(f.Health, cfg.font, 9, "THINOUTLINE")
			if f.mystyle == "player" then
				name:SetPoint("LEFT", f.Health, "LEFT",28, 10)
				elseif f.mystyle == "target" then
				name:SetPoint("LEFT", f.Health, "LEFT",28, 10)
				name:SetWidth(100)
				else
				name:SetPoint("LEFT", f.Health, "LEFT", 0, 10)
			end
		f:Tag(name, "[name]")
	end
Think I tried self.mystyle when I was trying to figure out how to move the text and it didn't work and found out f.mystyle worked.

Not 100% sure why it worked but it did maybe one of the experts in here could elaborate?
  Reply With Quote
07-19-10, 12:46 PM   #44
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Just have a look on your function... You pass a frame (SELF) as "f" in the function-prototype... In your code, Politig, "self" is just not visible inside of the function, but the (function local) variable "f" is.

Perhaps you may want to google "variable scoping" to find some in depth explaination.
  Reply With Quote
07-21-10, 02:43 AM   #45
xandora
A Chromatic Dragonspawn
 
xandora's Avatar
Join Date: Feb 2009
Posts: 188
Trying to figure out how to add mana/power values to the Power bar with this layout.

I assumed it was as simple as copying the code for the HP text and changing everything to Power... but apparently it's not!

Was I on the right track?
__________________
  Reply With Quote
07-21-10, 11:09 AM   #46
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
I did the following:

lib.lua added:
Code:
--gen pwr strings func
	lib.gen_pwrstring = function(f)
    -- Power string
		local pwrval = lib.gen_fontstring(f.Health, cfg.font, 9, "THINOUTLINE")
		pwrval:SetPoint("RIGHT", f.Health, "RIGHT", -2, -13)
    
		f:Tag(pwrval, "[curpp] [maxpp]")
	end
then added to the player section of core.lua
Code:
lib.gen_pwrstring(self)
have a look at ouf > elements > Tags > tags.lua show tags you can use or you could make your own, that's what I'm playing about learning at mo
  Reply With Quote
09-13-10, 06:34 PM   #47
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Thumbs up

Hi,

Firstly I want to thank you for this tutorial addon... although I'm an experienced coder, my knowledge of LUA still very basic. Tried (hard) to create an ouf layout a few times but never got anywhere, now i have my dream layout (nothing new, just bits of many different layouts i like) almost finished and that's thanks to you, Zork.

Now maybe you can help me with some issues i'm having:
- Can't save the raidframe's position, and moving it is a complete mess;
- The player/target/etc frames positions are saved, but they reset from time to time;
- I can't figure out how to make the raidframe's style horizontal (and bottom anchored). Like this:

raidmember21 raidmember22 raidmember23 raidmember24 raidmember25
...
raidmember06 raidmember07 raidmember08 raidmember09 raidmember10
raidmember01 raidmember02 raidmember03 raidmember04 raidmember05

Alternatively, I want to manually especify each unit's default starting position in the cfg.lua but this i already have figured out how to achieve... at least i think so.

Any help is much apreciated!

PS: excuse my poor english, is not my mother tongue.
  Reply With Quote
09-14-10, 02:05 AM   #48
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
RaidFrames aswell as party do not have a specific global frame on their own. They use so called headers to anchor on.

The trick with moving them is to create a new helper frame each for party and raid. The frame could be made drag'able so you could move stuff ingame. Important is that you give it a global name.

Code:
 local f = CreateFrame("FRAME", "MyGlobalPartyFrameName", UIParent)
Now anchor your first raid header and your party header to those drag frames.
Since all the other raid frames are bound to the first one (you do this in your layout, check other raid layouts) they will move once you drag the dragframe around.

If you want to reanchor your raidframes try this. Play with the SetPoints and the xOffset.

Code:
    local raidDragFrame = CreateFrame("FRAME", "myRaidDragFrame", UIParent)
    raidDragFrame:SetWidth(70)
    raidDragFrame:SetHeight(70)
    raidDragFrame:SetPoint("CENTER",UIParent,"CENTER",0,0)
    lib.moveme(raidDragFrame)

    local raid = {}
    for i = 1, NUM_RAID_GROUPS do
      raid[i] = oUF:SpawnHeader("oUF_Raid"..i, nil, "raid",  "groupFilter", i, "showRaid", true, "xOffSet", 20, "point", "LEFT")
      if i == 1 then
        raid[i]:SetPoint("CENTER", raidDragFrame, "CENTER", 0, 0)
      else
        raid[i]:SetPoint("BOTTOMLEFT", raid[i-1], "TOPLEFT", 0, 10)
      end
    end
http://www.wowwiki.com/API_Region_SetPoint
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

Last edited by zork : 09-14-10 at 02:11 AM.
  Reply With Quote
09-14-10, 01:17 PM   #49
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Why are you still implementing a way to move frames with oUF_MoveableFrames being released and working fine for so long? It doesn't even require authors to support it from within the layout.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-14-10, 02:06 PM   #50
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Why should I use a mod if I can create a move function with 5 lines myself and still have full controll over its functionality?!
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-14-10, 07:55 PM   #51
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Because it offers more utility. Like a slash command that locks/unlocks it, it highlights frames also some of those not currently spawned, it saves positions, resets them, ... all of this in game, no need to open up notepad or whatever, which is still not common for A LOT of users.
The user can decide whether he wants to be able to move the frames in game or not, or just by himself via editing the layout's code and thus using zero additional lines of code, ...

I know you could do this, too, but not with 5 lines of code... after all it's up to you, ofc. I was just curious.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-16-10, 07:01 AM   #52
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Layout is set, have implemented raid marks, lfd icons, rest/combat indicators, created some new tags for especific use (mostly for raid frames). Looking good!
Now i am trying to implement timers for buffs/debuffs, finding a way to desaturate other's players buffs/debuffs like in ouf_caellian and adding support for interruptible spells to the castbar (different border color, something like that).

Still can't find a way to hide the blizzard default buffs/debuffs frame tho, i think it should be automatic as i already have buffs/debuffs for the playerframe.

PS: is there a way to create fake raid members and buffs? it would help a lot.

Last edited by drakull : 09-16-10 at 09:33 AM.
  Reply With Quote
09-28-10, 09:49 AM   #53
thelurkerbelow
A Murloc Raider
Join Date: May 2010
Posts: 5
Used your tutorial layout as an excuse to start messing about with oUF, but I've come across a bit of an issue. The status bar objects don't really behave like "normal" status bars: instead of the texture remaining static and filling/depleting based on value, the entire texture resizes itself.

Is this something that's particular to this tutorial layout that I haven't figured out yet, or is this an intrinsic "feature" of oUF itself?
  Reply With Quote
09-28-10, 10:19 AM   #54
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
That's the normal behaviour of oUF's health update function. You would need to adept this function to "fill/deplete" the texture instead of "resizing" it.
Which means it's entirely possible, but not by default.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-28-10, 11:03 AM   #55
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Make sure to add:
Code:
    yourTexture:SetVertTile(true)
    yourTexture:SetHorizTile(true)
You may only want vertical or horizontal, so you can disable the other. Try/error which one. No need to adjust the function, just add some more values that handle how the texture is tiled. Those are pretty new API calls.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

Last edited by zork : 09-28-10 at 11:05 AM.
  Reply With Quote
09-28-10, 11:53 AM   #56
thelurkerbelow
A Murloc Raider
Join Date: May 2010
Posts: 5
Originally Posted by Dawn View Post
That's the normal behaviour of oUF's health update function. You would need to adept this function to "fill/deplete" the texture instead of "resizing" it.
Which means it's entirely possible, but not by default.
Hmm. Seems a bit odd that by default it would make status bars behave completely differently than...uhh...status bars.
Originally Posted by zork View Post
Make sure to add:
Code:
    yourTexture:SetVertTile(true)
    yourTexture:SetHorizTile(true)
You may only want vertical or horizontal, so you can disable the other. Try/error which one. No need to adjust the function, just add some more values that handle how the texture is tiled. Those are pretty new API calls.
This just seems to make the texture "slide" instead of stretch/resize.

Bit of a deal-breaker for me, as most of my UI work deals with non-symmetrical bar textures. Worth a go, I suppose. Thank you anyway.
  Reply With Quote
09-28-10, 12:13 PM   #57
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
oUF is currently updated for Cataclysm. Feel free to suggest an API change regarding this issue over here. Who knows what haste is gonna say, maybe he'll change the default health update.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
10-02-10, 10:45 AM   #58
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Just to say thanks again and to let you know that my layout is ready, please take a look and let me know what you think.

http://www.wowinterface.com/download...4-ouf_Drk.html

Still have some minor bugs to address and lots of things to implement but i'm really proud of myself.
  Reply With Quote
10-05-10, 01:24 PM   #59
Eveigh
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 6
Started to mess around with oUF and your layout.
One thing bugs me a lot - if I "declare" a text in a "lib.lua", i can't attach actual text tag to it in "core.lua".
In "lib.lua", tags are attached simple:
Code:
f:Tag(name, "[name]")
However, when i try to do it in "core.lua" like this:
Code:
self.Tag(name, "[curhp]")
It just won't show me anything. I'm kind of lost.
Help me, please :3
  Reply With Quote
10-05-10, 01:49 PM   #60
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by Eveigh View Post
Started to mess around with oUF and your layout.
One thing bugs me a lot - if I "declare" a text in a "lib.lua", i can't attach actual text tag to it in "core.lua".
In "lib.lua", tags are attached simple:
Code:
f:Tag(name, "[name]")
However, when i try to do it in "core.lua" like this:
Code:
self.Tag(name, "[curhp]")
It just won't show me anything. I'm kind of lost.
Help me, please :3
Without seeing your code we can not tell you exactly what the issue is. could you post a link to your code?
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF tutorial layout for oUF 1.4


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