12-30-09, 09:28 PM | #1 |
SetUserPlaced
So i got my chat frames to remember position but they dont close until log out. Trying to make it so that when you move things like the player paperdoll frame that it remembers where you m oved it to when you hit the x button. any ideas?
|
|
12-30-09, 10:46 PM | #2 |
frame:SetUserPlaced(true)
This stores it's position with WoW itself and will restore to these points when you log back in (unless you have another mod that moves them, which typically occurs AFTER this placement). |
|
12-31-09, 03:18 AM | #3 |
lua Code:
__________________
Three things are certain, Death, taxes and site not found, You, victim of one. |
|
12-31-09, 07:57 AM | #4 |
I can do it with the chat frames no problem but what about like the paperdoll frame? or achievement frame? or better yet your bags..... I can make them movable just fine but the problem is they do not save the position they were moved to once they are closed. They always appear in the same spots every time. I tried using SetUserPlaced but no method of inserting that anywhere has worked. My chat frame code looks a lot l ike what you posted and the chat frames are working just fine as far as saving the position after the user moves them after the initial setup of the interface. I know why to... it has to do with the fact the chat windows stay open until you log out. So how do i do that to a frame that closes before a log out? technically it should be able to take a user placed command since it is a blizzard frame but... maybe how i did the moving part? The code is originally from DragEmAll by Emelio, its been modified some and added to. Here is what i have right now, as you can see i have put the setuserplaced in a few spots but those spots nor any other spot does anything, setting it to true,false,nil makes no difference. Clearly im not doing something right?
lua Code:
Last edited by Grimsin : 12-31-09 at 08:23 AM. |
|
12-31-09, 08:06 AM | #5 |
hmm how are you transferring the code coloring when you post code?
|
|
12-31-09, 08:11 AM | #6 |
12-31-09, 10:15 AM | #7 |
Ah, I ran into this issue with CFM. In the end, I realized I couldn't rely on SetUserPlaced, especially when it came to the LoD stuff. I ended up hooking the "OnShow" script of the frames to adjust their positions:
lua Code:
Worked like a dream. |
|
12-31-09, 04:38 PM | #8 |
Im confused haha. So you made it save to a variable when you moved the frame is that what its calling on with CFM_ApplySettings?
|
|
12-31-09, 04:49 PM | #9 | |
lua Code:
The actual function: lua Code:
Hope that helps a bit and/or gets the brain going. |
||
01-01-10, 10:32 AM | #10 |
Thanks! that certainly answers the question i need to use variables. Now to figure out how to work that into my code. I suck with variables still. Most of the grimUI core is optionless. so far the only variables i have done do not involve user input. It gets info and answers its own questions. Gonna play with it will see what happens.
|
|
01-01-10, 01:00 PM | #11 |
No prob. Personally, I'd make a small lib file in addition to the main file in this case. It'll be easier to access for changes, just make sure that file is listed before the "main" file in the .toc
Glad to have helped though. If you need any more help with this functionality just gimme a ring. I know I had a bit of a time getting the hang of this concept and to get it to work correctly. |
|
01-01-10, 01:42 PM | #12 |
Well actually Cargor wrote a basic frame for modules for me so the addon is modular. So the module core works like the lib for the rest of the addon or at lest thats how i have been building things so far.
|
|
01-01-10, 01:57 PM | #13 |
I see. Oh, and you should log into ICQ once in a while. Been trying to add you for quicker coms.
|
|
01-01-10, 02:17 PM | #14 |
haha its on now.
|
|
WoWInterface » Developer Discussions » Lua/XML Help » SetUserPlaced |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|