pub struct CommandContext {Show 39 fields
pub project_dir: PathBuf,
pub images: ImageManager,
pub layers: LayerManager,
pub solid_white: ImageId,
pub audio: AudioHub,
pub bgm: BgmEngine,
pub koe: KoeEngine,
pub pcm: PcmEngine,
pub se: SeEngine,
pub movie: MovieManager,
pub ids: RuntimeConstants,
pub gfx: GfxRuntime,
pub ui: UiRuntime,
pub font_cache: FontCache,
pub input: InputState,
pub script_input: InputState,
pub screen_w: u32,
pub screen_h: u32,
pub wait: VmWait,
pub net: TnmNet,
pub tables: AssetTables,
pub stack: Vec<Value>,
pub unknown: UnknownOpRecorder,
pub globals: GlobalState,
pub tonecurve: ToneCurveRuntime,
pub excall_state: ExcallCompatState,
pub last_presented_render_list: Vec<RenderSprite>,
pub wipe_front_rt_image: Option<ImageId>,
pub wipe_next_rt_image: Option<ImageId>,
pub overlay_rt_image: Option<ImageId>,
pub external_forms: Option<Arc<dyn ExternalFormHandler>>,
pub native_ui_backend: Option<Arc<dyn NativeUiBackend>>,
pub native_ui: NativeUiRuntime,
pub current_scene_no: Option<i64>,
pub current_scene_name: Option<String>,
pub current_line_no: i64,
pub vm_call: Option<VmCallMeta>,
pub local_save_snapshot: Option<LocalSaveSnapshot>,
pub pending_auto_savepoint: bool,
/* private fields */
}Fields§
§project_dir: PathBuf§images: ImageManager§layers: LayerManager§solid_white: ImageId1x1 white sprite used for screen-space overlays (filters, etc.).
audio: AudioHub§bgm: BgmEngine§koe: KoeEngine§pcm: PcmEngine§se: SeEngine§movie: MovieManager§ids: RuntimeConstantsRuntime numeric constants (form/element/op codes).
gfx: GfxRuntimeGraphics runtime state for stage/object sprite binding.
ui: UiRuntimeUI runtime (text window, message waits, etc.).
font_cache: FontCacheShared font cache for stage/object text rendering.
input: InputStateRuntime-visible input state (button manager, waits, runtime systems).
script_input: InputStateScript-visible input state (Gp_script_input in the original engine).
screen_w: u32Current render target size (used for UI layout).
screen_h: u32§wait: VmWaitVM blocking state (WAIT / WAIT_KEY).
net: TnmNetLightweight network/browser helper mirroring the engine’s tnm_net slot.
tables: AssetTablesGameexe-driven asset tables (CGTABLE / DATABASE / THUMBTABLE).
stack: Vec<Value>Value stack used by form handlers to return results.
unknown: UnknownOpRecorder§globals: GlobalState§tonecurve: ToneCurveRuntime§excall_state: ExcallCompatState§last_presented_render_list: Vec<RenderSprite>Last fully presented scene list before wipe composition.
wipe_front_rt_image: Option<ImageId>Offscreen target image for the front/old stage during dual-source wipes.
wipe_next_rt_image: Option<ImageId>Offscreen target image for the next/new stage during dual-source wipes.
overlay_rt_image: Option<ImageId>Legacy runtime slot for overlay intermediate images. GPU overlay composition now bypasses it.
external_forms: Option<Arc<dyn ExternalFormHandler>>Optional project-provided form handler (game-specific).
native_ui_backend: Option<Arc<dyn NativeUiBackend>>Optional platform-native UI backend used by mobile ports.
native_ui: NativeUiRuntime§current_scene_no: Option<i64>Current scene number tracked by the VM.
current_scene_name: Option<String>Current scene name tracked by the VM.
current_line_no: i64Current source line tracked by the VM (CD_NL).
vm_call: Option<VmCallMeta>Current VM-originated form call metadata. Form handlers read this instead of relying on trailing wrapper arguments.
local_save_snapshot: Option<LocalSaveSnapshot>Engine-equivalent of Gp_eng->m_local_save. Built at GLOBAL_SAVEPOINT and
refreshed by tnm_load_local_on_file-equivalent load. Save-to-file dispatch
reads from here so the saved stream reflects the savepoint, not the live
menu/UI state when the user picks a slot.
pending_auto_savepoint: boolSet when the engine wants the next safe boundary (post-command, pre-next-step)
to (re)build local_save_snapshot. Mirrors C++ tnm_msg_proc_start_msg_block
calling tnm_init_local_save + tnm_set_save_point at message-block start.
Form handlers can’t build the snapshot themselves (they don’t see SceneVm),
so they request via this flag and the VM drains it at a safe point.
Implementations§
Source§impl CommandContext
impl CommandContext
pub fn sync_script_input_from_runtime(&mut self)
pub fn proc_generation(&self) -> u64
pub fn request_read_flag_no(&mut self)
pub fn request_read_flag_no_for_selbtn(&mut self)
pub fn take_read_flag_no_request(&mut self) -> bool
pub fn submit_read_flag_no(&mut self, value: i32)
pub fn request_runtime_save(&mut self, kind: RuntimeSaveKind, index: usize)
Sourcepub fn request_auto_savepoint(&mut self)
pub fn request_auto_savepoint(&mut self)
Form-handler entrypoint matching C++ tnm_msg_proc_start_msg_block’s
tnm_init_local_save + (gated) tnm_set_save_point calls. Honors the
dont_set_save_point script flag (suspends auto SAVEPOINT for special
blocks). The VM drains the request at the next safe boundary and runs
build_local_save_snapshot.
pub fn take_pending_auto_savepoint(&mut self) -> bool
pub fn request_runtime_load(&mut self, kind: RuntimeSaveKind, index: usize)
pub fn take_runtime_save_request(&mut self) -> Option<RuntimeSaveRequest>
pub fn take_runtime_load_request(&mut self) -> Option<RuntimeLoadRequest>
pub fn begin_runtime_load_apply(&mut self)
pub fn mark_runtime_load_completed(&mut self)
pub fn take_runtime_load_completed(&mut self) -> bool
pub fn needs_continuous_frame(&self) -> bool
pub fn last_proc_kind(&self) -> ProcKind
pub fn request_proc_boundary(&mut self, kind: ProcKind)
pub fn request_disp_proc_boundary(&mut self)
pub fn request_message_block_proc_boundary(&mut self)
pub fn request_message_wait_proc_boundary(&mut self)
pub fn request_wait_proc_boundary(&mut self, kind: ProcKind)
pub fn notify_wait_key(&mut self) -> bool
pub fn notify_movie_wait_down_up(&mut self, result: i64) -> bool
pub fn new(project_dir: PathBuf) -> Self
pub fn has_active_custom_mouse_cursor(&mut self) -> bool
pub fn lookup_scene_no(&self, scene_name: &str) -> Result<i64>
pub fn reset_for_scene_restart(&mut self)
Sourcepub fn set_external_form_handler(
&mut self,
h: Option<Arc<dyn ExternalFormHandler>>,
)
pub fn set_external_form_handler( &mut self, h: Option<Arc<dyn ExternalFormHandler>>, )
Install or clear an external form handler.
pub fn platform_shortcuts_blocked(&self) -> bool
pub fn on_key_down(&mut self, k: VmKey)
pub fn on_key_up(&mut self, k: VmKey)
pub fn on_text_input(&mut self, text: &str)
pub fn focused_editbox_ime_area(&self) -> Option<(i32, i32, i32, i32)>
pub fn on_mouse_move(&mut self, x: i32, y: i32)
pub fn on_mouse_down(&mut self, b: VmMouseButton)
pub fn on_mouse_up(&mut self, b: VmMouseButton)
pub fn on_mouse_wheel(&mut self, delta_y: i32)
pub fn wait_poll(&mut self) -> bool
pub fn push(&mut self, v: Value)
pub fn pop(&mut self) -> Option<Value>
pub fn set_native_ui_backend( &mut self, backend: Option<Arc<dyn NativeUiBackend>>, )
Sourcepub fn game_title(&self) -> String
pub fn game_title(&self) -> String
Return the game title for platform UI and runtime dialogs.
The value is read from Gameexe GAMENAME when available. If Gameexe is
missing, undecodable, or the field is empty, this returns the project
directory name, then Siglus as the final fallback.
Sourcepub fn game_display_info(&self) -> GameDisplayInfo
pub fn game_display_info(&self) -> GameDisplayInfo
Return display metadata for platform UI.
If the game directory contains cover.png, cover.jpg, cover.jpeg,
thumbnail.png, or icon.png, cover is populated. Otherwise callers
should display the game name.
Sourcepub fn game_cover(&self) -> Option<GameCover>
pub fn game_cover(&self) -> Option<GameCover>
Return the optional cover for bundle/mobile UI.
pub fn submit_native_messagebox_result(&mut self, request_id: u64, value: i64)
pub fn request_system_messagebox( &mut self, kind: i32, debug_only: bool, text: String, buttons: Vec<SystemMessageBoxButton>, )
pub fn request_system_messagebox_no_return( &mut self, kind: i32, debug_only: bool, text: String, buttons: Vec<SystemMessageBoxButton>, )
pub fn set_screen_size(&mut self, w: u32, h: u32)
pub fn tick_frame(&mut self)
pub fn render_list_with_effects(&mut self) -> Vec<RenderSprite>
pub fn debug_active_texture_entries( &self, submitted: &[RenderSprite], ) -> Vec<DebugActiveTextureEntry>
Sourcepub fn capture_frame_rgba(&mut self) -> RgbaImage
pub fn capture_frame_rgba(&mut self) -> RgbaImage
Capture the current frame (UI + scene) into a CPU RGBA buffer.
Sourcepub fn capture_frame_rgba_until(
&mut self,
end_order: i64,
end_layer: i64,
) -> RgbaImage
pub fn capture_frame_rgba_until( &mut self, end_order: i64, end_layer: i64, ) -> RgbaImage
Capture only sprites up to the original engine order/layer cut line.
Auto Trait Implementations§
impl !Freeze for CommandContext
impl !RefUnwindSafe for CommandContext
impl Send for CommandContext
impl !Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl !UnwindSafe for CommandContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.