pub enum DialogueEvent {
Say {
speaker: Option<String>,
text: String,
tags: Vec<Tag>,
},
Command {
name: String,
args: Vec<Value>,
awaited: bool,
},
Choices {
choices: Vec<Choice>,
},
Finished,
}Expand description
What the VM asks the host to do before the dialogue can go on.
Returned by DialogueVm::start and DialogueVm::resume. Every variant
but Finished leaves the VM suspended, waiting
for the matching ResumeEvent.
Variants§
Say
A line of dialogue to show. Resume with ResumeEvent::Advance once
the player is done reading it.
Fields
The #tags of the line, in the order they are written.
Command
A command for the host to interpret, such as >> add_scene(Alice).
Meaning and arguments are entirely up to the host. Resume with
ResumeEvent::Advance, immediately or once the command is over.
Choices
A choice to offer to the player. Resume with
ResumeEvent::Select carrying the index of the chosen entry.
Finished
The dialogue reached its end. The VM is no longer suspended, so
DialogueVm::resume now fails and only
DialogueVm::start can be called again.