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

Create tool to connect RoadPoints and RoadContainers #117

Closed
TheDuckCow opened this issue Aug 6, 2023 · 4 comments · Fixed by #128, #131, #132 or #133
Closed

Create tool to connect RoadPoints and RoadContainers #117

TheDuckCow opened this issue Aug 6, 2023 · 4 comments · Fixed by #128, #131, #132 or #133
Assignees
Labels
enhancement New feature or request

Comments

@TheDuckCow
Copy link
Owner

Need to decide the exact details, but at the highest level this solves the problem of being able to connect RoadPoints in the currently open scene to RoadPoints of editor-inaccessible nested scenes, necessary for prefab pieces or for intersections.

A couple ways we could make this:

Option A

Shortcut keys, where if you have a RoadPoint, RoadNetwork, or RoadIntersection selected and you hold a particular modifier key like control, it engages in a connection mode.

Option B

Similar to the built in curve editor, this would be a connection tool mode that is separate from the "add roadpoint" tool. When it is active, a connection is made with two clicks:

  1. As your mouse moves around, eligible selection points (including children RoadPoints of nested scenes) are made visible as you hover near.
    • It should change color or invert itself when you mouse is close enough to trigger the selection if you were to click
  2. Select your first element
  3. This element is highlighted with some immediate geometry around it
  4. Now select any other new element, whereby a dotted animated line will appear while you are performing the placement. Pressing escape cancels the selection of everything
  5. On click, the connection is made. When making this connection, it will always slot your connection on the side of the roadpoint that is nearest to the cursor (and we should ensure the indicator implies this).
@TheDuckCow TheDuckCow added this to the v0.4.0 | Intersections milestone Aug 6, 2023
@TheDuckCow TheDuckCow self-assigned this Aug 6, 2023
@TheDuckCow TheDuckCow added the enhancement New feature or request label Sep 10, 2023
@TheDuckCow TheDuckCow linked a pull request Oct 9, 2023 that will close this issue
@TheDuckCow TheDuckCow changed the title Create tool to connect RoadPoints and RoadIntersections Create tool to connect RoadPoints and RoadContainers Oct 14, 2023
@TheDuckCow
Copy link
Owner Author

TheDuckCow commented Oct 14, 2023

Thinking about this further, as we have an initial toolbar with select, add, and delete modes:

  • In native Godot, shift + clicking adds current nodes to the selection, our road point selector gets in the way of that
  • Command-click + slide engages in rotate (currently works consistently with RoadPoints)
  • Non modifier click and drag engages in translate (currently works consistently with RoadPoints)
  • Control click (with or without drag) appears to do nothing not even change selection, so could be considered "open".
  • Option click acts the same as just click on its own, so also could be considered "open" for further tuning behavior.

The current thought is to make the "Add tool" also be the connection tool for convenience:

  • Default behavior: if a mouse move would yield a new selected RoadPoint on click, visualize and then on click process as a connection attempt.
  • Holding "option" could invert the default behavior, so you can override to still "add point" in case it's getting tight or there's overlap
  • Holding control could temporary switch you to the "select mode", which would be quite nice to be able to update which roadpoints you have selected since adding another RP is context-aware, and toggling tool modes all the time is annoying.
  • Control could also be used to toggle in the Select state too.

I like the idea of using control+click as a means to result in a selection whilst in the add tool mode, as that's similar to blender as a shortcut (though in Blender's case, control + [default mouse to select] click is just a way to select an object based on an origin without doing zdepth checking. Plus, if we're sticking with blender conventions as a rationale, control+click in an object edit mode is a shortcut to create new points/geometry, so that is a nice parallel to adding a RoadPoint even if you are in Select mode.

What to do if Delete mode is on? Likely nothing modified.

@TheDuckCow TheDuckCow linked a pull request Oct 16, 2023 that will close this issue
@TheDuckCow
Copy link
Owner Author

Only part that remains still on this ticket is making the connections between two different RoadContainers. Leaving this open in the meantime, though the connection tool is in a good spot otherwise.

@TheDuckCow
Copy link
Owner Author

Per my comment here, we have just a handful of scenarios to support for connections between RoadContainers, and then we'll be able to call v0.4.0 ready to go.

@TheDuckCow
Copy link
Owner Author

Considering this closed at this time - more improvements can be made with future issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment