PixelCrushers.DialogueSystem.SMSDialogueUI Class Reference

SMS-style dialogue UI. More...

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

Classes

class  DialogueEntryRecord
 
class  PreDelaySettings
 

Public Member Functions

override void OnEnable ()
 
override void OnDisable ()
 
override void Open ()
 Opens the conversation GUI.
 
override void Close ()
 Closes the conversation GUI.
 
override void ShowSubtitle (Subtitle subtitle)
 Shows the subtitle (NPC or PC) based on the character type.
 
override void HideSubtitle (Subtitle subtitle)
 Hides the subtitle based on its character type (PC or NPC).
 
override void ShowResponses (Subtitle subtitle, Response[] responses, float timeout)
 Shows the player responses menu.
 
override void ShowContinueButton (Subtitle subtitle)
 Shows the continue button.
 
override void OnContinueConversation ()
 
virtual void ClearContent ()
 
virtual void OnRecordPersistentData ()
 When saving game data, save the current actor, conversant, and dialogue entry records.
 
virtual void OnApplyPersistentData ()
 When loading a game, load the dialogue entry records and resume the conversation.
 
void ClearRecords ()
 
virtual void SaveConversation ()
 Saves the current conversation history to a Dialogue System variable.
 
virtual void ResumeConversation (string conversation=null)
 Resumes or starts a conversation.
 
- Public Member Functions inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
override void Awake ()
 Sets up the component.
 
void OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 
override void Open ()
 Opens the conversation GUI.
 
override void Close ()
 Closes the conversation GUI.
 
virtual bool AreAnyPanelsClosing (StandardUISubtitlePanel extraSubtitlePanel=null)
 
override void Update ()
 Updates this instance by hiding the alert message when it's done.
 
override void ShowAlert (string message, float duration)
 Shows an alert.
 
override void HideAllAlerts ()
 Hides the alert if it's showing.
 
override void ShowSubtitle (Subtitle subtitle)
 Shows the subtitle (NPC or PC) based on the character type.
 
override void HideSubtitle (Subtitle subtitle)
 Hides the subtitle based on its character type (PC or NPC).
 
virtual float GetTypewriterSpeed ()
 Returns the speed of the first typewriter effect found.
 
virtual void SetTypewriterSpeed (float charactersPerSecond)
 Sets the speed of all typewriter effects.
 
virtual void SetActorSubtitlePanelNumber (DialogueActor dialogueActor, SubtitlePanelNumber subtitlePanelNumber)
 Changes a dialogue actor's subtitle panel for the currently active conversation.
 
virtual void SetActorMenuPanelNumber (DialogueActor dialogueActor, MenuPanelNumber menuPanelNumber)
 Changes a dialogue actor's menu panel for the currently active conversation.
 
virtual void OverrideActorPanel (Actor actor, SubtitlePanelNumber subtitlePanelNumber, bool immediate=false)
 
virtual void ForceOverrideSubtitlePanel (StandardUISubtitlePanel customPanel)
 
virtual void ShowActorInPanel (Actor actor, SubtitlePanelNumber subtitlePanelNumber, StandardUISubtitlePanel customPanel=null)
 Shows an actor immediately in a subtitle panel.
 
override void ShowResponses (Subtitle subtitle, Response[] responses, float timeout)
 Shows the player responses menu.
 
override void OnClick (object data)
 Handles response button clicks.
 
virtual void OverrideActorMenuPanel (Transform actorTransform, MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customPanel)
 
virtual void OverrideActorMenuPanel (Actor actor, MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customPanel)
 
virtual void ForceOverrideMenuPanel (StandardUIMenuPanel customPanel)
 
- Public Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
virtual void Start ()
 Starts this instance by hiding everything.
 
virtual void HideAlert ()
 Hides the alert if it's showing.
 
virtual void HideContinueButton (Subtitle subtitle)
 Hides the continue button.
 
virtual void HideResponses ()
 Hides the player response menu.
 
virtual void ShowQTEIndicator (int index)
 Shows a QTE indicator.
 
virtual void HideQTEIndicator (int index)
 Hides a QTE indicator.
 
virtual void OnContinue ()
 Handles the continue button being clicked.
 
virtual void OnContinueAlert ()
 
virtual void SetPCPortrait (Sprite portraitSprite, string portraitName)
 Sets the PC portrait name and sprite.
 
virtual void SetPCPortrait (Texture2D portraitTexture, string portraitName)
 
virtual void SetActorPortraitSprite (string actorName, Sprite portraitSprite)
 Sets the portrait sprite for an actor.
 

Public Attributes

UnityEngine.UI.Text headingText
 
UnityEngine.UI.ScrollRect scrollRect
 
RectTransform contentPanel
 
RectTransform messagePanel
 
int maxMessages = 0
 
float scrollSpeed = 5f
 
PreDelaySettings npcPreDelaySettings = new PreDelaySettings()
 
PreDelaySettings pcPreDelaySettings = new PreDelaySettings()
 
bool useConversationVariable = false
 
bool dontRepeatLastSequence = false
 
bool disableAudioOnLastSequence = true
 
int[] dontLoadConversationInScenes = new int[] { 0 }
 
- Public Attributes inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
StandardUIAlertControls alertUIElements
 
StandardUIDialogueControls conversationUIElements
 
StandardUIQTEControls QTEIndicatorElements
 
bool addEventSystemIfNeeded = true
 
bool verifyPanelAssignments = true
 

Static Public Attributes

static string conversationVariableOverride
 

Protected Member Functions

virtual void CheckAssignments ()
 
void RecordCurrentScene (Scene scene, LoadSceneMode mode)
 
IEnumerator ShowResponsesAfterPreDelay (Subtitle subtitle, Response[] responses, float timeout)
 
virtual void ShowResponsesNow (Subtitle subtitle, Response[] responses, float timeout)
 
virtual DialogueActor GetDialogueActor (Subtitle subtitle)
 
virtual StandardUISubtitlePanel GetTemplate (Subtitle subtitle, DialogueActor dialogueActor)
 
virtual StandardUISubtitlePanel GetTemplate (Subtitle subtitle)
 
virtual IEnumerator AddMessageWithPreDelay (float preDelay, Subtitle subtitle)
 
virtual void AddMessage (Subtitle subtitle)
 Adds the subtitle as a message in the UI.
 
virtual T FindUIElement< T > (Transform t, string name1, string name2)
 
virtual void ScrollToBottom ()
 
virtual IEnumerator ScrollToBottomCoroutine ()
 
virtual void AddRecord (Subtitle subtitle)
 Records the subtitle in the history so it can be included in saved games.
 
virtual void DestroyInstantiatedMessages ()
 
virtual bool DontLoadInThisScene ()
 
- Protected Member Functions inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
virtual void CloseNow ()
 
IEnumerator CloseAfterPanelsAreClosed ()
 
virtual bool IsMainPanelClosed ()
 
virtual IEnumerator ShowSubtitleWhenMainPanelOpen (Subtitle subtitle)
 
virtual void ShowSubtitleImmediate (Subtitle subtitle)
 
virtual IEnumerator ShowResponsesWhenMainPanelOpen (Subtitle subtitle, Response[] responses, float timeout)
 
virtual void ShowResponsesImmediate (Subtitle subtitle, Response[] responses, float timeout)
 
- Protected Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
virtual void SetSubtitle (Subtitle subtitle, bool value)
 Sets a subtitle's content and visibility.
 

Protected Attributes

List< DialogueEntryRecordrecords = new List<DialogueEntryRecord>()
 
List< GameObject > instantiatedMessages = new List<GameObject>()
 
int currentSceneIndex = -1
 
PreDelaySettings npcPreDelaySettingsCopy = new PreDelaySettings()
 
PreDelaySettings pcPreDelaySettingsCopy = new PreDelaySettings()
 
bool isLoadingGame = false
 
bool skipNextRecord = false
 
bool isInPreDelay = false
 
Coroutine scrollCoroutine = null
 
bool shouldShowContinueButton = false
 
UnityEngine.UI.Button continueButton = null
 
Dictionary< Transform, DialogueActordialogueActorCache = new Dictionary<Transform, DialogueActor>()
 
- Protected Attributes inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
Coroutine closeCoroutine = null
 

Properties

string conversationVariableValue [get]
 
string currentConversationActor [get]
 
string currentConversationConversant [get]
 
string currentDialogueEntryRecords [get]
 
- Properties inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
override AbstractUIRoot uiRootControls [get]
 
override AbstractUIAlertControls alertControls [get]
 
override AbstractDialogueUIControls dialogueControls [get]
 
override AbstractUIQTEControls qteControls [get]
 
Queue< QueuedUIAlertalertQueue [get]
 
- Properties inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
AbstractUIRoot uiRootControls [get]
 Gets the user interface root.
 
AbstractDialogueUIControls dialogueControls [get]
 Gets the dialogue controls.
 
AbstractUIQTEControls qteControls [get]
 Gets the QTE (Quick Time Event) indicators.
 
AbstractUIAlertControls alertControls [get]
 Gets the alert message controls.
 
bool isOpen [get, set]
 Gets or sets a value indicating whether the dialogue UI (conversation interface) is open.
 
virtual bool AreNonDialogueControlsVisible [get]
 Gets a value indicating whether non-conversation controls (e.g., alert message or QTEs) are visible.
 

Additional Inherited Members

- Static Public Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
static Sprite GetValidPortraitSprite (string actorName, Sprite portraitSprite)
 Gets a valid portrait sprite.
 
static Texture2D GetValidPortraitTexture (string actorName, Texture2D portraitTexture)
 
- Static Protected Attributes inherited from PixelCrushers.DialogueSystem.StandardDialogueUI
const float WaitForOpenTimeoutDuration = 8f
 
- Events inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
EventHandler< SelectedResponseEventArgsSelectedResponseHandler
 Occurs when the player selects a response.
 
- Events inherited from PixelCrushers.DialogueSystem.IDialogueUI
EventHandler< SelectedResponseEventArgsSelectedResponseHandler
 Your implementation must define this event and make it public.
 

Detailed Description

SMS-style dialogue UI.

Member Function Documentation

◆ AddMessage()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.AddMessage ( Subtitle  subtitle)
inlineprotectedvirtual

Adds the subtitle as a message in the UI.

◆ AddMessageWithPreDelay()

virtual IEnumerator PixelCrushers.DialogueSystem.SMSDialogueUI.AddMessageWithPreDelay ( float  preDelay,
Subtitle  subtitle 
)
inlineprotectedvirtual

◆ AddRecord()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.AddRecord ( Subtitle  subtitle)
inlineprotectedvirtual

Records the subtitle in the history so it can be included in saved games.

Parameters
subtitle

◆ CheckAssignments()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.CheckAssignments ( )
inlineprotectedvirtual

◆ ClearContent()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.ClearContent ( )
inlinevirtual

◆ ClearRecords()

void PixelCrushers.DialogueSystem.SMSDialogueUI.ClearRecords ( )
inline

◆ Close()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.Close ( )
inlinevirtual

Closes the conversation GUI.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ DestroyInstantiatedMessages()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.DestroyInstantiatedMessages ( )
inlineprotectedvirtual

◆ DontLoadInThisScene()

virtual bool PixelCrushers.DialogueSystem.SMSDialogueUI.DontLoadInThisScene ( )
inlineprotectedvirtual

◆ FindUIElement< T >()

virtual T PixelCrushers.DialogueSystem.SMSDialogueUI.FindUIElement< T > ( Transform  t,
string  name1,
string  name2 
)
inlineprotectedvirtual
Type Constraints
T :MonoBehaviour 

◆ GetDialogueActor()

virtual DialogueActor PixelCrushers.DialogueSystem.SMSDialogueUI.GetDialogueActor ( Subtitle  subtitle)
inlineprotectedvirtual

◆ GetTemplate() [1/2]

virtual StandardUISubtitlePanel PixelCrushers.DialogueSystem.SMSDialogueUI.GetTemplate ( Subtitle  subtitle)
inlineprotectedvirtual

◆ GetTemplate() [2/2]

virtual StandardUISubtitlePanel PixelCrushers.DialogueSystem.SMSDialogueUI.GetTemplate ( Subtitle  subtitle,
DialogueActor  dialogueActor 
)
inlineprotectedvirtual

◆ HideSubtitle()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.HideSubtitle ( Subtitle  subtitle)
inlinevirtual

Hides the subtitle based on its character type (PC or NPC).

Parameters
subtitleSubtitle to hide.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ OnApplyPersistentData()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.OnApplyPersistentData ( )
inlinevirtual

When loading a game, load the dialogue entry records and resume the conversation.

◆ OnContinueConversation()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.OnContinueConversation ( )
inlinevirtual

◆ OnDisable()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.OnDisable ( )
inlinevirtual

◆ OnEnable()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.OnEnable ( )
inlinevirtual

◆ OnRecordPersistentData()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.OnRecordPersistentData ( )
inlinevirtual

When saving game data, save the current actor, conversant, and dialogue entry records.

◆ Open()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.Open ( )
inlinevirtual

Opens the conversation GUI.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ RecordCurrentScene()

void PixelCrushers.DialogueSystem.SMSDialogueUI.RecordCurrentScene ( Scene  scene,
LoadSceneMode  mode 
)
inlineprotected

◆ ResumeConversation()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.ResumeConversation ( string  conversation = null)
inlinevirtual

Resumes or starts a conversation.

If conversation is blank, tries to use the conversation title stored in the DS variable named "Conversation". If the conversation's history was previously saved by a call to SaveConversation(), resumes the conversation at that point. Otherwise starts from the beginning.

Parameters
conversationThe conversation title.

◆ SaveConversation()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.SaveConversation ( )
inlinevirtual

Saves the current conversation history to a Dialogue System variable.

◆ ScrollToBottom()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.ScrollToBottom ( )
inlineprotectedvirtual

◆ ScrollToBottomCoroutine()

virtual IEnumerator PixelCrushers.DialogueSystem.SMSDialogueUI.ScrollToBottomCoroutine ( )
inlineprotectedvirtual

◆ ShowContinueButton()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.ShowContinueButton ( Subtitle  subtitle)
inlinevirtual

Shows the continue button.

Parameters
subtitleSubtitle.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ ShowResponses()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.ShowResponses ( Subtitle  subtitle,
Response[]  responses,
float  timeout 
)
inlinevirtual

Shows the player responses menu.

Parameters
subtitleThe last subtitle, shown as a reminder.
responsesResponses.
timeoutIf not 0, the duration in seconds that the player has to choose a response; otherwise the currently-focused response is auto-selected. If no response is focused (e.g., hovered over), the first response is auto-selected. If 0, there is no timeout; the player can take as long as desired to choose a response.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ ShowResponsesAfterPreDelay()

IEnumerator PixelCrushers.DialogueSystem.SMSDialogueUI.ShowResponsesAfterPreDelay ( Subtitle  subtitle,
Response[]  responses,
float  timeout 
)
inlineprotected

◆ ShowResponsesNow()

virtual void PixelCrushers.DialogueSystem.SMSDialogueUI.ShowResponsesNow ( Subtitle  subtitle,
Response[]  responses,
float  timeout 
)
inlineprotectedvirtual

◆ ShowSubtitle()

override void PixelCrushers.DialogueSystem.SMSDialogueUI.ShowSubtitle ( Subtitle  subtitle)
inlinevirtual

Shows the subtitle (NPC or PC) based on the character type.

Parameters
subtitleSubtitle to show.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

Member Data Documentation

◆ contentPanel

RectTransform PixelCrushers.DialogueSystem.SMSDialogueUI.contentPanel

◆ continueButton

UnityEngine.UI.Button PixelCrushers.DialogueSystem.SMSDialogueUI.continueButton = null
protected

◆ conversationVariableOverride

string PixelCrushers.DialogueSystem.SMSDialogueUI.conversationVariableOverride
static

◆ currentSceneIndex

int PixelCrushers.DialogueSystem.SMSDialogueUI.currentSceneIndex = -1
protected

◆ dialogueActorCache

Dictionary<Transform, DialogueActor> PixelCrushers.DialogueSystem.SMSDialogueUI.dialogueActorCache = new Dictionary<Transform, DialogueActor>()
protected

◆ disableAudioOnLastSequence

bool PixelCrushers.DialogueSystem.SMSDialogueUI.disableAudioOnLastSequence = true

◆ dontLoadConversationInScenes

int [] PixelCrushers.DialogueSystem.SMSDialogueUI.dontLoadConversationInScenes = new int[] { 0 }

◆ dontRepeatLastSequence

bool PixelCrushers.DialogueSystem.SMSDialogueUI.dontRepeatLastSequence = false

◆ headingText

UnityEngine.UI.Text PixelCrushers.DialogueSystem.SMSDialogueUI.headingText

◆ instantiatedMessages

List<GameObject> PixelCrushers.DialogueSystem.SMSDialogueUI.instantiatedMessages = new List<GameObject>()
protected

◆ isInPreDelay

bool PixelCrushers.DialogueSystem.SMSDialogueUI.isInPreDelay = false
protected

◆ isLoadingGame

bool PixelCrushers.DialogueSystem.SMSDialogueUI.isLoadingGame = false
protected

◆ maxMessages

int PixelCrushers.DialogueSystem.SMSDialogueUI.maxMessages = 0

◆ messagePanel

RectTransform PixelCrushers.DialogueSystem.SMSDialogueUI.messagePanel

◆ npcPreDelaySettings

PreDelaySettings PixelCrushers.DialogueSystem.SMSDialogueUI.npcPreDelaySettings = new PreDelaySettings()

◆ npcPreDelaySettingsCopy

PreDelaySettings PixelCrushers.DialogueSystem.SMSDialogueUI.npcPreDelaySettingsCopy = new PreDelaySettings()
protected

◆ pcPreDelaySettings

PreDelaySettings PixelCrushers.DialogueSystem.SMSDialogueUI.pcPreDelaySettings = new PreDelaySettings()

◆ pcPreDelaySettingsCopy

PreDelaySettings PixelCrushers.DialogueSystem.SMSDialogueUI.pcPreDelaySettingsCopy = new PreDelaySettings()
protected

◆ records

List<DialogueEntryRecord> PixelCrushers.DialogueSystem.SMSDialogueUI.records = new List<DialogueEntryRecord>()
protected

◆ scrollCoroutine

Coroutine PixelCrushers.DialogueSystem.SMSDialogueUI.scrollCoroutine = null
protected

◆ scrollRect

UnityEngine.UI.ScrollRect PixelCrushers.DialogueSystem.SMSDialogueUI.scrollRect

◆ scrollSpeed

float PixelCrushers.DialogueSystem.SMSDialogueUI.scrollSpeed = 5f

◆ shouldShowContinueButton

bool PixelCrushers.DialogueSystem.SMSDialogueUI.shouldShowContinueButton = false
protected

◆ skipNextRecord

bool PixelCrushers.DialogueSystem.SMSDialogueUI.skipNextRecord = false
protected

◆ useConversationVariable

bool PixelCrushers.DialogueSystem.SMSDialogueUI.useConversationVariable = false

Property Documentation

◆ conversationVariableValue

string PixelCrushers.DialogueSystem.SMSDialogueUI.conversationVariableValue
get

◆ currentConversationActor

string PixelCrushers.DialogueSystem.SMSDialogueUI.currentConversationActor
get

◆ currentConversationConversant

string PixelCrushers.DialogueSystem.SMSDialogueUI.currentConversationConversant
get

◆ currentDialogueEntryRecords

string PixelCrushers.DialogueSystem.SMSDialogueUI.currentDialogueEntryRecords
get

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