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
MortarEventTracker: Tracks text events and manages firing state based on index
§Usage Pattern
- Add
MortarEventTrackerto entities with text events - Call
trigger_at_index()with current progress index - Handle returned
MortarEventActions in your game systems
§ECS 架构
本库遵循 ECS(实体组件系统)设计理念。
§核心组件
MortarEventTracker:按索引跟踪文本事件并管理触发状态
§使用方式
- 将
MortarEventTracker添加到包含文本事件的实体 - 使用当前进度索引调用
trigger_at_index() - 在游戏系统中处理返回的
MortarEventAction
Modules§
- prelude
- Convenient re-exports for common usage.
Macros§
- dev_
info - A macro for logging development-only information.
Structs§
- Cached
Condition - Cached result of a condition evaluation, used to ensure if/else mutual exclusivity.
- Dialogue
RunItem - Metadata describing run_event / run_timeline entries in node content.
- Dialogue
State - The state of a dialogue.
- Mortar
Asset - A Bevy asset representing a Mortar dialogue file.
- Mortar
Asset Loader - An asset loader for
.mortarand.mortaredfiles. - Mortar
Audio Settings - Configures how Mortar handles
play_soundevents. - Mortar
Boolean - Boolean type for Mortar functions.
- Mortar
Dialogue Finished - Event emitted when a Mortar dialogue finishes naturally (not via StopDialogue).
- Mortar
Dialogue Plugin - Plugin that turns Mortar runtime data into ready-to-render UI text plus gameplay events.
- Mortar
Dialogue Text - Stores the current Mortar dialogue text so users can bind custom render effects.
- Mortar
Dialogue Variables - Resource that caches variable state for the currently loaded mortar file.
- Mortar
Event Action - An action triggered by a mortar event.
- Mortar
Event Binding - Component that exposes the current playback index for Mortar events.
- Mortar
Event Tracker - Component to track mortar text events and their firing state.
- Mortar
Function Registry - A registry for Mortar functions.
- Mortar
Game Event - Event emitted whenever Mortar timelines or text events ask the game to do something.
- Mortar
Number - Number type for Mortar functions.
- Mortar
Plugin - The main plugin for the mortar ‘bond’ (bind) system.
- Mortar
Registry - A global registry for Mortar assets, managing multiple mortar files.
- Mortar
Runs Executing - Tracks whether Mortar
runstatements are executing. - Mortar
Runtime - The runtime state for the Mortar system. Now supports multiple concurrent dialogue controllers.
- Mortar
String - String type for Mortar functions.
- Mortar
Text Event - Re-export mortar_compiler types for convenience.
- Mortar
Text Target - Marker for
Textentities that should display Mortar dialogue output. - Mortar
Variable State - Component that manages variable state for a Mortar dialogue runtime.
- Mortar
Void - Void type for Mortar functions.
- Text
Data - Text data extracted from content item
Enums§
- Dialogue
RunKind - Type of run content embedded in a node.
- Mortar
Dialogue System Set - System sets exposed by
MortarDialoguePluginfor ordering customization. - Mortar
Event - The event system for Mortar. Events without a target entity operate on the primary dialogue.
- Mortar
Value - Arguments and return values for Mortar functions.
- Mortar
Variable Value - 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§
- Dialogue
RunDescriptor - Descriptor for run statements found at a specific content position.