PixelCrushers.DialogueSystem.ConversationController Class Reference

Mediates between a ConversationModel (data) and ConversationView (user interface) to run a conversation. More...

Public Member Functions

delegate void EndConversationDelegate (ConversationController ConversationController)
 
 ConversationController ()
 
 ConversationController (ConversationModel model, ConversationView view, bool alwaysForceResponseMenu, EndConversationDelegate endConversationHandler)
 Initializes a new ConversationController and starts the conversation in the model.
 
void Initialize (ConversationModel model, ConversationView view, bool alwaysForceResponseMenu, EndConversationDelegate endConversationHandler)
 Initializes a ConversationController and starts the conversation in the model.
 
void Close ()
 Closes the currently-running conversation, which also sends OnConversationEnd messages to the participants.
 
void GotoState (ConversationState state)
 Goes to a conversation state.
 
void OnFinishedSubtitle (object sender, EventArgs e)
 Handles the finished subtitle event.
 
void OnSelectedResponse (object sender, SelectedResponseEventArgs e)
 Handles the selected response event by proceeding to the state associated with the selected response.
 
void GotoFirstResponse ()
 Follows the first PC response in the current state.
 
void GotoLastResponse ()
 Follows the last PC response in the current state.
 
void GotoRandomResponse ()
 Follows a random PC response in the current state.
 
void GotoCurrentResponse ()
 Follows a response that has been set as the current response by SetCurrentResponse.
 
void SetCurrentResponse (Response response)
 Sets the current response, which can be used by GotoCurrentResponse.
 
void UpdateResponses ()
 
void SetActorPortraitSprite (string actorName, Sprite sprite)
 Sets the portrait sprite to use in the UI for an actor.
 

Properties

bool isActive [get]
 Indicates whether the ConversationController is currently running a conversation.
 
CharacterInfo actorInfo [get]
 Gets the actor info for this conversation.
 
ConversationModel conversationModel [get]
 
ConversationView conversationView [get]
 
ConversationState currentState [get]
 
ActiveConversationRecord activeConversationRecord [get, set]
 
IsDialogueEntryValidDelegate isDialogueEntryValid [get, set]
 Gets or sets the IsDialogueEntryValid delegate.
 
bool randomizeNextEntry [get, set]
 Set true to choice randomly from the next list of valid NPC subtitles instead of using the first one in the list.
 
CharacterInfo conversantInfo [get]
 Gets the conversant info for this conversation.
 
static int frameLastConversationEnded [get]
 

Detailed Description

Mediates between a ConversationModel (data) and ConversationView (user interface) to run a conversation.

Constructor & Destructor Documentation

◆ ConversationController() [1/2]

PixelCrushers.DialogueSystem.ConversationController.ConversationController ( )
inline

◆ ConversationController() [2/2]

PixelCrushers.DialogueSystem.ConversationController.ConversationController ( ConversationModel  model,
ConversationView  view,
bool  alwaysForceResponseMenu,
EndConversationDelegate  endConversationHandler 
)
inline

Initializes a new ConversationController and starts the conversation in the model.

Also sends OnConversationStart messages to the participants.

Parameters
modelData model of the conversation.
viewView to use to provide a user interface for the conversation.
endConversationHandlerHandler to call to inform when the conversation is done.

Member Function Documentation

◆ Close()

void PixelCrushers.DialogueSystem.ConversationController.Close ( )
inline

Closes the currently-running conversation, which also sends OnConversationEnd messages to the participants.

◆ EndConversationDelegate()

delegate void PixelCrushers.DialogueSystem.ConversationController.EndConversationDelegate ( ConversationController  ConversationController)

◆ GotoCurrentResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoCurrentResponse ( )
inline

Follows a response that has been set as the current response by SetCurrentResponse.

◆ GotoFirstResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoFirstResponse ( )
inline

Follows the first PC response in the current state.

◆ GotoLastResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoLastResponse ( )
inline

Follows the last PC response in the current state.

◆ GotoRandomResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoRandomResponse ( )
inline

Follows a random PC response in the current state.

◆ GotoState()

void PixelCrushers.DialogueSystem.ConversationController.GotoState ( ConversationState  state)
inline

Goes to a conversation state.

If the state is null, the conversation ends.

Parameters
stateState.

◆ Initialize()

void PixelCrushers.DialogueSystem.ConversationController.Initialize ( ConversationModel  model,
ConversationView  view,
bool  alwaysForceResponseMenu,
EndConversationDelegate  endConversationHandler 
)
inline

Initializes a ConversationController and starts the conversation in the model.

Also sends OnConversationStart messages to the participants.

Parameters
modelData model of the conversation.
viewView to use to provide a user interface for the conversation.
endConversationHandlerHandler to call to inform when the conversation is done.

◆ OnFinishedSubtitle()

void PixelCrushers.DialogueSystem.ConversationController.OnFinishedSubtitle ( object  sender,
EventArgs  e 
)
inline

Handles the finished subtitle event.

If the current conversation state has an NPC response, the conversation proceeds to that response. Otherwise, if the current state has PC responses, then the response menu is shown (or if it has a single auto-response, the conversation proceeds directly to that response). If there are no responses, the conversation ends.

Parameters
senderSender.
eEvent args.

◆ OnSelectedResponse()

void PixelCrushers.DialogueSystem.ConversationController.OnSelectedResponse ( object  sender,
SelectedResponseEventArgs  e 
)
inline

Handles the selected response event by proceeding to the state associated with the selected response.

Parameters
senderSender.
eSelected response event args.

◆ SetActorPortraitSprite()

void PixelCrushers.DialogueSystem.ConversationController.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.

◆ SetCurrentResponse()

void PixelCrushers.DialogueSystem.ConversationController.SetCurrentResponse ( Response  response)
inline

Sets the current response, which can be used by GotoCurrentResponse.

Typically only used if the dialogue UI's timeout action specifies to select the current response.

Parameters
response

◆ UpdateResponses()

void PixelCrushers.DialogueSystem.ConversationController.UpdateResponses ( )
inline

Property Documentation

◆ activeConversationRecord

ActiveConversationRecord PixelCrushers.DialogueSystem.ConversationController.activeConversationRecord
getset

◆ actorInfo

CharacterInfo PixelCrushers.DialogueSystem.ConversationController.actorInfo
get

Gets the actor info for this conversation.

The actor info.

◆ conversantInfo

CharacterInfo PixelCrushers.DialogueSystem.ConversationController.conversantInfo
get

Gets the conversant info for this conversation.

The conversant info.

◆ conversationModel

ConversationModel PixelCrushers.DialogueSystem.ConversationController.conversationModel
get

◆ conversationView

ConversationView PixelCrushers.DialogueSystem.ConversationController.conversationView
get

◆ currentState

ConversationState PixelCrushers.DialogueSystem.ConversationController.currentState
get

◆ frameLastConversationEnded

int PixelCrushers.DialogueSystem.ConversationController.frameLastConversationEnded
staticget

◆ isActive

bool PixelCrushers.DialogueSystem.ConversationController.isActive
get

Indicates whether the ConversationController is currently running a conversation.

true if a conversation is active; false if the conversation is done.

◆ isDialogueEntryValid

IsDialogueEntryValidDelegate PixelCrushers.DialogueSystem.ConversationController.isDialogueEntryValid
getset

Gets or sets the IsDialogueEntryValid delegate.

◆ randomizeNextEntry

bool PixelCrushers.DialogueSystem.ConversationController.randomizeNextEntry
getset

Set true to choice randomly from the next list of valid NPC subtitles instead of using the first one in the list.


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