-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
Connections between patches and regions should be shown #5786
base: master
Are you sure you want to change the base?
Connections between patches and regions should be shown #5786
Conversation
The lead programmer for Thrive is currently on vacation until 2025-01-07. Until then other programmers will try to make pull request reviews, but please be patient if your PR is not getting reviewed. PRs may be merged after multiple programmers have approved the changes (especially making sure to ensure style guide conformance and gameplay testing are good). If there are no active experienced programmers who can perform merges, PRs may need to wait until the lead programmer is back to be merged. |
@@ -533,6 +533,7 @@ private static void BuildRegionSize(PatchRegion region) | |||
{ | |||
region.Width += offset; | |||
region.Height += offset; | |||
region.Columns = region.Rows = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the columns and rows actually need to be stored like this? I get the impression that before the region patch positions was implicitly known based on the size, couldn't the same thing be done still (i.e. don't add the rows and columns variables but calculate them from the width and height of the region)?
Width = width, | ||
BeginCapMode = Line2D.LineCapMode.Round, | ||
EndCapMode = Line2D.LineCapMode.Round, | ||
ZIndex = zIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZIndex can mess with other layers than purely just this. For example even the pause menu might not work correctly. So I'd really prefer an approach where ZIndex is not used. Reordering the children in the line container can be used to set the draw order. If just a couple of ZIndex values are needed, they could be made as separate containers for the lines. Or what is it needed for? I can probably come up with some better suggestions if I know that.
if (adjacent.Visibility == MapElementVisibility.Hidden || | ||
(adjacent.Visibility == MapElementVisibility.Unknown && | ||
regionVisibility == MapElementVisibility.Unknown)) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiline if statements should always use braces according to the styleguide.
{ | ||
var startCenter = RegionCenter(start); | ||
var startRect = new Rect2(start.ScreenCoordinates, start.Size); | ||
var endCenter = RegionCenter(end); | ||
var endRect = new Rect2(end.ScreenCoordinates, end.Size); | ||
int priority; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables should be defined as close to where they are initialized as possible (so not all at the start of a method like ancient C styles mandated).
I did a partial review of this PR. I left a big chunk of the code unreviewed but it was probably mostly just the path algorithm changes that caused the internal API to change, which looks long but isn't actually that complicated of a change... This is already in pretty good shape I think overall design wise. Anyway I'd like to first get the biggest issues out of the way before reviewing everything in here:
Ones those are taken care of I think this will be close to done already. (though I just saw @CountingBeeps comment) |
Brief Description of What This PR Does
This PR adds connections between the patches and regions sides. I increased the margin between the patches and also changed the color of the connections to gray (subject to change, maybe they also should be a little bit transparent?) because otherwise it would get a little bit to crowded with all of the connections.
PS. Happy new year!!!
Related Issues
Closes #3556
Progress Checklist
Note: before starting this checklist the PR should be marked as non-draft.
break existing features:
https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
(this is important as to not waste the time of Thrive team
members reviewing this PR)
styleguide.
Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.