Integrating journal into Invector inventory UI

Announcements, support questions, and discussion for Quest Machine.
Post Reply
nickg84
Posts: 12
Joined: Mon Sep 13, 2021 1:52 pm

Integrating journal into Invector inventory UI

Post by nickg84 »

Hello,

I'm trying to integrate the Quest journal into Invector's already established inventory menu. I'm getting close -- I've got a new Journal tab set up, which opens a blank screen and the Quest Journal UI as a child. I set the Start State on the UI as Open, so it automatically appears when I enter the Journal tab. So far, so good.

However, when accepting a new quest, the quest does not appear on the journal until I hit J to turn off the whole Quest Journal UI, then again to turn it back on. Ideally, I'd actually like to use J to open the Invector menu directly to the Journal tab, as opposed to turning the actual Quest journal on/off.

Thoughts? I'm new to Quest so still figuring things out.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Integrating journal into Invector inventory UI

Post by Tony Li »

Hi,

Please see: How To: Put Journal UI In Your Own Menu

It should update automatically when you accept a quest. If not, let me know and I'll post a short script that listens for the "quest state changed" message to tell it to update.
nickg84
Posts: 12
Joined: Mon Sep 13, 2021 1:52 pm

Re: Integrating journal into Invector inventory UI

Post by nickg84 »

Hi Tony,

Thank you for your response. I followed that little tutorial and am still running into issues for some reason. It's almost there, but accepted quests don't automatically appear, I have to hit J twice to make them appear. Also, as a side note, hitting J twice also replaces the pink haired avatar girl with an "Invector Shooter" logo.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Integrating journal into Invector inventory UI

Post by Tony Li »

In that case, the short script to listen for quest change messages wouldn't help. The quest journal hasn't been told it's open, so it thinks it's closed. When you open the Invector menu, call the quest journal's ShowJournalUI() method. One way to do this is to add a script like this to the journal UI:

Code: Select all

using UnityEngine;
using PixelCrushers.QuestMachine;

public class ShowJournalUIOnEnable : MonoBehavior
{
    private void OnEnable()
    {
        QuestMachine.GetQuestJournal().ShowJournalUI();
    }
}
nickg84
Posts: 12
Joined: Mon Sep 13, 2021 1:52 pm

Re: Integrating journal into Invector inventory UI

Post by nickg84 »

Worked like a charm, THANK YOU!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Integrating journal into Invector inventory UI

Post by Tony Li »

Happy to help!
Post Reply