Skip to main content

Crate bevy_mortar_bond

Crate bevy_mortar_bond 

Source
Expand description

This crate provides a ‘bond’ (binding) system for the Mortar dialogue system, integrating it with the Bevy game engine.

本包为 Mortar 对话系统提供“绑钉”(绑定)系统,将其与 Bevy 游戏引擎集成。

§ECS Architecture

This library follows ECS (Entity Component System) design principles.

§Core Components

§Usage Pattern

  1. Add MortarEventTracker to entities with text events
  2. Call trigger_at_index() with current progress index
  3. Handle returned MortarEventActions in your game systems

§ECS 架构

本库遵循 ECS(实体组件系统)设计理念。

§核心组件

§使用方式

  1. MortarEventTracker 添加到包含文本事件的实体
  2. 使用当前进度索引调用 trigger_at_index()
  3. 在游戏系统中处理返回的 MortarEventAction

Modules§

prelude
Convenient re-exports for common usage.

Macros§

dev_info
A macro for logging development-only information.

Structs§

CachedCondition
Cached result of a condition evaluation, used to ensure if/else mutual exclusivity.
DialogueRunItem
Metadata describing run_event / run_timeline entries in node content.
DialogueState
The state of a dialogue.
MortarAsset
A Bevy asset representing a Mortar dialogue file.
MortarAssetLoader
An asset loader for .mortar and .mortared files.
MortarAudioSettings
Configures how Mortar handles play_sound events.
MortarBoolean
Boolean type for Mortar functions.
MortarDialogueFinished
Event emitted when a Mortar dialogue finishes naturally (not via StopDialogue).
MortarDialoguePlugin
Plugin that turns Mortar runtime data into ready-to-render UI text plus gameplay events.
MortarDialogueText
Stores the current Mortar dialogue text so users can bind custom render effects.
MortarDialogueVariables
Resource that caches variable state for the currently loaded mortar file.
MortarEventAction
An action triggered by a mortar event.
MortarEventBinding
Component that exposes the current playback index for Mortar events.
MortarEventTracker
Component to track mortar text events and their firing state.
MortarFunctionRegistry
A registry for Mortar functions.
MortarGameEvent
Event emitted whenever Mortar timelines or text events ask the game to do something.
MortarNumber
Number type for Mortar functions.
MortarPlugin
The main plugin for the mortar ‘bond’ (bind) system.
MortarRegistry
A global registry for Mortar assets, managing multiple mortar files.
MortarRunsExecuting
Tracks whether Mortar run statements are executing.
MortarRuntime
The runtime state for the Mortar system. Now supports multiple concurrent dialogue controllers.
MortarString
String type for Mortar functions.
MortarTextEvent
Re-export mortar_compiler types for convenience.
MortarTextTarget
Marker for Text entities that should display Mortar dialogue output.
MortarVariableState
Component that manages variable state for a Mortar dialogue runtime.
MortarVoid
Void type for Mortar functions.
TextData
Text data extracted from content item

Enums§

DialogueRunKind
Type of run content embedded in a node.
MortarDialogueSystemSet
System sets exposed by MortarDialoguePlugin for ordering customization.
MortarEvent
The event system for Mortar. Events without a target entity operate on the primary dialogue.
MortarValue
Arguments and return values for Mortar functions.
MortarVariableValue
Runtime value for a Mortar variable.

Functions§

evaluate_condition
Evaluates a condition by calling the bound function.
evaluate_condition_cached
Evaluates a condition with caching to guarantee if/else mutual exclusivity.
evaluate_if_condition
Evaluates an IfCondition with support for function calls.
process_interpolated_text
Processes interpolated text by calling bound functions and resolving variables.

Type Aliases§

DialogueRunDescriptor
Descriptor for run statements found at a specific content position.

Attribute Macros§

mortar_functions

Derive Macros§

MortarFunctions