Hi Peter,
Ah, I understand now. Sorry, I hadn't caught on to what you were describing before.
Yes, the default implementation works exactly the way you described. You can change this behavior.
The abstract QuestLogWindow class has a virtual method "OnQuestListUpdated()". Whenever the player clicks on a new quest heading, abandons a quest, or switches between active and completed categories, it calls this method.
The Unity UI subclass (UnityUIQuestLogWindow) overrides the OnQuestListUpdated() method. It destroys the contents of the quest table and then reinstantiates whatever quest templates are necessary. I went with this simple "clear everything and start over" approach to try to make it foolproof for the whole gamut of customer needs. In your subclass, you could override it with a more sophisticated implementation that works better for your specific case.
Code: Select all
public override void OnQuestListUpdated() {
// Instead of destroying the contents of questTable, maybe
// you want to check for differences and minimally
// adjust only what's necessary.
}
When the quest log window opens, it calls the virtual method "OpenWindow(Action openedWindowHandler)". The parameter is a delegate to a method that runs after the window is open; by default, this method populates the quest table.
The Unity UI subclass overrides OpenWindow to play the "Show" animation and then call the openedWindowHandler after the animation is done. If you want to populate the quest table
before showing the window, you can override this method, too:
Code: Select all
public override void OpenWindow(Action openedWindowHandler) {
OnQuestListUpdate();
base.OpenWindow(openedWindowHandler);
}