Skip to main content

Step

Enum Step 

Source
pub enum Step<D = NoDirective> {
    Caption {
        text: String,
    },
    Place {
        side: Side,
        character: CharacterId,
        expression: String,
    },
    Clear {
        side: Side,
    },
    Say {
        speaker: CharacterId,
        expression: Option<String>,
        text: String,
        direction: Option<String>,
        line: LineId,
    },
    Narrate {
        text: String,
        direction: Option<String>,
        line: LineId,
    },
    Choice {
        options: Vec<ChoiceOption<D>>,
    },
    Music(MusicLine),
    Directive(D),
    If {
        character: CharacterId,
        then: Vec<Step<D>>,
        otherwise: Vec<Step<D>>,
    },
}
Expand description

One step of a scene, in script order. D is the game’s own directives.

Variants§

§

Caption

@caption <text>: a location/time caption, shown until the next one.

Fields

§text: String

The caption.

§

Place

@left <id> <expression>: a character enters (or replaces whoever is) on side.

Fields

§side: Side

Where.

§character: CharacterId

Who.

§expression: String

With which expression.

§

Clear

@left clear: the portrait on side leaves.

Fields

§side: Side

Which side empties.

§

Say

id: text or id[expression]: text: an on-screen character speaks, first changing expression if one is given.

Fields

§speaker: CharacterId

Who speaks.

§expression: Option<String>

The speaker’s new expression, if it changes.

§text: String

What they say.

§direction: Option<String>

How it is said, for a voice or an actor; never shown, and not part of the line’s id.

§line: LineId

The line’s id.

§

Narrate

> text: narration, no speaker.

Fields

§text: String

The narration.

§direction: Option<String>

How it is said, for a voice or an actor; never shown, and not part of the line’s id.

§line: LineId

The line’s id.

§

Choice

@choice … @endchoice: the replies the player picks from, each with its own reaction steps. Every option rejoins the scene after the block.

Fields

§options: Vec<ChoiceOption<D>>

The options, in menu order.

§

Music(MusicLine)

@music <cue> or @music stop: the music changes when playback reaches this line, and stays so after the scene.

§

Directive(D)

A directive of the game’s (Directive).

§

If

@if <character> … @else … @endif: steps that play only if the character is there when the scene plays (Present), and the steps that play instead if they aren’t.

Fields

§character: CharacterId

Who must be there.

§then: Vec<Step<D>>

The steps played if they are.

§otherwise: Vec<Step<D>>

The steps played if they aren’t (none without an @else).

Implementations§

Source§

impl<D> Step<D>

Source

pub fn text(&self) -> Option<&str>

The text of a text step (one text box): a Say or Narrate.

Source

pub fn has_text(&self) -> bool

Whether the step is, or has inside it, a speech or narration line.

Trait Implementations§

Source§

impl<D: Clone> Clone for Step<D>

Source§

fn clone(&self) -> Step<D>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D: Debug> Debug for Step<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, D> Deserialize<'de> for Step<D>
where D: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<D: Eq> Eq for Step<D>

Source§

impl<D: PartialEq> PartialEq for Step<D>

Source§

fn eq(&self, other: &Step<D>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<D> Serialize for Step<D>
where D: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<D: PartialEq> StructuralPartialEq for Step<D>

Auto Trait Implementations§

§

impl<D> Freeze for Step<D>
where D: Freeze,

§

impl<D> RefUnwindSafe for Step<D>
where D: RefUnwindSafe,

§

impl<D> Send for Step<D>
where D: Send,

§

impl<D> Sync for Step<D>
where D: Sync,

§

impl<D> Unpin for Step<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for Step<D>
where D: UnsafeUnpin,

§

impl<D> UnwindSafe for Step<D>
where D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.