Page 1 of 1

Quest Journal UI

Posted: Sat Oct 13, 2018 2:58 pm
by GorkaGames
Hi,

I'd like to make the following changes on the UI behaboiur for the Quest Journal UI. I've tried following the buttons and scripts but it's not really very clear to me how to do it (preferably without changing your code):

- Groups (Currently I'm using Main and Side) opened (And all the quests under the groups) listed (instead of pressing the group buttons) right when you open the journal.

-Showing the detail information on the right panel on button hover instead on On click. It looks very obvious to do it but as the action it´s not on the UI button I don't know wich one to use it.

- Is it possible to always show the Quest Icon (the one you fill on the very beginning of the quest) on the Journal, instead of having to add it on every state of the Quest / node? Thanks

Re: Quest Journal UI

Posted: Sun Oct 14, 2018 11:18 am
by Tony Li
Hi,
GorkaGames wrote: Sat Oct 13, 2018 2:58 pm- Groups (Currently I'm using Main and Side) opened (And all the quests under the groups) listed (instead of pressing the group buttons) right when you open the journal.
Make a subclass of UnityUIQuestJournalUI. Override the IsGroupExpanded function:

Code: Select all

public class MyQuestJournalUI : UnityUIQuestJournalUI 
{
    public override bool IsGroupExpanded(string groupName)
    {
        return true; // All groups are always expanded.
    }
}
Inspect your quest journal UI. Click the three-bar menu in the upper right of the Inspector, and select Debug. Drag your subclass script into the quest journal UI's Script field. This will tell your quest journal UI to use it instead of UnityUIQuestJournalUI, but it will still keep all of your UI element assignments.

Image
GorkaGames wrote: Sat Oct 13, 2018 2:58 pm-Showing the detail information on the right panel on button hover instead on On click. It looks very obvious to do it but as the action it´s not on the UI button I don't know wich one to use it.
Add a small script to the Active Quest Name Template button:

Code: Select all

using UnityEngine;
public class ClickButton : MonoBehaviour 
{
    public void ClickNow()
    {
        GetComponent<UnityEngine.UI.Button>().onClick.Invoke();
    }
}
Also add an Event Trigger component. Configure the Pointer Enter event to call ClickButton.ClickNow:

Image

GorkaGames wrote: Sat Oct 13, 2018 2:58 pm- Is it possible to always show the Quest Icon (the one you fill on the very beginning of the quest) on the Journal, instead of having to add it on every state of the Quest / node?
That's a good idea. I'll add it to the next version. In the meantime, you can make a subclass of UnityUIQuestNameButtonTemplate. Add a variable for a UI Image. Override the Assign() method to set the image:

Code: Select all

public class MyQuestNameButtonTemplate : UnityUIQuestNameButtonTemplate
{
    public UnityEngine.UI.Image icon;
    public override void Assign(Quest quest, ToggleChangedDelegate trackToggleDelegate)
    {
        base.Assign(quest, trackToggleDelegate);
        icon.sprite = quest.icon;
    }
}

Replace the UnityUIQuestNameButtonTemplate script on the Active Quest Name Template and Completed Quest Name Template GameObjects.