Page 1 of 1

UCC + Dialogue System + main menu framework issue.

Posted: Thu Jun 20, 2019 11:20 am
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?

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

Posted: Thu Jun 20, 2019 1:09 pm
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.

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

Posted: Thu Jun 20, 2019 3:27 pm
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.

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

Posted: Thu Jun 20, 2019 3:31 pm
by Tony Li
I'm pretty sure a UCC script does this in LateUpdate(). I'll check when I'm back in the office.

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

Posted: Thu Jun 20, 2019 9:37 pm
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.

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

Posted: Sat Jun 22, 2019 12:52 pm
by AlexB
Thanx!
Works just great!

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

Posted: Sat Jun 22, 2019 2:04 pm
by Tony Li
Awesome! Glad to help.