Page 1 of 1

Display properly formatted active & completed quests in one tab?

Posted: Tue Oct 05, 2021 2:39 pm
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!

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

Posted: Tue Oct 05, 2021 3:16 pm
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.

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

Posted: Tue Oct 05, 2021 4:33 pm
by okaybenji
Absolutely perfect! Many thanks!! 🙏

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

Posted: Tue Oct 05, 2021 4:40 pm
by Tony Li
Happy to help!