Enum yarnspinner::prelude::DialogueEvent
source · pub enum DialogueEvent {
Line(Line),
Options(Vec<DialogueOption>),
Command(Command),
NodeComplete(String),
NodeStart(String),
LineHints(Vec<LineId>),
DialogueComplete,
}
Expand description
An event encountered while running Dialogue::continue_
. A caller is expected to handle these events and act accordingly.
§Implementation note
Corresponds to Yarn Spinner’s <EventName>Handler
s.
Variants§
Line(Line)
A Line
should be presented to the user.
Options(Vec<DialogueOption>)
A list of DialogueOption
s should be presented to the user, who in turns must select one of them.
The selected option must be communicated to the Dialogue
via Dialogue::set_selected_option
before calling Dialogue::continue_
again.
Command(Command)
A Command
should be executed.
It is not specified whether the command should be finished executing before calling Dialogue::continue_
again or it is run in parallel.
A library wrapping Yarn Spinner for a game engine should specify this.
NodeComplete(String)
The node with the given name was completed.
NodeStart(String)
The node with the given name was entered.
LineHints(Vec<LineId>)
Only emitted if Dialogue::should_send_line_hints
is enabled.
A hint that the contained line IDs might be encountered while progressing the dialogue. These are not guaranteed to run, but give a caller the chance to pre-load resources for them if they want.
§Implementation note
Corresponds to Yarn Spinner’s PrepareForLinesHandler
DialogueComplete
The dialogue was completed. Set it to a new node via Dialogue::set_node
before calling Dialogue::continue_
again.
Trait Implementations§
source§impl Clone for DialogueEvent
impl Clone for DialogueEvent
source§fn clone(&self) -> DialogueEvent
fn clone(&self) -> DialogueEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DialogueEvent
impl Debug for DialogueEvent
source§impl PartialEq for DialogueEvent
impl PartialEq for DialogueEvent
source§fn eq(&self, other: &DialogueEvent) -> bool
fn eq(&self, other: &DialogueEvent) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for DialogueEvent
Auto Trait Implementations§
impl RefUnwindSafe for DialogueEvent
impl Send for DialogueEvent
impl Sync for DialogueEvent
impl Unpin for DialogueEvent
impl UnwindSafe for DialogueEvent
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T
behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T
behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T
behind Rc
pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T
behind Arc
pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T
behind Box
pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self
to T
,
useful only in generic context as a workaround for specialization