PixelCrushers.DialogueSystem.ConversationView Class Reference

Handles the user interaction part of a conversation. More...

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

Public Member Functions

void Initialize (IDialogueUI ui, Sequencer sequencer, DisplaySettings displaySettings, DialogueEntrySpokenDelegate dialogueEntrySpokenHandler)
 Initialize a UI and sequencer with displaySettings.
 
void Close ()
 Close the conversation view.
 
void Update ()
 Checks if the player has cancelled the conversation.
 
void StartSubtitle (Subtitle subtitle, bool isPCResponseMenuNext, bool isPCAutoResponseNext)
 Starts displaying a subtitle.
 
void SetupContinueButton ()
 Determines whether the continue button should be shown, and shows or hides it.
 
void ShowLastNPCSubtitle ()
 Shows the most recently displayed subtitle.
 
void OnConversationContinue (IDialogueUI dialogueUI)
 Continues this conversation if the dialogue UI matches.
 
void OnConversationContinueAll ()
 Continues all conversations.
 
void HandleContinueButtonClick ()
 
void StartResponses (Subtitle subtitle, Response[] responses)
 Displays the player response menu.
 
void SelectResponse (SelectedResponseEventArgs e)
 
string GetDefaultSequence (Subtitle subtitle)
 Gets the default sequence for a subtitle.
 
float GetDefaultSubtitleDuration (string text)
 
Returns
A duration based on the text length and the Dialogue Manager's Subtitle Settings > Min Subtitle Seconds and Subtitle Chars Per Second.

 
void SetPCPortrait (Sprite pcSprite, string pcName)
 Sets the PC portrait to use for the response menu.
 
void SetActorPortraitSprite (string actorName, Sprite sprite)
 Sets the portrait sprite to use in the UI for an actor.
 

Static Public Member Functions

static float GetDefaultSubtitleDurationInSeconds (string text, DisplaySettings displaySettings=null)
 A duration based on the text length and the Dialogue Manager's Subtitle Settings > Min Subtitle Seconds and Subtitle Chars Per Second.
 

Static Public Attributes

static GetDefaultSubtitleDurationDelegate overrideGetDefaultSubtitleDuration = null
 You can assign a function here to override the method used to determine the default subtitle duration – that is, the value of {{end}}.
 

Properties

DisplaySettings displaySettings [get]
 
bool isWaitingForContinue [get]
 
Sequencer sequencer [get]
 
IDialogueUI dialogueUI [get, set]
 

Events

EventHandler FinishedSubtitleHandler = null
 Called when a subtitle is finished displaying (including text delay and cutscene sequence).
 
EventHandler< SelectedResponseEventArgsSelectedResponseHandler = null
 Called when the player selects a response.
 

Detailed Description

Handles the user interaction part of a conversation.

The ConversationController provides the content. ConversationView processes UI events and hands control to ConversationController.

Member Function Documentation

◆ Close()

void PixelCrushers.DialogueSystem.ConversationView.Close ( )
inline

Close the conversation view.

◆ GetDefaultSequence()

string PixelCrushers.DialogueSystem.ConversationView.GetDefaultSequence ( Subtitle  subtitle)
inline

Gets the default sequence for a subtitle.

Returns
The default sequence.
Parameters
subtitleSubtitle.

◆ GetDefaultSubtitleDuration()

float PixelCrushers.DialogueSystem.ConversationView.GetDefaultSubtitleDuration ( string  text)
inline

Returns
A duration based on the text length and the Dialogue Manager's Subtitle Settings > Min Subtitle Seconds and Subtitle Chars Per Second.

Also factors in time for RPGMaker-style pause codes.

◆ GetDefaultSubtitleDurationInSeconds()

static float PixelCrushers.DialogueSystem.ConversationView.GetDefaultSubtitleDurationInSeconds ( string  text,
DisplaySettings  displaySettings = null 
)
inlinestatic

A duration based on the text length and the Dialogue Manager's Subtitle Settings > Min Subtitle Seconds and Subtitle Chars Per Second.

Also factors in time for RPGMaker-style pause codes.

Parameters
textText.
displaySettingsIf null, uses Dialogue Manager's Display Settings.

◆ HandleContinueButtonClick()

void PixelCrushers.DialogueSystem.ConversationView.HandleContinueButtonClick ( )
inline

◆ Initialize()

void PixelCrushers.DialogueSystem.ConversationView.Initialize ( IDialogueUI  ui,
Sequencer  sequencer,
DisplaySettings  displaySettings,
DialogueEntrySpokenDelegate  dialogueEntrySpokenHandler 
)
inline

Initialize a UI and sequencer with displaySettings.

Parameters
uiDialogue UI.
sequencerSequencer.
displaySettingsDisplay settings to initiate the UI and sequencer with.

◆ OnConversationContinue()

void PixelCrushers.DialogueSystem.ConversationView.OnConversationContinue ( IDialogueUI  dialogueUI)
inline

Continues this conversation if the dialogue UI matches.

Parameters
dialogueUI

◆ OnConversationContinueAll()

void PixelCrushers.DialogueSystem.ConversationView.OnConversationContinueAll ( )
inline

Continues all conversations.

◆ SelectResponse()

void PixelCrushers.DialogueSystem.ConversationView.SelectResponse ( SelectedResponseEventArgs  e)
inline

◆ SetActorPortraitSprite()

void PixelCrushers.DialogueSystem.ConversationView.SetActorPortraitSprite ( string  actorName,
Sprite  sprite 
)
inline

Sets the portrait sprite to use in the UI for an actor.

This is used when the SetPortrait() sequencer command changes an actor's image.

Parameters
actorNameActor name.
spritePortrait sprite.

◆ SetPCPortrait()

void PixelCrushers.DialogueSystem.ConversationView.SetPCPortrait ( Sprite  pcSprite,
string  pcName 
)
inline

Sets the PC portrait to use for the response menu.

Parameters
pcSpritePC sprite.
pcNamePC name.

◆ SetupContinueButton()

void PixelCrushers.DialogueSystem.ConversationView.SetupContinueButton ( )
inline

Determines whether the continue button should be shown, and shows or hides it.

Call this if you've manually changed the continue button mode while the conversation is displaying a line. In most cases you won't ever need to call this manually.

◆ ShowLastNPCSubtitle()

void PixelCrushers.DialogueSystem.ConversationView.ShowLastNPCSubtitle ( )
inline

Shows the most recently displayed subtitle.

◆ StartResponses()

void PixelCrushers.DialogueSystem.ConversationView.StartResponses ( Subtitle  subtitle,
Response[]  responses 
)
inline

Displays the player response menu.

Parameters
subtitleLast subtitle, to display as a reminder of what the player is responding to.
responsesResponses.

◆ StartSubtitle()

void PixelCrushers.DialogueSystem.ConversationView.StartSubtitle ( Subtitle  subtitle,
bool  isPCResponseMenuNext,
bool  isPCAutoResponseNext 
)
inline

Starts displaying a subtitle.

Parameters
subtitleSubtitle to display.
isPCResponseNextIndicates whether the next stage is the player or NPC.
isPCAutoResponseNextIndicates whether the next stage is a player auto-response.

◆ Update()

void PixelCrushers.DialogueSystem.ConversationView.Update ( )
inline

Checks if the player has cancelled the conversation.

Member Data Documentation

◆ overrideGetDefaultSubtitleDuration

GetDefaultSubtitleDurationDelegate PixelCrushers.DialogueSystem.ConversationView.overrideGetDefaultSubtitleDuration = null
static

You can assign a function here to override the method used to determine the default subtitle duration – that is, the value of {{end}}.

Property Documentation

◆ dialogueUI

IDialogueUI PixelCrushers.DialogueSystem.ConversationView.dialogueUI
getset

◆ displaySettings

DisplaySettings PixelCrushers.DialogueSystem.ConversationView.displaySettings
get

◆ isWaitingForContinue

bool PixelCrushers.DialogueSystem.ConversationView.isWaitingForContinue
get

◆ sequencer

Sequencer PixelCrushers.DialogueSystem.ConversationView.sequencer
get

Event Documentation

◆ FinishedSubtitleHandler

EventHandler PixelCrushers.DialogueSystem.ConversationView.FinishedSubtitleHandler = null

Called when a subtitle is finished displaying (including text delay and cutscene sequence).

◆ SelectedResponseHandler

EventHandler<SelectedResponseEventArgs> PixelCrushers.DialogueSystem.ConversationView.SelectedResponseHandler = null

Called when the player selects a response.


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