RE-SS3D / SS3D

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

Add simple Game Settings #1281 #1431

Closed Sjerty closed 6 months ago

Sjerty commented 7 months ago

Summary

Added two game settings under "User Interface" category, toogle stamina bar and network traffic info and made prefabs for toogle, slider and dropbox, for easier adding of new items;

PR checklist

Pictures/Videos

Made some changes, so the videos are not very accurate Settings working: https://youtu.be/feD-uWeeV9Y Adding new categories: https://youtu.be/aBjCcgqHVzc

Testing

Host a game, and try changing settings under "User Interface" category. Also you can use new prefabs to try and create new category, just drop down category prefab under "Content" and add some interactive element prefabs

Changes

Added Holder under "Game Settings" object, added a Scroll View, in it's content added new category prefab "User Interface", it's consist of "Header" object containing label , and "Settings" which contains different settings made of prefabs, two active toogles, and two inactive examples - slider and dropdown.

Unfortunatly prefabs are configured the way so they'll work as intendent only in this Game Settings window :C And because of elasticity, you will be able to scroll even without scrollbar, I think this could be fixed if we create a wrapper for RectTransform, and handle toogling "Vertical" checkbox, when scrollBar is inactive.

Also didn't add saving of this game settings, as it wasn't stated in the Issue

Related issues/PRs

1281

Closes #1281

Sjerty commented 7 months ago

Rebased changes onto develop

joaoburatto commented 7 months ago

I'd invert the dependency, instead of a class having a reference for each UI that has to be disabled and create a method for each UI that needs to be disabled, I would make the UI that registers itself to a class that displays the toggles. Not hardcoding everything

joaoburatto commented 7 months ago

For example, the BandwidthDisplay class registers itself in a GlobalUIVisiblityController, by calling something like GlobalUIVisiblityController.RegisterToggle() and by passing the BandwidthDisplay object.

Sjerty commented 7 months ago

Thank you for comments! I'll try to redo the settings by your notes

Sjerty commented 6 months ago

Tried to make some changes, based on my understandings, hope I'm moving in a right direction! Also suggestions on how to improve it are always appreciated C: