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);
}
}
}
}
}
}
}