Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(5 Kb)
Download
Updated: 01-13-07 12:48 AM
Pictures
File Info
Updated:01-13-07 12:48 AM
Created:unknown
Downloads:3,719
Favorites:58
MD5:

SnapToGrid

Version: 1.1
by: Gello [More]

This small mod is a tool to help align frames. In theory it works with nearly any frame that users drag manually. Credit goes to Iriel for the original code to enable this and to JoshBorke for figuring out a workable method for 2.0.

__ New in 1.1 __
- 2.0-enabled thanks to fixes by JoshBorke

To set up: Create a key binding for SnapToGrid in the Interface Options->Key Bindings window.

To use: Hold the key binding down and a crosshair will appear. While you hold the key down, drag windows as you normally do and they will snap to an imaginary grid. Let go of the key to stop snapping to the grid.

When done: Hit the Reload button. In 2.0, SnapToGrid taints a lot of stuff. Reloading the UI will release the taints and hooks until you use it again.

How it works: When the key binding goes down it starts watching for StartMoving and StopMovingOrSizing methods and then displays a crosshair. This crosshair snaps to an imaginary grid on the screen. When a mod or the UI begins a StartMoving, it notes the frame being moved and then the crosshair moves to the corner of the frame. Periodically it will snap the frame to the crosshair.

Slash command (optional): /snap X : change the size of each grid cell to X (1 to 128, 16 is default)

__ FAQ __

Q: Reloading the UI every time I use this is a pain. Is it reeeally necessary?
A: If you want, open SnapToGrid.lua and comment out these two lines:

line 111: meta.__index = hookIdxCheckButton
line 124: StaticPopup_Show("SNAPTOGRIDRELOAD")

And it will remove ActionButtons from drag candidates and remove the reload popup.

Q: It's not letting me move a frame!
A: This mod doesn't move frames. This mod only adjusts the position of already-moving frames. Get DFM or MoveAnything or one of the frame moving mods to move frames. This mod was made to align frames that can already move.

Q: Why are the crosshairs like three feet away from the frame's corner?
A: Frames don't necessary begin where you can see them. Many times frames have an invisible border that extend way beyond the visible part. The crosshairs has less value in this case but the frames will still snap. (CTRA raid unit frames is a common example)

Q: I have two frames of different scale that don't want to line up exactly.
A: Scaling, especially if they have an invisible border, will affect the snap slightly. Frames of the same scale will align best.

Q: I only installed this mod to line up my CTRA/bars/etc. Can I get rid of it once its served its purpose?
A: Yep. You can disable or delete the mod if you want. However the mod is ~250 lines lua+xml combined with no events registered and no hooks until you hit the key binding, so it's safe to sit inert if you need it again.

Q: I don't get the crosshair sightings when dragging some frames like minimap buttons.
A: The likely reason is that the frame doesn't use StartMoving or StopMovingOrSizing. If a frame moves some other way (ie, an OnUpdate that clings a minimap button to the minimap edge), then this mod can't intercept the movement.

Q: I have a chat frame stuck on my cursor. It won't let me let go of it.
A: I'm still trying to track this down but: once in a while StopMovingOrSizing doesn't want to finish for the chat frames if you release a key and the mouse at the same time. You can drop it by reloading the UI: /script ReloadUI()

This still works - Miscellaneous

Optional Files (0)


Post A Reply Comment Options
Unread 04-09-10, 06:03 PM  
Spartitan
A Murloc Raider

Forum posts: 4
File comments: 57
Uploads: 0
w8 no nvm dis doesnt work at all its idk weird to use i wanted like lines on my screen dats all...do you know such addon o.O?
Spartitan is offline Report comment to moderator  
Reply With Quote
Unread 04-09-10, 05:46 PM  
Spartitan
A Murloc Raider

Forum posts: 4
File comments: 57
Uploads: 0
may you please update this addon?? its extremy usefull!
Spartitan is offline Report comment to moderator  
Reply With Quote
Unread 08-12-08, 08:01 AM  
TomWolf
A Fallenroot Satyr
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 10
Uploads: 2
Installed, hotkey made, crosshair shows, no snapping what so ever. No frame I've tried to move snaps to the grid.
TomWolf is offline Report comment to moderator  
Reply With Quote
Unread 01-17-07, 11:19 AM  
beesknees
A Kobold Labourer

Forum posts: 0
File comments: 6
Uploads: 0
Would you be willing to add the option of anchoring to the center of frames rather than the left-hand corner? Perhaps with a separate key binding? This would allow us to easily center frames on the screen. Right now I have Move Anything installed since it has the C-V and C-H options, but I would love to just have Snap-To-Grid. I've been having a lot of problems with taint and Move Anything and like how Snap-To-Grid saves the frame positions a lot better.

In any case, thanks for the great addon!
beesknees is offline Report comment to moderator  
Reply With Quote
Unread 01-14-07, 05:52 PM  
Durelsh
A Murloc Raider
 
Durelsh's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 6
File comments: 2
Uploads: 2
Great , now i can go make sure my UI is aligned to the pixel , lol. Great tool , thx.
Durelsh is offline Report comment to moderator  
Reply With Quote
Unread 01-13-07, 11:10 AM  
o_o
A Kobold Labourer

Forum posts: 0
File comments: 40
Uploads: 0
Tnx ;___;

*starts aligning thing* o_o
o_o is offline Report comment to moderator  
Reply With Quote
Unread 12-12-06, 05:03 PM  
starus
A Murloc Raider

Forum posts: 4
File comments: 5
Uploads: 0
Yep, I'm sorry, I spoke too soon.

I'm not sure why I didn't initially, but I now have that error also.

Originally posted by Caprica
Unfortunately this did not work for me either with the updated TOC

Error Message:

SnapToGrid\SnapToGrid.lua:42:attempt to call upvalue 'metaldx' (a table value)


*** PLEASE HELP -- I miss my lined up frames *****
starus is offline Report comment to moderator  
Reply With Quote
Unread 12-09-06, 02:29 AM  
Caprica
A Deviate Faerie Dragon

Forum posts: 10
File comments: 15
Uploads: 0
Originally posted by starus
Great concept. It's always bugged me having frames all over the place.

If you update the TOC, yes this will work in WoW 2.01.
Unfortunately this did not work for me either with the updated TOC

Error Message:

SnapToGrid\SnapToGrid.lua:42:attempt to call upvalue 'metaldx' (a table value)


*** PLEASE HELP -- I miss my lined up frames *****
Caprica is offline Report comment to moderator  
Reply With Quote
Unread 12-08-06, 12:42 PM  
o_o
A Kobold Labourer

Forum posts: 0
File comments: 40
Uploads: 0
Modified the toc but upon using it it give a lot of errors

Update it, let my aligning pain end ;__;
o_o is offline Report comment to moderator  
Reply With Quote
Unread 12-08-06, 08:11 AM  
starus
A Murloc Raider

Forum posts: 4
File comments: 5
Uploads: 0
Great concept. It's always bugged me having frames all over the place.

If you update the TOC, yes this will work in WoW 2.01.
starus is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: