RE-SS3D / SS3D

Space Station 3D, another remake of SS13, but with an extra D.
https://ss3d.space/
255 stars 140 forks source link

Anchor build menu buttons to the top #1421

Closed Sjerty closed 8 months ago

Sjerty commented 8 months ago

Summary

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

PR checklist

Pictures/Videos

https://youtu.be/n5ZbLStwEW4

Testing

Start the game and play with the construction menu

Networking checklist

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

cosmiccoincidence commented 8 months ago

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.

Sjerty commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

So I noticed other issues :

Sjerty commented 8 months ago

@stilnat