Using a Gamepad with FeatureDemo Menu

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
kilfeather94
Posts: 17
Joined: Sat Jan 23, 2016 1:35 pm

Using a Gamepad with FeatureDemo Menu

Post by kilfeather94 »

Hi,

I'm just having a little trouble getting a gamepad to work with the main pause menu from the FeatureDemo pictured here:

http://imgur.com/Tp7wKH5

I have the 'Enabled' checkbox ticked in the response panel for the Sci-fi dialogue UI, and that works fine, but for the Feature Demo main menu, I can't seem to find it at all in the hierarchy.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by Tony Li »

Hi,

The FeatureDemo.cs script uses plain old legacy Unity GUI and doesn't support gamepad navigation. It's only meant to drive the example scenes included with the Dialogue System. You could recreate a similar menu using the Dialogue System's legacy Unity GUI control system, or make it in Unity UI, or even better (in my opinion) use the Dialogue System Menu Template available on the Dialogue System Extras page. It's the first download button under the EXTRAS category. The Menu Template was designed for real projects. It provides a main menu and in-game pause menu that offer slot-based saved games and an options panel.
kilfeather94
Posts: 17
Joined: Sat Jan 23, 2016 1:35 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by kilfeather94 »

Thanks :) Got the Menu working, using Unity UI. Just after noticing an issue though, with the Sci-fi Unity GUI Quest Log Window. I made sure that the 'Enabled' checkbox was ticked in the 'Window' parent, but the gamepad won't work at all. http://imgur.com/t9fMSuh This is how I have it set up.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by Tony Li »

Hi,

I'll check this out and get back to you with any tips.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by Tony Li »

Hi,

Sorry, this is an obscure detail that hasn't got much attention since most users have moved to Unity UI and that's where most of the focus has been.

The short answer is to download this version of the quest log window prefab: SciFi_UnityGUI_QuestLogWindow_Navigable_2016-03-23.unitypackage

The long answer (and unfortunately tucked away deep in the manual) is that controls that are directly under a GUIWindow aren't navigable. It's a quirk related to the way the Dialogue System works with Unity's legacy GUI.Window() method. The solution is to move the UI controls under any other type of GUI control. In the screenshot below (and in the prefab linked above), I simply created a GUIControl named "Panel" and moved the other UI controls under it. Then I set up the panel for navigation:

Image
kilfeather94
Posts: 17
Joined: Sat Jan 23, 2016 1:35 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by kilfeather94 »

Hi,

The gamepad now works with the new Quest Log window, but I can only get it to work with the 'Active', 'Completed' and 'Close' buttons. I can't seem to get it to work properly with the quests underneath these buttons though. I added 'Scroll View' to the 'Order' of the buttons, but when I navigate to the quests, I can only highlight one of them with the gamepad
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by Tony Li »

That, I'm afraid, is a tougher nut to crack. Legacy Unity GUI doesn't have native gamepad/keyboard navigation. To use the Dialogue System's legacy navigation, you'll need to add the quest buttons themselves to the Order list. However, these buttons are added dynamically at runtime. This means you'll need to do a little scripting to create a subclass of UnityGUIQuestLogWindow and override the OnQuestListUpdated() method. If you want to pursue this, let me know and I'll provide some guidance.

If you don't want to bother with that, I recommend using the Unity UI version. Unity had the foresight to build gamepad navigation into Unity UI, so it all comes automatically. On your Unity UI quest log window, just tick Auto Focus to enable navigation.
kilfeather94
Posts: 17
Joined: Sat Jan 23, 2016 1:35 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by kilfeather94 »

Went with the Unity UI version and did some tinkering with it and got it working the way I need it. If I come across any other issues, I'll let you know. Thanks for the help :)
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a Gamepad with FeatureDemo Menu

Post by Tony Li »

Glad to help, and good choice! Unity UI is the way to go.
Post Reply