UCC + Dialogue System + main menu framework issue.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AlexB
Posts: 5
Joined: Sun Dec 02, 2018 6:30 am

UCC + Dialogue System + main menu framework issue.

Post by AlexB »

Hi, Tony!
I've got some small problem with combining these all together.
Everything actually works nicely except for one thing.
When I open menu (pressing "Esc") and open for example "Options" (mouse click) and then press "Esc" (want to close "options" window) - "options" window is closing but the mouse pointer is hiding. When I press "Esc" again to close menu - menu window is closing but the mouse pointer now appears.

If I close "options" window by clicking "Back" button - everything is ok.

Do you know what could cause this?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: UCC + Dialogue System + main menu framework issue.

Post by Tony Li »

Hi,

I'm out of the office so I can't double check this, but try inspecting the player's Unity Input component. Untick the option to show the cursor when pressing Escape. Also note that the Unity editor always shows the cursor when you press Escape, unlike builds.
AlexB
Posts: 5
Joined: Sun Dec 02, 2018 6:30 am

Re: UCC + Dialogue System + main menu framework issue.

Post by AlexB »

It's not urgent ;)

"Enable cursor with Escape" is unticked.
And yes, it's about built version.

In Dialogue Manager in Input Device Manager component I changed from default:
Input device to keyboard;
Detect Mouse Control - unticked;
Cotrol Cursor State - unticked.
(But it worked that way with default settings).

It actually looks like some script disables and enables cursor on each "Escape" press.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: UCC + Dialogue System + main menu framework issue.

Post by Tony Li »

I'm pretty sure a UCC script does this in LateUpdate(). I'll check when I'm back in the office.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: UCC + Dialogue System + main menu framework issue.

Post by Tony Li »

You're going to need UCCMenuUtility, which is included in the Save System for Opsive asset. I'll include it in the next update to the Dialogue System integration, too. It's a very short script. Here's a minimal version:
Minimal UCCMenuUtility.cs

Code: Select all

using Opsive.UltimateCharacterController.Events;
using UnityEngine;
public class UCCMenuUtility : MonoBehaviour
{
    public void OnOpenMenu()
    {
        EventHandler.ExecuteEvent(character, "OnEnableGameplayInput", false);
        Cursor.visible = true;
        Cursor.lockState = CursorLockMode.None;
    }

    public void OnCloseMenu()
    {
        EventHandler.ExecuteEvent(character, "OnEnableGameplayInput", true);
        Cursor.visible = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
}
If you already have something similar, you can use it instead.

DS_UCCMenuUtility_2019-06-20.unitypackage

Add UCCMenuUtility to the MenuSystem. Then configure the PausePanel like this:

Image

Remember to untick the Unity Input component's Enable Cursor With Escape, too.
AlexB
Posts: 5
Joined: Sun Dec 02, 2018 6:30 am

Re: UCC + Dialogue System + main menu framework issue.

Post by AlexB »

Thanx!
Works just great!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: UCC + Dialogue System + main menu framework issue.

Post by Tony Li »

Awesome! Glad to help.
Post Reply