Show / Hide Quest Tracker?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Kamotachi
Posts: 44
Joined: Fri Nov 29, 2019 9:03 pm

Show / Hide Quest Tracker?

Post by Kamotachi »

Hi!

I'm trying to show and hide the quest tracker.
I deactivated the "Visible On Start" button in the Standart UI Quest Tracker, But if I load the game, it shows up anyway.

I trying in a script to change "PixelCrushers.DialogueSystem.UnityUIQuestTracker.isVisible = false;" but it's protected,
Maybe is posible to change from other way?

EDIT: I see the functions "ShowTracker() and HideTracker()" , I'm accesing with FindObjectOfType<StandardUIQuestTracker>().HideTracker(); but the QuestTrackers apeears when I Load the game in the MainMenu.

It's strange, because I order to hide after loading the game.
Just like that:
PixelCrushers.SaveSystem.LoadFromSlot(1);
FindObjectOfType<StandardUIQuestTracker>().HideTracker();
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show / Hide Quest Tracker?

Post by Tony Li »

Hi,

Are you using the deprecated UnityUIQuestTracker or the current StandardUIQuestTracker?

If you're using StandardUIQuestTracker, the HideTracker() and ShowTracker() methods will record the tracker's visibility in PlayerPrefs. You can specify the PlayerPrefs key in the tracker's PlayerPrefs Toggle Key field. By default, it's "QuestTracker".
Kamotachi
Posts: 44
Joined: Fri Nov 29, 2019 9:03 pm

Re: Show / Hide Quest Tracker?

Post by Kamotachi »

Tony Li wrote: Wed Oct 27, 2021 1:25 pm Hi,

Are you using the deprecated UnityUIQuestTracker or the current StandardUIQuestTracker?

If you're using StandardUIQuestTracker, the HideTracker() and ShowTracker() methods will record the tracker's visibility in PlayerPrefs. You can specify the PlayerPrefs key in the tracker's PlayerPrefs Toggle Key field. By default, it's "QuestTracker".
Hi Tony, thank you!

Fixed! Loading the game took a little time. In this little lapse of time, I was calling HideTracker (), the game was loading with a bit of lag and reloading the QuestTracker.

I've fixed it by calling HideTracker a bit later using an Invoke.
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show / Hide Quest Tracker?

Post by Tony Li »

Got it. Alternatively, if you're using the Dialogue System's save system, you can hook into an event such as SaveSystem.saveDataApplied to know when to show/hide the tracker.
Post Reply