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

New feature, dialog to edit train track system in an easy way. #948

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cambrialas
Copy link

@cambrialas cambrialas commented Oct 23, 2024

This is a feature, which can create train track systems in an easy way.

How to use:

  1. Open the dialog pressing Ctrl+T or 'Menu -> Piece -> Train Track system wizard'
  2. Choose the wanted track section type in the parts selector.
  3. Click on track section where the new track section should be connected to. This is on the two center studs in the end of the track section.
  4. While pressing the mouse button the new track section can be rotated to the next connection point, pressing the arrow right key. Release mouse button when rotated as wanted.
  5. Delete a track section click in the middle of the section.
  6. Press 'ok' button to get the train track system into the main editor window.

This pull request is to hear what you think about this feature.

Kind regards
Train track system wizard - example

@leozide
Copy link
Owner

leozide commented Oct 26, 2024

This is an interesting idea, it reminds me of the old Track Designer app.

There were a few crashes, but I managed to get it to run. Ideally, this wouldn't be a separate dialog, and instead, we could experiment with new gizmos on the main view when a track piece is focused for a seamless editing experience.

@cambrialas
Copy link
Author

cambrialas commented Oct 29, 2024

Cool to hear you like the idea.

Agree, it's better to have the train track system editor integrated into the main window.

My thoughts about, how it could be integrated, is as follows:

  1. When a track piece is focused (selected), it should show a gizmo, in the end of the train track section to indicate, that there is something.
  2. When hovering over this gizmo, it shows a graphic context panel, with the different train track types, which is possible to connect to the selected connection point on the selected track section.
  3. When the section type is chosen, it shows another graphics context panel, with two arrows to rotate the new section and an icon to confirm the placement of the new section.

And to make it fast to place a new track section, it could be using keyboard accelerators, as follows:
Hovering over the gizmo, choose section type by arrow keys 'up/down' keys and rotate by 'right/left' keys and place section by hitting 'enter' key.

I was thinking to implement the gizmo by inheriting from the 'object' class?

Best regard

@leozide
Copy link
Owner

leozide commented Nov 3, 2024

I've checked in an initial implementation of how I think this should work.

@cambrialas
Copy link
Author

It works very well, with the track system editor in main window.

In commit 'f460e65', there is added functionality, so the track can be rotated, when a new preview track section is selected. While holding the mouse left button down, the track can be rotated, moving the mouse right or left. Track section is set when the mouse button is released.

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.

2 participants