NGUI Quest Log Window

To use NGUI in the Dialogue System, import the package Third Party Support ► NGUI Support.

This page describes how to set up a quest log window and a quest tracker HUD using NGUI.

If you haven't read about quest log windows or quest tracker HUDs before, read about Quest UIs first.

The NGUI support package contains a prefab that uses NGUI's example quest log window as a base.

How to Set Up an NGUI Quest Log Window

To set up a quest log window, add a prefab from the NGUI Support Prefabs folder or create your own layout and add the NGUI Quest Log Window component.

If you're creating your own layout, you'll need to create the following controls:

Which uses the object hierarchy shown below:

NGUI quest log windows instantiate template objects to add elements such as quest headings and quest descriptions. You'll define how you want these elements to look in the templates. At runtime, the quest log window will make copies as necessary to fill out the window.

Finally, assign an NGUI Quest Log Window component to the containing GameObject and assign the values as described below:

Property Function
Localized Text (Optional) Localized text for buttons and messages. See Localization for details.
Quest Heading Source Specifies whether to use the quest's name or its description as the heading.
Abandon Quest State The state that gets assigned to abandoned quests.
Pause While Open Specifies whether to pause the game while the quest log window is open.
UI Root The UIRoot object.
Main Panel The main panel containing the quest log window controls.
Active Quests Button When clicked, the quest table is populated with the list of active quests This button should send the message "ClickShowActiveQuestsButton".
Completed Quests Button When clicked, the quest table is populated with the list of completed quests. This button should send the message "ClickShowCompletedQuestsButton".
Quest Table The UITable that will contain the quests.
Quest Group Template The optional template to use for quest groups. Set up a layout in the quest table containing at least a label, assign the NGUIQuestGroupTemplate script to it, and assign the controls. A copy of the template will be instantiated and customized for each quest group. If the template object has a button, groups can be collapsed.
Quest Template The template to use for quests. Set up a layout in the quest table containing the child controls listed in the next table, assign the NGUIQuestTemplate script to it, and assign the controls. A copy of the template will be instantiated and customized for each quest.
Abandon Popup The main panel for the modal popup window used to ask the player to confirm abandonment of a quest.
Abandon Quest Title The label in the popup window that will be assigned the quest title.

Quest Template Child Controls:

Control Function
Heading UILabel The label for the quest heading.
Description UILabel The label for the quest description.
Track UIButton The button to toggle tracking. You don't need to assign an action to this button; the window will do it automatically. This button will only be shown if the quest is trackable.
Abandon UIButton The button to abandon the quest. You don't need to assign an action to this button; the window will do it automatically. This button will only be shown if the quest is abandonable.
Abandon Popup

You do not need to assign the Close button. Instead, your close button (if you have one) should send a "ClickCloseButton" message to the window when clicked.

How to Set Up an NGUI Quest Tracker HUD

To set up a quest tracker HUD:

  1. Create an NGUI panel containing a UITable. This will be the container that contains the quest tracking information displayed in the HUD.
  2. Create a widget containing two UILabels:
    • Quest Description
    • Quest Entry Description
  3. Add an NGUI Quest Track Template component to the widget and assign the UILabels.
  4. Add an NGUI Quest Tracker component to the Dialogue Manager GameObject. Assign the container and the quest track template.

When updating the quest tracking HUD, the Dialogue System will instantiate copies of the quest track template and add them to the container.


<< NGUI Support