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

Anchor build menu buttons to the top #1421

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Conversation

Sjerty
Copy link
Contributor

@Sjerty Sjerty commented Feb 1, 2024

Summary

Anchor the "Tile search and build" controls to the top of the construction menu

PR checklist

  • The game builds properly without errors.
  • No unrelated changes are present.
  • No "trash" files are committed.

Pictures/Videos

https://youtu.be/n5ZbLStwEW4

Testing

Start the game and play with the construction menu

Networking checklist

  • Works from host in host mode.
  • Works from server in server mode.
  • Works on server in client mode.
  • Works and is syncronized across different clients.

Changes

Moved TileSearchAndBuild menu next under the MainPanel instead of ScrollView, set it's anchor to the top-stretch just as Save/Load buttons, removed it's "Layout element" component, also changed all paddings to 5, adjusted sizes of AssetPanel (parent of ScrollView).

There was a problem however, just moving TileSearchAndBuild in the hierarchy and anchor it, didn't work properly, position of the element just jumped to the bottom of construction menu, to prevent that I created another object (Image), added all TileSearchAndBuild settings to it and set it in place, and everything started to work properly.
But I don't quite understand why this didn't work with just moving it in hierarchy, maybe some parenting problem?

Related issues/PRs

Closes #1402
Closes #1401

@Sjerty Sjerty changed the title Anchor build menu buttons at the top Anchor build menu buttons to the top Feb 1, 2024
@cosmiccoincidence
Copy link
Member

Also if there's a need I can amend this commit with #1401, I just dunno if I should do diff issues in one PR.

Yes, you can do multiple issues in one PR if they are small issues and similar to each other.

Copy link
Contributor

@stilnat stilnat left a comment

Choose a reason for hiding this comment

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

One issue is that save and load tabs are affected, ideally, it should not display this darker gray area

image

* add "Vertical Layout Group" to the MainPanel
* add "Layout Element" to the: BuildMenu, Panel
* remove TileSearchAndBuild's "Vertical Layout Group" paddings
@Sjerty
Copy link
Contributor Author

Sjerty commented Feb 2, 2024

Made some changes, now there's not so much empty space between Scroll View and Save/Load buttons, but I don't really know if my solution is good enough, bc now menu feels kinda... stretchy?? Not horrible, but still.
I'll just link a video to show how it looks:
https://www.youtube.com/watch?v=wFVEvI748Aw

@Sjerty
Copy link
Contributor Author

Sjerty commented Feb 2, 2024

About #1401, there was already code for the change of color, but id didn't work properly
Also changed "Color" to "Color32", bc after some googling I found out that it works better with HEX (in my case it's one of the two solutions), and regular "Color" works better with values in range of 0-1.

So "Color" just didn't work properly, the color didn't apply to the "Build" button and magenta used in code as 0xA900FF, actually darker than the one right now in the game.
But "Color" will work if you describe it with 0-1 float values such as our blue 0x3132DD = Color(49/255f, 50/255f, 221/255f, 1), so If you want I can change values to that.

@stilnat
Copy link
Contributor

stilnat commented Feb 2, 2024

@Sjerty whatever works regarding colors, we don't really have a unified way of dealing with them yet. Your menu looks nice, better than before for sure, I'll take a look at the prefab changes this weekend, github sucks for that.

@stilnat
Copy link
Contributor

stilnat commented Feb 2, 2024

So I noticed other issues :

  • The blue color is too dark and very difficult to read, maybe try a lighter blue, it's fine if it's not exactly the same as the one from the hologram, it should just be similar.
    image

  • (maybe not related to this PR) The "load content" game object stays active despite switching between tabs, it should not. It doesn't impact the current display of the menu but might in the future when changes are done on this tab. Need to check if that happen on develop as well.
    image

@Sjerty
Copy link
Contributor Author

Sjerty commented Feb 2, 2024

@stilnat

  • Ohhh, no unified approach with colors make it easier xd, I just thought that there's some kind of palette for this, so for that I'll use regular Color, bc Color32 is darker than regular. And I'll shift the colors a bit, so they wouldn't be too bright
    How this ones looks for you?
    BuildMenuButtonColors

  • Checked the develop branch and "Load Content" game object stay active in there too, I can try and look into this problem and commit into this PR C:

Changed Colors to float values and shifted them a bit
Added Activating/Disabling the root of the LoadTab
Copy link
Contributor

@stilnat stilnat left a comment

Choose a reason for hiding this comment

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

all good, better looking menu.

@stilnat stilnat merged commit adcab19 into RE-SS3D:develop Feb 2, 2024
2 checks passed
@Sjerty Sjerty deleted the feature/1402 branch February 2, 2024 13:55
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.

Anchor build menu buttons at top Change build text to blue
3 participants