Page 1 of 2
Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 1:42 pm
by EatAllTheGames
Trying out the menu system, looking good. The fullscreen toggle doesn't behave for me on Widnows 64bit, you need to toggle the full screen and then change the resolution for it to make a difference.
My temp fix:
Code: Select all
public void SetFullScreen(bool on)
{
Screen.fullScreen = on;
PlayerPrefs.SetInt(fullScreenPrefsKey, on ? 1 : 0);
SetResolutionIndex(GetResolutionIndex()); // This line is the fix
}
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 2:08 pm
by Tony Li
I'll update the menu framework. It's a constant game of catch-up as Unity tweaks their API with each version. I'll add a conditional to also set Screen.fullScreenMode in newer versions of Unity.
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 2:28 pm
by EatAllTheGames
Great stuff. In the meantime, I'm guessing you can't navigate unity dropdowns with a controller (resolution/quality box)?
EDIT: Nevermind, it seems to be the navigation paired with the default colours
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 2:52 pm
by EatAllTheGames
Tony Li wrote: ↑Mon Jul 30, 2018 2:08 pm
I'll update the menu framework. It's a constant game of catch-up as Unity tweaks their API with each version. I'll add a conditional to also set Screen.fullScreenMode in newer versions of Unity.
One part of the options menu that can't be navigated properly with the controller is the resolutions dropdown, at least not for me, the scrollbar doesn't follow the selected item. Previously I've been able to solve this with the UIScrollToSelection script, but not in this case!
Also the Focus Check Frequency of the options steals focus from the dropdown menu
EDIT: Adding UIPanel to the ScrollRect appears to fix the focus issue
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 4:35 pm
by Tony Li
I'll check this out and add it to the prefab. That sounds like an oversight on my part.
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 5:32 pm
by EatAllTheGames
Tony Li wrote: ↑Mon Jul 30, 2018 4:35 pm
I'll check this out and add it to the prefab. That sounds like an oversight on my part.
That's great news - I've just spent the last few hours trying and failing to get it working (navigating the scrollbar with controller).
Re: Extras: Menu System Full Screen Toggle
Posted: Mon Jul 30, 2018 10:24 pm
by Tony Li
UIScrollToSelection has trouble with dropdowns. I added a small script "ScrollToMe" to the resolution template item. It's in the latest menu framework on the Extras page, dated 2018-07-30. In the Menu System prefab, I also tidied up some explicit navigation so everything navigates vertically in the right order.
Re: Extras: Menu System Full Screen Toggle
Posted: Tue Jul 31, 2018 4:24 am
by EatAllTheGames
Tony Li wrote: ↑Mon Jul 30, 2018 10:24 pm
UIScrollToSelection has trouble with dropdowns. I added a small script "ScrollToMe" to the resolution template item. It's in the latest menu framework on the Extras page, dated 2018-07-30. In the Menu System prefab, I also tidied up some explicit navigation so everything navigates vertically in the right order.
The scrolling works great now, there's just two remaining issues with the gamepad navigation which may be easy to fix but I can't figure out:
[*] If you navigate entirely with the gamepad, e.g. go to options, change resolutions, it will jump back to selecting the Back button. However, if you focus on a button using the mouse (long click, drag out of button so it doesn't click it) and then use the gamepad to select resolution, it keeps the resolution dropdown as the currently selected item.
[*] If you actually change the resolution (in a build, not in editor), no items will be selected so it's impossible to continue with the gamepad.
I will keep working at it in case I can figure it out, but if you know of a quick solution please let me know
Re: Extras: Menu System Full Screen Toggle
Posted: Tue Jul 31, 2018 10:50 am
by Tony Li
I believe this update resolves those issues:
DialogueSystem_MenuFramework_2018-07-31rc1.unitypackage
My initial tests work, but I'm going to put it through more tests before publishing it.
It required some extra code to make dropdowns regain focus, and I also made these changes to the UIPanels on the dropdowns' Templates:
- Focus Check Frequency: 0
- Refresh Selectables Frequency: 0
- Select Previous On Disable: unticked
This is because dropdowns handle focus a little differently.
Re: Extras: Menu System Full Screen Toggle
Posted: Tue Jul 31, 2018 11:14 am
by EatAllTheGames
Tony Li wrote: ↑Tue Jul 31, 2018 10:50 am
I believe this update resolves those issues:
DialogueSystem_MenuFramework_2018-07-31rc1.unitypackage
My initial tests work, but I'm going to put it through more tests before publishing it.
It required some extra code to make dropdowns regain focus, and I also made these changes to the UIPanels on the dropdowns' Templates:
- Focus Check Frequency: 0
- Refresh Selectables Frequency: 0
- Select Previous On Disable: unticked
This is because dropdowns handle focus a little differently.
Excellent, thank you. I'll work now to merge these with my changes, as I've spent some time messing about to get it working... will report any issues!