Thread Tools Display Modes
10-13-10, 07:25 AM   #1
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Frame positioning problem when using latest oUF

I just updated to the latest oUF 1.4.3 from the github, and now all my frames are really screwed.

Before updating oUF:

After:


Here is the player's frame code:
Code:
if cfg.showplayer then
    oUF:RegisterStyle("oUF_DrkPlayer", CreatePlayerStyle)
    oUF:SetActiveStyle("oUF_DrkPlayer")
    oUF:Spawn("player", "oUF_Drk_PlayerFrame"):SetPoint("TOPRIGHT",UIParent,"BOTTOM", -210, 292)
  end

  local function CreatePlayerStyle(self)
    self.width = 250
    self.height = 60
    self.mystyle = "player"
    lib.init(self)
  end

  lib.init = function(f)
    f:SetAttribute("initial-height", f.height)
    f:SetAttribute("initial-width", f.width)
    f:SetAttribute("initial-scale", f.scale)
    f:SetPoint("CENTER",UIParent,"CENTER",0,0)
    f.menu = lib.menu
    f:RegisterForClicks("AnyUp")
    f:SetAttribute("*type2", "menu")
    f:SetScript("OnEnter", UnitFrame_OnEnter)
    f:SetScript("OnLeave", UnitFrame_OnLeave)
  end
I just noted that i use SetPoint twice for each frame (in oUF:Spawn and inside the init func), but it aways worked fine with previous versions of oUF.
I tried commenting the generic SetPoint inside the init function but it just got worse, now i have no visible frames at all.

Any insight would be very helpful, I'm kind of lost right now.

Last edited by drakull : 10-13-10 at 07:27 AM. Reason: typos
  Reply With Quote
10-13-10, 01:00 PM   #2
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
There's nothing in the code you posted that have sthg to do with the placement of the health bar/power bar/portrait bar.
You should pastey the whole code or tell us where we can find it if you want some help
  Reply With Quote
10-13-10, 01:18 PM   #3
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Originally Posted by Rostok View Post
There's nothing in the code you posted that have sthg to do with the placement of the health bar/power bar/portrait bar.
You should pastey the whole code or tell us where we can find it if you want some help
Code:
oUF:Spawn("player", "oUF_Drk_PlayerFrame"):SetPoint("TOPRIGHT",UIParent,"BOTTOM", -210, 292)
Well, i'm no LUA expert but I'm pretty sure the code above sets the playerframe position. The "CreatePlayerStyle" function listed in the OP sets it's size and height.
This also defines the "clicable" and "hover" area of the frame and this area simply does not exists when using the last version of oUF. I moved my mouse the entire screen and did not find it... it should at least activate the player tooltip but i get nothing.
The Healthbar, the powerbar and the portrait are all placed using the frame's position and size. The following is the code for the healthbar:
Code:
  lib.gen_hpbar = function(f)
    -- healthbar
    local s = CreateFrame("StatusBar", nil, f)
    s:SetStatusBarTexture(cfg.statusbar_texture)
    s:GetStatusBarTexture():SetHorizTile(true)
    s:SetHeight(40)
    s:SetWidth(f.width)
    s:SetPoint("TOP",0,0)
    -- helper
    local h = CreateFrame("Frame", nil, s)
    h:SetFrameLevel(0)
    h:SetPoint("TOPLEFT",-5,5)
    h:SetPoint("BOTTOMRIGHT",5,-5)
    lib.gen_backdrop(h)
    --bg
    local b = s:CreateTexture(nil, "BACKGROUND")
    b:SetTexture(cfg.statusbar_texture)
    b:SetAllPoints(s)
	f.Health = s
    f.Health.bg = b
  end
"f" is the playerframe.

If you still want to see the whole code, you can download it here.
  Reply With Quote
10-13-10, 05:09 PM   #4
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Like i said earlier, that's not the playerframe position the problem here, that's the different statusbars position.
I downloaded your layout, and first you shouldn't include oUF in your package.
oUF 1.4.3 is not fully compatible with the new patch, oUF 1.5.x is required here.
And with that, you must make your layout 1.5.x ready.
  Reply With Quote
10-13-10, 05:53 PM   #5
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Still i have no real clue about what's causing the frames behave like that... anyway, Haste just released oUF 1.5.2 and, as u said, i should (and will) start working with it now.

And oUF 1.4.3 was included in my layout because the version available at wowinteface at the time did not had support for HolyPower/SoulShards.

Thanks for your thoughts!

Last edited by drakull : 10-13-10 at 05:58 PM.
  Reply With Quote
10-13-10, 08:06 PM   #6
inopua
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1
I have the same issue with my layout even in 1.5.2 :/
  Reply With Quote
10-14-10, 04:20 AM   #7
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
Originally Posted by inopua View Post
I have the same issue with my layout even in 1.5.2 :/
I got it... oUF 1.4.3 from github was, in fact, oUF 1.5.X for quite some time. As I was unaware of it I never tried looking into that "API Version 5: changes..." topic. It covers this problem.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Frame positioning problem when using latest oUF


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