Thread Tools Display Modes
07-28-10, 09:50 AM   #1
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
oUF_MovableFrames

Is it possible to add a function to this plugin to check whether or not a specific frame has been moved by oUF_MovableFrames? Would help a lot with positioning. Not entirely sure if this has been mentioned before.

The reason for this is because sometimes built in positioning can be borked by custom positioning due to oUF_MovableFrames. If there was a way to check if a specific frame has been moved, then I just won't touch it. Otherwise, I can implment the positioning built with the UI.

Example: (just a representation, not exact code)

Code:
if oUF_MovableFrames:hasFrameMoved("framename") then
    --don't move the frame
else
   --move the frame since oUF_MovableFrames wasn't used
end
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
07-28-10, 10:00 AM   #2
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Another possible solution would be to allow oUF Layout authors the ability to blacklist a frame from being moved via oUF_MovableFrames. I don't think there is currently a way to do this.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
07-28-10, 10:23 AM   #3
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
You noticed the "edit"-button right under your posting? You are allowed to use it...

I can't see, why this feature should be necessary... Why not handle the frame's positioning-information in SavedVariables (per Acc or per Char) and default them as you like?
Any user, who wants to move the frames can then use the plugin to move them and you don't have to bother, if he has moved them, since the stuff is handled by your generic positioning and the user's SavedVars?
  Reply With Quote
07-28-10, 11:06 AM   #4
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by Mischback View Post
You noticed the "edit"-button right under your posting? You are allowed to use it...

I can't see, why this feature should be necessary... Why not handle the frame's positioning-information in SavedVariables (per Acc or per Char) and default them as you like?
Any user, who wants to move the frames can then use the plugin to move them and you don't have to bother, if he has moved them, since the stuff is handled by your generic positioning and the user's SavedVars?
There are some static frames,buttons,bars that cannot be moved by oUF_MovableFrames. The positioning is based off the default position of frames which are found in the default layout. Once these frames are moved the positioning for these non-movable frames get messed up.

Example, a casting bar is positioned to be under the pet frame. However a user used oUF_MovableFrames to move the pet frame somewhere else. Now there is a huge gap between where the pet frame was and the casting bar is currently located. In such cases the logical solution would be to move the casting bar up. You could do a current location vrs default position check, yet this would open a can of worms in terms of relative positioning on other frames. IE frame positioning based off the location of another frame.

That is why I was asking if a blacklist of some sort could be added. I'm currently going to check to see if Frame:SetMovable(false) could be used. Although, I did try it before and it didn't seem to work.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
07-28-10, 11:22 AM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I'd have to agree with Mischback. To me it sounds like your anchoring is incomplete and awkward. oUF_MovableFrames exists to let users move around the frames, adding blacklist functionality would only defeat that purpose.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-28-10, 11:34 AM   #6
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Originally Posted by Xruptor View Post
Example, a casting bar is positioned to be under the pet frame. However a user used oUF_MovableFrames to move the pet frame somewhere else. Now there is a huge gap between where the pet frame was and the casting bar is currently located. In such cases the logical solution would be to move the casting bar up. You could do a current location vrs default position check, yet this would open a can of worms in terms of relative positioning on other frames. IE frame positioning based off the location of another frame.
Sorry, I don't understand your example... You want to set the position of a castbar relative to the pet-frame, but you use absolute values in the style of
Code:
castbar:SetPoint('CENTER', UIParent, 'CENTER', x, y)
?

Then why not simply set the position of this castbar relative to the petframe?
Code:
castbar:SetPoint('CENTER', 'PetFrame', 'CENTER', x, y)
You will have to insert a fitting name where I put 'PetFrame', but this style of positioning will do the trick, since the castbar will be moved with the petframe.
  Reply With Quote
07-28-10, 02:29 PM   #7
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by Mischback View Post
Sorry, I don't understand your example... You want to set the position of a castbar relative to the pet-frame, but you use absolute values in the style of
Code:
castbar:SetPoint('CENTER', UIParent, 'CENTER', x, y)
?

Then why not simply set the position of this castbar relative to the petframe?
Code:
castbar:SetPoint('CENTER', 'PetFrame', 'CENTER', x, y)
You will have to insert a fitting name where I put 'PetFrame', but this style of positioning will do the trick, since the castbar will be moved with the petframe.

The castbar is independant to the pet frame. It's not a pet casting bar frame. So if I attached it to the pet frame then the players casting bar would be moved with the pet frame. Currently it's attached to the player frame but at a distance relative to the pet frame location.

Originally Posted by haste View Post
I'd have to agree with Mischback. To me it sounds like your anchoring is incomplete and awkward. oUF_MovableFrames exists to let users move around the frames, adding blacklist functionality would only defeat that purpose.
The anchoring isn't incomplete or awkward. The castbar just isn't incorporated into the player frame.

Player frame
pet frame
player casting frame


Move the pet frame and now there is a large unwanted gap between the player frame and player casting bar. Largely because the pet frame was moved.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }

Last edited by Xruptor : 07-28-10 at 02:32 PM.
  Reply With Quote
07-28-10, 03:27 PM   #8
Boomting
A Murloc Raider
 
Boomting's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2010
Posts: 9
i love it

nice work & good idea
__________________
My UI|My Car|Me
  Reply With Quote
07-28-10, 10:34 PM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It isn't really up to oUF_MovableFrames to handle odd layout solutions, and a blacklist would only be screwing users over imo.

Just do the right thing and provide the users with a proper way to move the castbar or ignore the "issue".

It shouldn't be oMFs fault that the user can't position the frames as you want them.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-29-10, 06:22 AM   #10
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by haste View Post
It isn't really up to oUF_MovableFrames to handle odd layout solutions, and a blacklist would only be screwing users over imo.

Just do the right thing and provide the users with a proper way to move the castbar or ignore the "issue".

It shouldn't be oMFs fault that the user can't position the frames as you want them.
I never put blame or fault on oUF_MovableFrames. I was merely asking for a feature to be possibly implemented. You said no, and that's fine. I only stated that there may be a conflict between positioning based on a user moving a frame. I was looking for a remedy or at least a solution to this problem. That is all.

Thanks for the feedback for those that gave it. I'll find a way around it myself and I'm sure I'll find a solution.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }

Last edited by Xruptor : 07-29-10 at 06:26 AM.
  Reply With Quote
07-29-10, 11:38 AM   #11
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Okay i've looked into this a bit more. I've tried a few possible solutions but none of them were effective. I could write built in code seperate from oUF_MovableFrames to allow the user to move the castbar. However, it would be great if oUF_MovableFrames did all the frame movements, rather then having to implement unnecessary code into the layout.

I think Subere explained it best so I'll quote him:

After looking into it further I think you're just going to have to settle for moving the castbars manually through the Lua. :[

The first limitation stopping it from working with MoveableFrames and the blizz implementations for making frames movable is the fact that the Castbar is a StatusBar (think the health bar on the player frame). It is not attached to any base frame and is not movable as a StatusBar.

If we were to create a frame to anchor it too, we run into the second limitation being that MoveableFrames only moves base oUF objects (e.g. Player, Target, ToT, etc.). The player castbar is considered a child of the Player object, so on and so forth with the other castbars. So at that point MoveableFrames would either have to be updated to move frames that are children of the base objects or I'd have to implement some layout specific code that would handle it.

Even if I were to parent the castingbar to a separate created frame, oUF_MovableFrames would still not recognize it.

So my question is this
: How or what can I do to make oUF_MovableFrames recognize the castingbar frame (or custom create frame) so it can be moved? If not, then aside from implementing my own moving routines, is there a better way to do this to make things easier for the user?

Thanks in advance.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
07-29-10, 12:51 PM   #12
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
It should be possible to spawn more than one oUF.player and with 1.4 it is possible to spawn it with a different style-function.

So you may spawn a player-frame as we are used to, and spawn another one, which basically only contains the castbar of the player. So it should be moveable with oUF_MovableFrames, as you fullfill the limitation, as you describe them.
  Reply With Quote
07-29-10, 03:32 PM   #13
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by Mischback View Post
It should be possible to spawn more than one oUF.player and with 1.4 it is possible to spawn it with a different style-function.

So you may spawn a player-frame as we are used to, and spawn another one, which basically only contains the castbar of the player. So it should be moveable with oUF_MovableFrames, as you fullfill the limitation, as you describe them.
Hmm that's one possibility. But wouldn't that make two styles show up rather then one? I would have to label the second one something close like oUF_MyStyle2 from oUF_Mystyle1.

There has to be another way to do this. If worst comes to worst I'll just hand code the movement.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
07-30-10, 12:44 AM   #14
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Originally Posted by Xruptor View Post
But wouldn't that make two styles show up rather then one?
What do you mean? Yeah, you would have two styles, but why care? Take a look at my main layout-file and scroll directly to the bottom.
You will notice, that I define one style for every single unit.

You could go with something like this:
Code:
local function yourStyle(self)
    -- do beautiful things here
end

local function yourPlayerCastbar(self)
    -- your player castbar code here
end

-- snip

oUF:RegisterStyle('oUF_yourStyle', yourStyle)
oUF:SetActiveStyle('oUF_yourStyle')
oUF:Spawn('player', 'playerframe'):SetPoint('CENTER', UIParent, 'CENTER', 0, 0)
-- spawn more frames,if you like
oUF:RegisterStyle('oUF_yourCastbar', yourPlayerCastbar)
oUF:SetActiveStyle('oUF_yourCastbar')
oUF:Spawn('player', 'player_castbar'):SetPoint('CENTER', UIParent, 'CENTER', 0, 40)
  Reply With Quote
08-01-10, 09:04 AM   #15
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Thanks for the help Mischback. I was hoping there was a better way to do this. The suggestion you gave does work. I'll use it for now until I can find a better way to do it. Personally, I don't like having multiple categories for my style on oUF_MovableFrames. I guess you can say I'm stubborn that way.

Trying to see if there are other ways around this issue.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
08-01-10, 11:37 PM   #16
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
you could perhaps try to register your defauts SetPoint in tables and compare it with the actual GetPoint of your unitframes and do the placement.
  Reply With Quote
08-02-10, 06:19 AM   #17
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by Rostok View Post
you could perhaps try to register your defauts SetPoint in tables and compare it with the actual GetPoint of your unitframes and do the placement.
Yeah I did that initially, if you scroll up I had mentioned that. Previous vrs Current position The reason I removed it was because the positions would have to checked each time a specific frame was moved. Which adds more processing that I don't really want. Thanks for the advice though!
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF_MovableFrames

Thread Tools
Display Modes

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