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] |
Mediates between a ConversationModel (data) and ConversationView (user interface) to run a conversation.
|
inline |
|
inline |
Initializes a new ConversationController and starts the conversation in the model.
Also sends OnConversationStart messages to the participants.
model | Data model of the conversation. |
view | View to use to provide a user interface for the conversation. |
endConversationHandler | Handler to call to inform when the conversation is done. |
|
inline |
Closes the currently-running conversation, which also sends OnConversationEnd messages to the participants.
delegate void PixelCrushers.DialogueSystem.ConversationController.EndConversationDelegate | ( | ConversationController | ConversationController | ) |
|
inline |
Follows a response that has been set as the current response by SetCurrentResponse.
|
inline |
Follows the first PC response in the current state.
|
inline |
Follows the last PC response in the current state.
|
inline |
Follows a random PC response in the current state.
|
inline |
Goes to a conversation state.
If the state is null
, the conversation ends.
state | State. |
|
inline |
Initializes a ConversationController and starts the conversation in the model.
Also sends OnConversationStart messages to the participants.
model | Data model of the conversation. |
view | View to use to provide a user interface for the conversation. |
endConversationHandler | Handler to call to inform when the conversation is done. |
|
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.
sender | Sender. |
e | Event args. |
|
inline |
Handles the selected response event by proceeding to the state associated with the selected response.
sender | Sender. |
e | Selected response event args. |
|
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.
actorName | Actor name. |
sprite | Portrait sprite. |
|
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.
response |
|
inline |
|
getset |
|
get |
Gets the actor info for this conversation.
The actor info.
|
get |
Gets the conversant info for this conversation.
The conversant info.
|
get |
|
get |
|
get |
|
staticget |
|
get |
Indicates whether the ConversationController is currently running a conversation.
true
if a conversation is active; false
if the conversation is done.
|
getset |
Gets or sets the IsDialogueEntryValid delegate.
|
getset |
Set true to choice randomly from the next list of valid NPC subtitles instead of using the first one in the list.