VRCMods icon indicating copy to clipboard operation
VRCMods copied to clipboard

[UIX] Adding Sliders in QM UI

Open axel-angel opened this issue 2 years ago • 3 comments

Hello and thanks for vrcmods! I'm looking for improved ways to let users change some numeric settings: for example sliders / gauge would be great. Is there such a thing currently supported? If not I can give a hand adding those, as I'm working on some mods myself (extending CameraMinus). I need some pointers, how would you get started on this? Any inspiration in the code? So far I saw there are just buttons and free text.

Thanks in advance!

axel-angel avatar Sep 28 '21 17:09 axel-angel

I'm digging into the code and found prefabs for the UI elements, and they're in https://github.com/knah/VRCMods/blob/master/UIExpansionKit/modui.assetbundle but the format is closed source and it's not trivial to extract the prefabs. Are there the sources somewhere? Would it be possibe to add them in the repo please?

Sorry if I missed something. Thank you

axel-angel avatar Sep 29 '21 13:09 axel-angel

Yes, currently there is no slider-based components for settings (in part because I personally dislike sliders, especially in VR, where your shaky hands/bad tracking make setting precise values impossible).

Regarding the assetbundle - it's a Unity assetbundle, obviously. Publishing Unity prefabs for those is possible, but mildly non-trivial. I might get around to doing that sometime though.

knah avatar Sep 29 '21 18:09 knah

Been a while and I've used the sliders for a while and they work OK, they are pros and cons. I think they're pretty useful / usable for desktop. As in VR, we noticed that all sliders (all the official ones in VRC) have "sync" issues with head movements. vrcmods_sliders

That said I think sliders are useful and not hard to add or extend (I have ideas to add more such widgets btw: like drop down / 2D sliders, multi select / checkboxes). I'm willing to make a PR for those sliders if you think it's worth it. In my implementation I refactored a bit the "ButtonFactory" and added equivalent of ButtonRegistration for sliders (since they're not buttons hum). I also considered making one new LabelRegistration for labels as they are not buttons. It would also allow the community to add new widgets the road, which would be cool!

Also I refactored a bit the asset bundle loader (minor code change) to load mine, since I couldn't just add my widgets in your asset bundles. What would be the procedure for the PR: merge the bundles somehow? I can provide my prefab. Or keep separated?

Thanks for the work! and sorry for the issue staying dormant for so long :yum: Hope it helps

axel-angel avatar Dec 19 '21 19:12 axel-angel