Thread Tools Display Modes
08-10-09, 10:27 PM   #1
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
CFM: Blizz frame conflict

Well, seeing as how the community over at WoW is as helpful as ever (read: COMPLETELY USELESS), I copy/paste here.

I'm having an conflict that I can't resolve with CFM.

Situation:
1) Open character frame
2) Add CharacterFrame
3) Change scale to .8
4) Change X/Y to 0
5) Close everything (ESC)
6) Open character frame

The frame sets back to it's original position, but retains scale info.

7) /reload
8) Open character frame
9) All settings apply as they should

Things to consider:
1) As soon as a frame is added to CFM, it automatically sets SetUserPlaced(true) and SetMovable(true)
2) After reload, the saved vars show that all info is being stored correctly, in both CFM's database and in layout-local.lua

It appears as WoW won't adjust the set x/y until after the reload, after which it's works perfectly from then on out. I'm trying to avoid this need of a reload if at all possible.
  Reply With Quote
08-10-09, 10:53 PM   #2
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Unfortunately, SetUserPlaced() is only effective after being written to file, which entails logging out, exiting WoW, or reloading the UI.

You could possibly set position variables in a file-local table when setting the coords, and hook the frame's OnShow script to refer to them for manually placing the frame until the next time the game is loaded - at which point the frame's coords wouldn't exist in the table and would simply be placed via the saved values.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
08-10-09, 11:04 PM   #3
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Torhal View Post
Unfortunately, SetUserPlaced() is only effective after being written to file, which entails logging out, exiting WoW, or reloading the UI.

You could possibly set position variables in a file-local table when setting the coords, and hook the frame's OnShow script to refer to them for manually placing the frame until the next time the game is loaded - at which point the frame's coords wouldn't exist in the table and would simply be placed via the saved values.
Actually, I've already hooked OnShow for the frames. But now that you've pointed it out, I just realized that I made the hooks after reloads/relogs, but never placed hooks when a frame is initally added, which would most likely solve this issue. Testing now....

EDIT: Yep, that solved it. Can't believe I didn't notice it before.... >.<

Last edited by Sythalin : 08-10-09 at 11:20 PM.
  Reply With Quote
08-10-09, 11:22 PM   #4
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by ChaosInc View Post
EDIT: Yep, that solved it. Can't believe I didn't notice it before.... >.<
...forest for the trees...?
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
08-10-09, 11:28 PM   #5
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Torhal View Post
...forest for the trees...?
And said forest keeps getting deeper and deeper as I keep adding more trees I wasn't expecting.
  Reply With Quote
08-10-09, 11:40 PM   #6
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Aye - it's good to stroll out for a bit before you find yourself blinking rapidly, pointing at nothing in particular, and drooling from one side of your mouth whilst scratching your head.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » CFM: Blizz frame conflict


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