Display properly formatted active & completed quests in one tab?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
okaybenji
Posts: 2
Joined: Tue Oct 05, 2021 2:23 pm

Display properly formatted active & completed quests in one tab?

Post by okaybenji »

Hi, I'm building a tabbed quest log, and on the main tab I am rendering first active quests followed by completed quests. I had expected quests to render with proper templates: Active Quest Heading Template for active and Completed Quest Heading Template for completed, but they are all rendering the Active Template.

My QuestLogWindow is based off your Tabbed Quest Log Example, but modified for my purposes. So it inherits from StandardUIQuestLogWindow which in turn inherits from QuestLogWindow.

Looking at the StandardUIQuestLogWindow's OnQuestListUpdated method reveals why this is happening:

Code: Select all

var questTitleTemplate = isShowingActiveQuests ? 
        activeQuestHeadingTemplate 
        : completedQuestHeadingTemplate;
So the Standard UI Quest Log treats rendering of active or completed quests as mutually exclusive.

I could fix this for my use case by overriding OnQuestListUpdated in my TabbedQuestLogWindow. Would that be the recommended solution? I hate to do so for such a small modification, since that method is 117 lines. There's going to be some "wet" (i.e. not DRY) copy pasta as a result.

Is there any possibility of an update for the QuestLogWindow / StandardQuestLogWindow which can support rendering active and completed quests with correct templates in the same list?

Thanks very much!
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Display properly formatted active & completed quests in one tab?

Post by Tony Li »

Hi,

In this patch, StandardUIQuestLogWindow splits out that code into their own virtual methods that you can override:

DS_StdUIQuestLogWindowPatch_2021-10-05.unitypackage

Code: Select all

protected virtual StandardUIQuestTitleButtonTemplate GetQuestTitleTemplate(QuestInfo quest)
{
    return isShowingActiveQuests 
        ? activeQuestHeadingTemplate
        : completedQuestHeadingTemplate;
}

protected virtual StandardUIQuestTitleButtonTemplate GetSelectedQuestTitleTemplate(QuestInfo quest)
{
    return isShowingActiveQuests 
        ? (selectedActiveQuestHeadingTemplate ?? activeQuestHeadingTemplate)
        : (selectedCompletedQuestHeadingTemplate ?? completedQuestHeadingTemplate);
}
This change will also be in version 2.2.21.
okaybenji
Posts: 2
Joined: Tue Oct 05, 2021 2:23 pm

Re: Display properly formatted active & completed quests in one tab?

Post by okaybenji »

Absolutely perfect! Many thanks!! 🙏
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Display properly formatted active & completed quests in one tab?

Post by Tony Li »

Happy to help!
Post Reply