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

bidirectional lane connection UI #1492

Merged
merged 12 commits into from
Mar 28, 2022
Merged

bidirectional lane connection UI #1492

merged 12 commits into from
Mar 28, 2022

Conversation

kianzarrin
Copy link
Collaborator

@kianzarrin kianzarrin commented Mar 25, 2022

fixes #1214
fixes #762

  • Added VectorUtil to rotate by +-90 degree
  • Added DrawArrowHead() to Highlight
  • Added IsBidirectional to LaneEnd class (see code comments). this helps me decide if I need to draw arrow heads or not.
  • DrawLaneCurve() now can draw arrow head at 2/3rd of the way.
    • When drawing lane curve, we can draw the arrow head too if necessary.
    • for backward lane curve we can draw the backward arrow head on top.
  • when shift is pressed, both forward/backward connections are created or removed.

@kianzarrin kianzarrin added UI User interface updates LANE ROUTING Feature: Lane arrows / connectors labels Mar 25, 2022
@kianzarrin kianzarrin self-assigned this Mar 25, 2022
@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Mar 25, 2022

this is how it looks like. I can tweak the size

@kianzarrin
Copy link
Collaborator Author

image
this is also possible. Also I can make it triangle.
I can also easily play with angles.

@kianzarrin kianzarrin marked this pull request as draft March 25, 2022 19:24
@originalfoo
Copy link
Member

Could the arrowhead be solid triangle in same colour as the connector line?

@kianzarrin
Copy link
Collaborator Author

@aubergine10 , I can make them triangle but not solid triangle.
Also if it is the same color as the line then it will be harder to detect.

maxY: maxY,
alphaBlend: true,
renderLimits: underground);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aubergine10 you can play with this part of the code to see what you like most (Hot reload works):
DrawArrowHead() for > shape
DrawArrowHead2() for triangle shape
length : determines the size of the arms
size: determines the width of the arms (the thickness of the border lines cannot be controlled, increasing width increases the filled in area inside).

@kianzarrin kianzarrin marked this pull request as ready for review March 26, 2022 23:07
@kianzarrin kianzarrin changed the base branch from master to 1485-hollow-floating-wire March 26, 2022 23:08
@krzychu124
Copy link
Member

@aubergine10 , I can make them triangle but not solid triangle. Also if it is the same color as the line then it will be harder to detect.

Hmm, why not use solid triangle texture and render it rotated as quad? Check out NetTool.RenderRoadAccessArrow

@kianzarrin
Copy link
Collaborator Author

@krzychu124 As I said my code does has alternate to use quads. its just that its empty inside. I suspect CS quads are smaller and therefore the borders fill in the whole lane.
Since our lanes has sheath, using quad for us might get a big complicated.
I give it another try

@kianzarrin
Copy link
Collaborator Author

meanwhile that I am playing with shapes. it would be nice to review the rest of the code. it does not have to wait.

@krzychu124
Copy link
Member

meanwhile that I am playing with shapes. it would be nice to review the rest of the code. it does not have to wait.

The thing is you don't need to build the shape... Use texture decal and just rotate it to face correct direction similar to what you already done with arrows.

Base automatically changed from 1485-hollow-floating-wire to master March 27, 2022 23:45
@originalfoo
Copy link
Member

Does the triangle need to be so large (256x256) ?

@kianzarrin
Copy link
Collaborator Author

image

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Mar 28, 2022

complicated UI improvements will be tracked in: #1500
I don't want to make this PR too big.

Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kianzarrin kianzarrin merged commit 1ec6c60 into master Mar 28, 2022
@kianzarrin kianzarrin deleted the 1214-bidirectional-UI branch March 28, 2022 17:16
@originalfoo originalfoo added this to the 11.6.5.2 milestone Mar 28, 2022
@Elesbaan70 Elesbaan70 mentioned this pull request Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LANE ROUTING Feature: Lane arrows / connectors UI User interface updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bi-directional lane connection UI Hot reload of dev builds seems broken
3 participants