PixelCrushers.DialogueSystem.QuestLogWindow Class Reference

This is the abstract base class for quest log windows. More...

Inheritance diagram for PixelCrushers.DialogueSystem.QuestLogWindow:
Collaboration diagram for PixelCrushers.DialogueSystem.QuestLogWindow:

Classes

class  QuestInfo
 

Public Types

enum  QuestHeadingSource { QuestHeadingSource.Name, QuestHeadingSource.Description }
 

Public Member Functions

virtual void OpenWindow (Action openedWindowHandler)
 Opens the window. More...
 
virtual void CloseWindow (Action closedWindowHandler)
 Closes the window. More...
 
virtual void OnQuestListUpdated ()
 Called when the quest list has been updated – for example, when switching between active and completed quests. More...
 
virtual void ConfirmAbandonQuest (string title, Action confirmedAbandonQuestHandler)
 Asks the player to confirm abandonment of a quest. More...
 
virtual void Awake ()
 
virtual void Open ()
 Opens the quest window. More...
 
virtual void Close ()
 Closes the quest log window. More...
 
virtual string GetLocalizedText (string fieldName)
 Gets the localized text for a field name. More...
 
virtual bool IsSelectedQuest (QuestInfo questInfo)
 Determines whether the specified questInfo is for the currently-selected quest. More...
 
void ClickClose (object data)
 Your GUI close button should call this. More...
 
virtual void ClickShowActiveQuests (object data)
 Your GUI "show active quests" button should call this. More...
 
virtual void ClickShowCompletedQuests (object data)
 Your GUI "show completed quests" button should call this. More...
 
virtual void ClickQuest (object data)
 Your GUI should call this when the player clicks on a quest to expand or close it. More...
 
virtual void ClickAbandonQuest (object data)
 Your GUI should call this when the player clicks to abandon a quest. More...
 
virtual void ClickTrackQuest (object data)
 Your GUI should call this when the player clicks to toggle quest tracking. More...
 
virtual void ClickShowActiveQuestsButton ()
 
void ClickShowCompletedQuestsButton ()
 
void ClickCloseButton ()
 
void ClickAbandonQuestButton ()
 
void ClickTrackQuestButton ()
 
void UpdateTracker ()
 

Public Attributes

LocalizedTextTable localizedText = null
 
QuestHeadingSource questHeadingSource = QuestHeadingSource.Name
 The quest title source. More...
 
QuestState abandonQuestState = QuestState.Unassigned
 The state to assign abandoned quests. More...
 
bool pauseWhileOpen = true
 If true, the window sets Time.timeScale = 0 to pause the game while displaying the quest log window. More...
 
bool unlockCursorWhileOpen = true
 If true, the cursor is unlocked while the quest log window is open. More...
 
bool useGroups = false
 If true, organize the quests by group. More...
 

Protected Member Functions

virtual void OnOpenedWindow ()
 
virtual void OnClosedWindow ()
 
virtual void PauseGameplay ()
 
virtual void ResumeGameplay ()
 
virtual void ShowQuests (QuestState questStateMask)
 
virtual QuestInfo GetQuestInfo (string group, string title)
 
virtual string GetNoQuestsMessage (QuestState questStateMask)
 Gets the "no quests" message for a quest state (active or success|failure). More...
 
virtual void OnConfirmAbandonQuest ()
 Your GUI should call this when the player confirms abandonment of a quest. More...
 

Protected Attributes

QuestState currentQuestStateMask = QuestState.Active
 The current quest state mask. More...
 

Properties

bool IsOpen [get, protected set]
 Indicates whether the quest log window is currently open. More...
 
QuestInfo[] Quests [get, protected set]
 The current list of quests. More...
 
string[] Groups [get, protected set]
 The current list of quest groups. More...
 
string SelectedQuest [get, protected set]
 The title of the currently-selected quest. More...
 
string NoQuestsMessage [get, protected set]
 The message to show if Quests[] is empty. More...
 
bool IsShowingActiveQuests [get]
 Indicates whether the window is showing active quests or completed quests. More...
 

Detailed Description

This is the abstract base class for quest log windows.

You can implement a quest log window in any GUI system by creating a subclass.

When open, the window displays active and completed quests. It gets the titles, descriptions, and states of the quests from the QuestLog class.

The window allows the player to abandon quests (if the quest's Abandonable field is true) and toggle tracking (if the quest's Trackable field is true).

If pauseWhileOpen is set to true, the quest log window pauses the game by setting Time.timeScale to 0. When closed, it restores the previous time scale.

Member Enumeration Documentation

◆ QuestHeadingSource

Enumerator
Name 

Use the name of the item for the quest heading.

Description 

Use the item's Description field for the quest heading.

Member Function Documentation

◆ Awake()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.Awake ( )
virtual

◆ ClickAbandonQuest()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickAbandonQuest ( object  data)
virtual

Your GUI should call this when the player clicks to abandon a quest.

Parameters
dataIgnored.

◆ ClickAbandonQuestButton()

void PixelCrushers.DialogueSystem.QuestLogWindow.ClickAbandonQuestButton ( )

◆ ClickClose()

void PixelCrushers.DialogueSystem.QuestLogWindow.ClickClose ( object  data)

Your GUI close button should call this.

Parameters
dataIgnored.

◆ ClickCloseButton()

void PixelCrushers.DialogueSystem.QuestLogWindow.ClickCloseButton ( )

◆ ClickQuest()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickQuest ( object  data)
virtual

Your GUI should call this when the player clicks on a quest to expand or close it.

Parameters
dataThe quest title.

◆ ClickShowActiveQuests()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickShowActiveQuests ( object  data)
virtual

Your GUI "show active quests" button should call this.

Parameters
dataIgnored.

◆ ClickShowActiveQuestsButton()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickShowActiveQuestsButton ( )
virtual

◆ ClickShowCompletedQuests()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickShowCompletedQuests ( object  data)
virtual

Your GUI "show completed quests" button should call this.

Parameters
dataIgnored.

◆ ClickShowCompletedQuestsButton()

void PixelCrushers.DialogueSystem.QuestLogWindow.ClickShowCompletedQuestsButton ( )

◆ ClickTrackQuest()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ClickTrackQuest ( object  data)
virtual

Your GUI should call this when the player clicks to toggle quest tracking.

Parameters
dataIgnored.

◆ ClickTrackQuestButton()

void PixelCrushers.DialogueSystem.QuestLogWindow.ClickTrackQuestButton ( )

◆ Close()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.Close ( )
virtual

Closes the quest log window.

While you can call this manually in your own script, this method is normally called internally when the player clicks the close button. You can call it manually to support alternate methods of closing the window.

if (Input.GetKeyDown(KeyCode.L) && myQuestLogWindow.IsOpen) { myQuestLogWindow.Close(); }

◆ CloseWindow()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.CloseWindow ( Action  closedWindowHandler)
virtual

Closes the window.

Your implementation should override this to handle any window-closing activity, then call closedWindowHandler at the end.

Parameters
openedWindowHandlerClosed window handler.

Reimplemented in PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestLogWindow, PixelCrushers.DialogueSystem.UnityGUI.UnityGUIQuestLogWindow, PixelCrushers.DialogueSystem.DaikonForgeGUI.DaikonForgeQuestLogWindow, and PixelCrushers.DialogueSystem.NGUI.NGUIQuestLogWindow.

◆ ConfirmAbandonQuest()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ConfirmAbandonQuest ( string  title,
Action  confirmedAbandonQuestHandler 
)
virtual

Asks the player to confirm abandonment of a quest.

Your implementation should override this to show a modal dialogue box or something similar. If confirmed, it should call confirmedAbandonQuestHandler.

Parameters
titleTitle.
confirmedAbandonQuestHandlerConfirmed abandon quest handler.

Reimplemented in PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestLogWindow, PixelCrushers.DialogueSystem.DaikonForgeGUI.DaikonForgeQuestLogWindow, PixelCrushers.DialogueSystem.NGUI.NGUIQuestLogWindow, and PixelCrushers.DialogueSystem.UnityGUI.UnityGUIQuestLogWindow.

◆ GetLocalizedText()

virtual string PixelCrushers.DialogueSystem.QuestLogWindow.GetLocalizedText ( string  fieldName)
virtual

Gets the localized text for a field name.

Returns
The localized text.
Parameters
fieldNameField name.

◆ GetNoQuestsMessage()

virtual string PixelCrushers.DialogueSystem.QuestLogWindow.GetNoQuestsMessage ( QuestState  questStateMask)
protectedvirtual

Gets the "no quests" message for a quest state (active or success|failure).

This method uses the strings "No Active Quests" and "No Completed Quests" or their localized equivalents if you've set the localized text table.

Returns
The "no quests" message.
Parameters
questStateMaskQuest state mask.

◆ GetQuestInfo()

virtual QuestInfo PixelCrushers.DialogueSystem.QuestLogWindow.GetQuestInfo ( string  group,
string  title 
)
protectedvirtual

◆ IsSelectedQuest()

virtual bool PixelCrushers.DialogueSystem.QuestLogWindow.IsSelectedQuest ( QuestInfo  questInfo)
virtual

Determines whether the specified questInfo is for the currently-selected quest.

Returns
true if this is the selected quest; otherwise, false.
Parameters
questInfoQuest info.

◆ OnClosedWindow()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.OnClosedWindow ( )
protectedvirtual

◆ OnConfirmAbandonQuest()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.OnConfirmAbandonQuest ( )
protectedvirtual

Your GUI should call this when the player confirms abandonment of a quest.

◆ OnOpenedWindow()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.OnOpenedWindow ( )
protectedvirtual

◆ OnQuestListUpdated()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.OnQuestListUpdated ( )
virtual

Called when the quest list has been updated – for example, when switching between active and completed quests.

Your implementation may override this to do processing.

Reimplemented in PixelCrushers.DialogueSystem.UnityGUI.UnityGUIQuestLogWindow, PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestLogWindow, PixelCrushers.DialogueSystem.UnityUIQuestLogWindow, PixelCrushers.DialogueSystem.DaikonForgeGUI.DaikonForgeQuestLogWindow, and PixelCrushers.DialogueSystem.NGUI.NGUIQuestLogWindow.

◆ Open()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.Open ( )
virtual

Opens the quest window.

◆ OpenWindow()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.OpenWindow ( Action  openedWindowHandler)
virtual

Opens the window.

Your implementation should override this to handle any window-opening activity, then call openedWindowHandler at the end.

Parameters
openedWindowHandlerOpened window handler.

Reimplemented in PixelCrushers.DialogueSystem.UnityGUI.UnityGUIQuestLogWindow, PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestLogWindow, PixelCrushers.DialogueSystem.DaikonForgeGUI.DaikonForgeQuestLogWindow, and PixelCrushers.DialogueSystem.NGUI.NGUIQuestLogWindow.

◆ PauseGameplay()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.PauseGameplay ( )
protectedvirtual

◆ ResumeGameplay()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ResumeGameplay ( )
protectedvirtual

◆ ShowQuests()

virtual void PixelCrushers.DialogueSystem.QuestLogWindow.ShowQuests ( QuestState  questStateMask)
protectedvirtual

◆ UpdateTracker()

void PixelCrushers.DialogueSystem.QuestLogWindow.UpdateTracker ( )

Member Data Documentation

◆ abandonQuestState

QuestState PixelCrushers.DialogueSystem.QuestLogWindow.abandonQuestState = QuestState.Unassigned

The state to assign abandoned quests.

◆ currentQuestStateMask

QuestState PixelCrushers.DialogueSystem.QuestLogWindow.currentQuestStateMask = QuestState.Active
protected

The current quest state mask.

◆ localizedText

LocalizedTextTable PixelCrushers.DialogueSystem.QuestLogWindow.localizedText = null

◆ pauseWhileOpen

bool PixelCrushers.DialogueSystem.QuestLogWindow.pauseWhileOpen = true

If true, the window sets Time.timeScale = 0 to pause the game while displaying the quest log window.

◆ questHeadingSource

QuestHeadingSource PixelCrushers.DialogueSystem.QuestLogWindow.questHeadingSource = QuestHeadingSource.Name

The quest title source.

◆ unlockCursorWhileOpen

bool PixelCrushers.DialogueSystem.QuestLogWindow.unlockCursorWhileOpen = true

If true, the cursor is unlocked while the quest log window is open.

◆ useGroups

bool PixelCrushers.DialogueSystem.QuestLogWindow.useGroups = false

If true, organize the quests by group.

Property Documentation

◆ Groups

string [] PixelCrushers.DialogueSystem.QuestLogWindow.Groups
getprotected set

The current list of quest groups.

The quest group names.

◆ IsOpen

bool PixelCrushers.DialogueSystem.QuestLogWindow.IsOpen
getprotected set

Indicates whether the quest log window is currently open.

true if open; otherwise, false.

◆ IsShowingActiveQuests

bool PixelCrushers.DialogueSystem.QuestLogWindow.IsShowingActiveQuests
get

Indicates whether the window is showing active quests or completed quests.

true if showing active quests; otherwise, false.

◆ NoQuestsMessage

string PixelCrushers.DialogueSystem.QuestLogWindow.NoQuestsMessage
getprotected set

The message to show if Quests[] is empty.

The no quests message.

◆ Quests

QuestInfo [] PixelCrushers.DialogueSystem.QuestLogWindow.Quests
getprotected set

The current list of quests.

This will change based on whether the player is viewing active or completed quests.

The quests.

◆ SelectedQuest

string PixelCrushers.DialogueSystem.QuestLogWindow.SelectedQuest
getprotected set

The title of the currently-selected quest.

The selected quest.


The documentation for this class was generated from the following file: