Quest Journal UI Customization

Announcements, support questions, and discussion for Quest Machine.
Post Reply
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Quest Journal UI Customization

Post by cptscrimshaw »

Hi Tony,

I've mostly completed revamping the Quest Journal for my game, but I have a few outstanding items I'm hoping you might be able to offer some insight on.

https://ibb.co/bR7sgWR

#1 - I haven't touched UnityUIQuestJournalUI up to this point, because I wanted to ask you about a best approach first. Instead, I have a separate class I'm using to handle input, UI display, etc. I'm currently just reordering the UI elements once they are instantiated, but this leads to a very small "blip" in graphics as items are moved around since I have to wait for a frame for everything to be drawn initially. Any suggestions on how to avoid that?

#2 - I'd like to list all completed quests (with a divider) below the active ones. Should I use a group for this, or is there any easier way to put completed ones at the bottom?

Let me know if I need to clarify anything, and thanks!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Journal UI Customization

Post by Tony Li »

Hi,
cptscrimshaw wrote: Mon Apr 04, 2022 6:49 pm#1 - I haven't touched UnityUIQuestJournalUI up to this point, because I wanted to ask you about a best approach first. Instead, I have a separate class I'm using to handle input, UI display, etc. I'm currently just reordering the UI elements once they are instantiated, but this leads to a very small "blip" in graphics as items are moved around since I have to wait for a frame for everything to be drawn initially. Any suggestions on how to avoid that?
Try using Canvas.ForceUpdateCanvases() to refresh the UI layout of all canvases.
cptscrimshaw wrote: Mon Apr 04, 2022 6:49 pm#2 - I'd like to list all completed quests (with a divider) below the active ones. Should I use a group for this, or is there any easier way to put completed ones at the bottom?
Iterate through the quests and check each quest's state using the GetState() method. Some ideas:
  • Loop through the quests twice, first listing only quests whose GetState() == QuestState.Active, then listing quests whose GetState() == QuestState.Successful.
  • Or you can loop once and store the quests in two lists (active and complete), then add UI elements for both lists.
  • Or set up two UI containers, one for active, one for complete. As you loop through the quests, put them in the appropriate container based on GetState().
Post Reply