Dialogue System Menu Framework cursor problem

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Brijac
Posts: 18
Joined: Sat Apr 25, 2020 5:40 pm

Dialogue System Menu Framework cursor problem

Post by Brijac »

Hello, I recently added a Menu Framework from Dialogue System Extras and the cursor is always visible in-game. It should only be visible when I press pause, turn on inventory(Invector inventory system) and during conversations (this is fine because I checked the option "Show Cursor During Conversation" on Dialogue System Trigger component). Do you maybe know how to fix this?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Menu Framework cursor problem

Post by Tony Li »

Hi,

Inspect the Input Device Manager component, and untick Control Cursor State.

Configure the PausePanel's OnOpen() event to call the Input Device Manager's ForceCursor method (checkbox ticked).

Configure OnClose() to call ForceCursor (checkbox unticked).

Also configure the TitleMenuPanel's OnOpen() event to call ForceCursor (checkbox ticked) if you want to always show the cursor in the title menu scene.
Brijac
Posts: 18
Joined: Sat Apr 25, 2020 5:40 pm

Re: Dialogue System Menu Framework cursor problem

Post by Brijac »

All is working fine except Invector Inventory. The cursor is not visible when I open the inventory.

I tried doing this on the Item Manager component (Inventory):
https://i.gyazo.com/22aec5beaa0e943431c ... 70b9a9.png

But it's not working. I don't understand this "On Open Close", shouldn't there be one event for Open and one for Close?

I tried with only Active bool like this: https://i.gyazo.com/9b76835f48b29653075 ... dac761.png
But that shows cursor for a milisecond and then it disappears.

Do you maybe know how to fix this?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Menu Framework cursor problem

Post by Tony Li »

The Invector UI should take care of that. But if you just want to get it working, add a script like this to the inventory window's MainWindow GameObject:

ShowCursorOnEnable.cs

Code: Select all

using UnityEngine;
public class ShowCursorOnEnable : MonoBehaviour 
{
    void OnEnable()
    {
        Cursor.visible = true;
        Cursor.lockState = CursorLockMode.None;
    }
    void OnDisable()
    {
        Cursor.visible = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
}
Brijac
Posts: 18
Joined: Sat Apr 25, 2020 5:40 pm

Re: Dialogue System Menu Framework cursor problem

Post by Brijac »

Tony Li wrote: Wed May 06, 2020 8:22 am The Invector UI should take care of that. But if you just want to get it working, add a script like this to the inventory window's MainWindow GameObject:

ShowCursorOnEnable.cs

Code: Select all

using UnityEngine;
public class ShowCursorOnEnable : MonoBehaviour 
{
    void OnEnable()
    {
        Cursor.visible = true;
        Cursor.lockState = CursorLockMode.None;
    }
    void OnDisable()
    {
        Cursor.visible = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
}
You're right. I asked the Invector crew and they said I needed to add some events on Item Manager and it worked.

Thanks for you effort anyway because your script also worked.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System Menu Framework cursor problem

Post by Tony Li »

Happy to help!
Post Reply