Page 1 of 2

Two Panel Quest Log Window with Text Mesh Pro

Posted: Mon Jul 09, 2018 9:49 pm
by nathanj
Hi Again,

Is there a two panel Quest Log Window that uses Text Mesh Pro?

Nathan

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Mon Jul 09, 2018 11:19 pm
by Tony Li
Hi Nathan,

There isn't a prefab. But you can take any of the Standard UI Quest Log Window prefabs that use Unity UI, replace the UI Texts with TextMeshProUGUIs, and assign them to the Standard UI Quest Log Window's fields.

The Standard UI system lets you assign UI Text or TextMeshProUGUI to any UI text field. To make the TMP version of the field available, unassign the UI Text from the field. After you do this, the field will have two slots, one for UI Text and a second for TMP. When you assign a TextMeshProGUI, the slot for UI Text will disappear.

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Mon Jul 09, 2018 11:26 pm
by nathanj
Wow, that is awesome.

I knew you had integrated TMP but I didn't understand how it worked.

Thank you!

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Tue Jul 10, 2018 6:41 pm
by nathanj
Hey again, Tony

If I wanted the Buttons in the Quest Log window to respond to Select() rather than OnClick(), any idea on how would I go about making this change?

Thanks again,
Nathan

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Tue Jul 10, 2018 7:25 pm
by Tony Li
Hi Nathan,

I can add that as an option in the next version. Otherwise it will require making a subclass of StandardUIQuestLogWindow and overriding the OnQuestListUpdated() method to change this (in 2 places):

Code: Select all

questTitle.button.onClick.AddListener(() => { OnClickQuest(target); });
to something like this (depending on how you want it to work):

Code: Select all

var trigger = questTitle.button.GetComponent<UnityEngine.EventSystems.EventTrigger>();
var entry = new UnityEngine.EventSystems.EventTrigger.Entry();
entry.eventID = UnityEngine.EventSystems.EventTriggerType.Select;
entry.callback.AddListener((eventData) => { OnClickQuest(target); });
trigger.triggers.Add(entry);
And you'd also need to add an EventTrigger component to the template button.

Can you describe exactly what you want this to do? If you hover the mouse over a quest button the Quest Selection Panel (typically on the left), do you want it to automatically show the quest details in the Quest Details Panel (typically on the right)? Similarly, as you navigate the quest buttons using a joystick, it would automatically show the details.

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Tue Jul 10, 2018 7:33 pm
by nathanj
Thanks, Tony

Yes, I'm converting the UI to be Xbox controller friendly. As you describe, I would like it that when the button is selected it opens the description of the button in the other panel.

Nathan

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Tue Jul 10, 2018 7:41 pm
by Tony Li
Okay, that sounds like a handy option. I'll add that in the next version.

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Fri Jul 13, 2018 2:05 am
by nathanj
Hey Tony

Does the Quest TRacker HUD need to be a child of the Dialogue System Controller? I'm testing out some stuff with VR and it only seems to appear when it's a child of the DSC. Is there any way around this?


Thanks again,
Nathan

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Fri Jul 13, 2018 8:59 am
by Tony Li
Hi Nathan,

The Quest Tracker HUD must be a child of the Dialogue Manager, but in retrospect that's a silly requirement. I'll make a patch available to fix that.

Re: Two Panel Quest Log Window with Text Mesh Pro

Posted: Fri Jul 13, 2018 11:25 am
by Tony Li
Nathan,

The patch is available on the Pixel Crushers customer download site. You don't need to do anything except import it, and then standard UI quest trackers will work outside of the Dialogue Manager GameObject hierarchy.