Page 1 of 1

Quest Log UI - first quest button not selected

Posted: Thu Oct 26, 2023 1:29 pm
by walczak
I am able to display all quesst in groups as active and completed. I have the option to Select First quest on onen selected, however the first quest button is not focused, making the controller usage impossible. How can I select first button as well as first quest on Open()? Thanks!

Re: Quest Log UI - first quest button not selected

Posted: Thu Oct 26, 2023 2:17 pm
by Tony Li
Hi,

Select First Quest On Open shows the details of the first quest as if the player had clicked on the first quest button.

To ensure that the quest button itself is focused (selected), inspect the Dialogue Manager GameObject's Input Device Manager component, and tick Always Auto Focus.

Re: Quest Log UI - first quest button not selected

Posted: Fri Oct 27, 2023 8:17 am
by walczak
Hello. Thanks for the reply. I did all check all the steps and I have everything like you recomended and it still isn't working. I checked and for some reason the selecte button is the Active Questst switcher button and when I disabled it it was the Group toggle button. I am using new Input system if this matters.

Re: Quest Log UI - first quest button not selected

Posted: Fri Oct 27, 2023 9:36 am
by Tony Li
Hi,

I think we just have a small miscommunication. The "Select First Quest On Open" checkbox will show the details of the first quest when the quest log window opens. It does nothing with the EventSystem.

If you want the EventSystem to select (focus) the first quest in the list, here are two ways:

1. Make and use a subclass of StandardUIQuestLogWindow. Override the OpenWindow() method. At the end the method, select the first button:

Code: Select all

public override void OpenWindow(System.Action openedWindowHandler)
    base.OpenWindow(openedWindowHandler);
    foreach (var content in selectionPanelContentManager.instancedContent)
    {
        if (content is StandardUIQuestTitleButtonTemplate buttonContent)
        {
            UITools.Select(buttonContent.button);
            break;
        }
    }
}
2. Or use the OnOpen() UnityEvent to do the same. It will still require some code, but you can assign your own script component instead of making a subclass.