Page 1 of 1

Show / Hide Quest Tracker?

Posted: Wed Oct 27, 2021 12:03 pm
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();

Re: Show / Hide Quest Tracker?

Posted: Wed Oct 27, 2021 1:25 pm
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".

Re: Show / Hide Quest Tracker?

Posted: Wed Oct 27, 2021 2:04 pm
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.

Re: Show / Hide Quest Tracker?

Posted: Wed Oct 27, 2021 2:20 pm
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.