Journal Panel doesn't show up

Announcements, support questions, and discussion for Quest Machine.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal Panel doesn't show up

Post by Tony Li »

If the Quest Journal component's UI Settings > Quest Journal UI field is unassigned, it will automatically use the Quest Machine GameObject's QuestJournalUI.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Journal Panel doesn't show up

Post by GorkaGames »

Yes I know, Thanks, that's the reason I'm writing on this thread that we opened some months ago, but now my Quest Journal UI is inside my Main Menu and sometimes on the gameplay is not on any of the same scenes of Quest Journal and / or Quest Machine, so I lose both references. I need to find on the scene by code to be 100% sure that I'll find it.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal Panel doesn't show up

Post by Tony Li »

When you change scenes, set QuestMachine.defaultQuestJournalUI. Example:

Code: Select all

void Start()
{
    QuestMachine.defaultQuestJournalUI = FindObjectOfType<UnityUIQuestJournalUI>() as IQuestJournalUI;
}
Or you can make a subclass of QuestJournal and override ToggleJournalUI() to always find the journal UI first:

Code: Select all

public override void ToggleJournalUI()
{
    if (questJournalUI == null) questJournalUI = FindObjectOfType<UnityUIQuestJournalUI>() as IQuestJournalUI;
    base.ToggleJournalUI();
}
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Journal Panel doesn't show up

Post by GorkaGames »

Thanks, first option didn't work for me but second one yes. Just one thing, it was this, wasn't it?

public override void ToggleJournalUI() instead of: public virtual void ToggleJournalUI()
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Journal Panel doesn't show up

Post by Tony Li »

Yes, it should be "override". I'll fix that in the post right now.
Post Reply