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

Connections between patches and regions should be shown #5786

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

Conversation

Patryk26g
Copy link
Contributor

@Patryk26g Patryk26g commented Jan 1, 2025

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.
image
image
Screenshot_20250101_131756

PS. Happy new year!!!

Related Issues

Closes #3556

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    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)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    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.

@revolutionary-bot
Copy link

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.

@hhyyrylainen hhyyrylainen added this to the Release 0.8.1 milestone Jan 8, 2025
@hhyyrylainen hhyyrylainen requested review from a team January 8, 2025 12:37
@@ -533,6 +533,7 @@ private static void BuildRegionSize(PatchRegion region)
{
region.Width += offset;
region.Height += offset;
region.Columns = region.Rows = 1;
Copy link
Member

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,
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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).

@CountingBeeps
Copy link
Contributor

This is a great start, but I don't always like how these look. I think the visuals could use a little work before this is merged. Specifically in this case:
image

@hhyyrylainen
Copy link
Member

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:

  • The columns and rows variables which will break save compatibility
  • Use of zindex in the line rendering on the map

Ones those are taken care of I think this will be close to done already. (though I just saw @CountingBeeps comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Patches that link map regions together should be more obvious
4 participants