Re: Questions about splitscreen logic
Posted: Fri Sep 01, 2023 12:43 pm
Thanks so much for the help! I like using the message system for this too. I decided to use it on the RefreshUI function, but I am running into one more snag. Here is my code:
Now the issue is if I toggle the quest off in the Quest Journal UI it is turning off the POI for both players. Any ideas on how to get the showInTrackHUD value that's specific to the second player?
Code: Select all
void RefreshPOIs()
{
Debug.Log("Refresh is called!");
for (int i = 0; i < PlayerJournals.Length; i++)
{
foreach (var quest in PlayerJournals[i].questList)
{
foreach (var node in quest.nodeList)
{
POIItem poi = POI_Manager.AllPOIs.GetPOIItem(StringField.GetStringValue(node.id));
if (poi)
{
Debug.Log("P" + (i + 1) + " show in hud = " + quest.showInTrackHUD);
Debug.Log("Found a poi!" + StringField.GetStringValue(node.id));
if (!quest.showInTrackHUD)
{
poi.SetIsVisibleToPlayer(i, false);
}
else
{
if (node.GetState() == QuestNodeState.Active)
{
poi.SetIsVisibleToPlayer(i, true);
}
else
{
poi.SetIsVisibleToPlayer(i, false);
}
}
}
}
}
}
}