SS3D
SS3D copied to clipboard
Add simple Game Settings #1281
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
- [ ] The game builds properly without errors.
- [ ] No unrelated changes are present.
- [ ] No "trash" files are committed.
Pictures/Videos
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
Rebased changes onto develop
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
For example, the BandwidthDisplay class registers itself in a GlobalUIVisiblityController, by calling something like GlobalUIVisiblityController.RegisterToggle() and by passing the BandwidthDisplay object.
Thank you for comments! I'll try to redo the settings by your notes
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: