Preferences screen once more
I thought that the preferences screen is all done, but then I noticed there are still some things missing, like confirmation dialog on "Quit" button, audio preview when changing speech/sfx volume and more.
When I was proofreading the previous entry I noticed the typo in bootstrapping class, it was named as BootsrapManager (missing "t") so I've renamed it to BootstrapManager. Well, it is funny that I didn't find it earlier, but with autocomplete in IDE you don't check typos.
The next thing I was working on was message dialog. But as first, the support for 9-slice sprite was needed. Therefore, new import type was defined in StciImporter which will take the sprites from the .sti file and create the one 9-sliced sprite from it (it is actually 8-slice sprite, as the "content" is transparent, because each dialog could have its own background image).
Message dialogs are implemented using solo canvas, with stacking dialog supported. Each dialog prefab contains the "blocker" part (so no UI beneath it could be interacted with) and the actual dialog. There is an DialogManager which is responsible for the dialog creation and destruction and then a MessageDialogComponent, which does handle the dialog interactions. For now only "OK", "YES"and "NO" buttons are supported.
![]() |
Quit dialog message |
Another thing thas was rewritten was that game settings option numeric values are now stored in the "natural" range and not in <0,1>. Also, default value is in <min,max> range now. The conversion to <0,1> range happens only when needed, mostly for the UI elements.
There was another change regarding the options and that is option groups. This is used for situation, when at least 1 of the 2 option must be selected (like "Speech" or "Subtitles" should be on). This is defined in AssetGameSettingsData class, where multiple option groups could be defined. Then, in preferences screen, the check is done and if situation like the above happens, message dialog is shown.
![]() |
| Option groups in action |
Then the "quit" dialog command was implemented, with showing the message dialog and quitting back to the main menu, if confirmed.
The last thing that has been done is audio preview when changing the sfx/speech sliders. The actual preview is done in ViewModel, using newly created AudioPreviewService. And also, when the option in the list view is checked, audio effect is played for the check/uncheck event. At first, I was using Toggle's event changed but that was problematic, because this event fires in various places, not only when the user clicks the Toggle. Therefor new event was added in Toggle4State class, which is raised ONLY on "external" clicks (For more info see https://github.com/VPDPersonal/Aspid.MVVM/discussions/275).
There was again, as always, various bug fixes, like hard-coded enum values for AssetType enum, fix of toggle rendering in options list, button disable state rendering and more.


Comments