Page 1 of 1

Dialogue System Menu Framework cursor problem

Posted: Tue May 05, 2020 5:27 pm
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?

Re: Dialogue System Menu Framework cursor problem

Posted: Tue May 05, 2020 6:36 pm
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.

Re: Dialogue System Menu Framework cursor problem

Posted: Wed May 06, 2020 6:11 am
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?

Re: Dialogue System Menu Framework cursor problem

Posted: Wed May 06, 2020 8:22 am
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;
    }
}

Re: Dialogue System Menu Framework cursor problem

Posted: Thu May 07, 2020 10:43 am
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.

Re: Dialogue System Menu Framework cursor problem

Posted: Thu May 07, 2020 10:51 am
by Tony Li
Happy to help!