Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid alignment functionality #252

Merged
merged 1 commit into from
Jan 14, 2019
Merged

Conversation

volte
Copy link

@volte volte commented Jan 13, 2019

This pull request adds some new functionality to allow the grid to be rotated and translated. In this first iteration, there are three new functions added to the Edit menu:

  • Align Grid to Selected Linedef: This will rotate the grid so that one of the axes is parallel to the selected linedef. It will also modify the grid's origin to the starting vertex of the linedef, ensuring that the selected linedef lies on a grid line.
  • Set Grid Origin to Selected Vertex: This will change the grid's origin to the selected vertex, ensuring that the selected vertex lies exactly on the intersection of two grid lines.
  • Reset Grid: This resets the grid back to Doom's coordinate space.

I didn't create any default keybinds but I manually set them up as:

  • Align to Sidedef = Keypad +
  • Set Origin to Vertex = Keypad .
  • Reset = Keypad /

which works well for me.

Preview

I created this for GZDoomBuilder-Bugfix but I was also asked to implement it for Doom Builder X, which I did, here.

@biwa
Copy link
Collaborator

biwa commented Jan 13, 2019

Tried it out and it works as expected - nice work!

Bug I noticed: if you have a grid size of smaller than 1 and you zoom in really close, the fine grid lines disappear if the grid is aligned to a linedef.

Another thing I noticed: if you try to do something nonsensical, like trying to align the grid to multiple lines, there's a dialog that notifies you of your mistake. That's not how the DB2 family notifies the user of mistakes - that's done through the status bar and a sound (using General.Interface.DisplayStatus and General.Interface.MessageBeep). For example when you try to enter edit selection mode without having anything selected the status bar will be updated with "A selection is required for this action."). For consistency's sake I'd recommend you change your code to the same behavior.

@jewalky jewalky merged commit a1d28e1 into UltimateDoomBuilder:master Jan 14, 2019
@volte
Copy link
Author

volte commented Jan 15, 2019

Thanks - if I get some time this week I'll make a new pull request to make the behavior more consistent and fix the grid disappearing bug.

@jewalky
Copy link
Collaborator

jewalky commented Jan 15, 2019

Thanks! I was going to look and perhaps fix some of these, but if you can that'd be great. I don't have a lot of time lately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants