Thread Tools Display Modes
12-01-10, 07:05 PM   #1
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Need a help on an error

Info
frame - parent
PartyMemberFrame4 - UIParent
PartyMemberFrame3 - PartyMemberFrame4PetFrame
PartyMemberFrame2 - PartyMemberFrame3PetFrame
PartyMemberFrame1 - PartyMemberFrame2PetFrame

Works fine when first set up. But when a user /reloads, it pops the following error:

Code:
Error occured in: Global
Count: 1
Message: ..\AddOns\CFM\CFM.lua line 313:
   PartyMemberFrame2:SetPoint(): PartyMemberFrame3PetFrame is dependent on this
lua Code:
  1. frame = activeProfile[name].frame -- frame name from saved variables
  2. _G[frame]:SetMovable(true)
  3. _G[frame]:ClearAllPoints()
  4. _G[frame]:SetPoint(activeProfile[name].point, activeProfile[name].parent, activeProfile[name].relativePoint, format("%d", activeProfile[name].offsetX), format("%d", activeProfile[name].offsetY))  -- line 313

I tried to change the anchors to be just the other unit frames themselves, but ends in the same error.
  Reply With Quote
12-01-10, 07:49 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Is that lua code in a loop?

The answer is unfortunately the obvious one.

PartyMemberFrame3PetFrame has had it's anchor set previously to when that code is running and its dependent on PartyMemberFrame2
(probably through anchoring to PartyMemberFrame3 which is anchored to PartyMemberFrame2)

If it is in a loop try going the other way around doing ClearAllPoints() from the "bottom up"

PartyMemberFrame4PetFrame->PartyMemberFrame4->PartyMemberFrame3PetFrame->PartyMemberFrame3-> etc before you try to re-anchor.
  Reply With Quote
12-01-10, 09:21 PM   #3
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
You are probably better off just running ClearAllPoints on all the frames before running SetPoint on any of them. What I don't understand is why you are parenting the frames like that, unless your use of parent in "frame - parent" is being used to refer to the relative frame in SetPoint calls.
  Reply With Quote
12-02-10, 12:29 AM   #4
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
This was a user's setup. In a nutshell, he was attempting to reverse the order of the party frames. Since the addon adjusts everything in alpha-numerical order, it makes sense with Dridzt explanation. I could reverse the order, but it's a bit much for this lone, uncommon issue. It's much easier for them to just reanchor to "UIParent", as the user has already done.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need a help on an error


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