pub struct UiRuntime {
pub mwnd: MwndRuntime,
pub mwnd_instances: HashMap<(u32, i64, usize), Box<UiRuntime>>,
pub primary_mwnd_key: Option<(u32, i64, usize)>,
pub sys: SysOverlayRuntime,
pub msg_back: MsgBackRuntime,
pub editbox: EditBoxOverlayRuntime,
/* private fields */
}Fields§
§mwnd: MwndRuntime§mwnd_instances: HashMap<(u32, i64, usize), Box<UiRuntime>>§primary_mwnd_key: Option<(u32, i64, usize)>§sys: SysOverlayRuntime§msg_back: MsgBackRuntime§editbox: EditBoxOverlayRuntimeImplementations§
Source§impl UiRuntime
impl UiRuntime
pub fn set_text_colors( &mut self, text_color: (u8, u8, u8), shadow_color: (u8, u8, u8), )
pub fn set_text_colors_full( &mut self, text_color: (u8, u8, u8), shadow_color: (u8, u8, u8), fuchi_color: Option<(u8, u8, u8)>, )
pub fn set_mwnd_text_colors_full( &mut self, msg_text_color: (u8, u8, u8), msg_shadow_color: (u8, u8, u8), msg_fuchi_color: Option<(u8, u8, u8)>, name_text_color: (u8, u8, u8), name_shadow_color: (u8, u8, u8), name_fuchi_color: Option<(u8, u8, u8)>, )
pub fn current_mwnd_window_render_state( &self, screen_w: u32, screen_h: u32, ) -> Option<MwndWindowRenderState>
Sourcepub fn sync_layout(&mut self, layers: &mut LayerManager, w: u32, h: u32)
pub fn sync_layout(&mut self, layers: &mut LayerManager, w: u32, h: u32)
Ensure fixed UI sprites exist and are laid out for the given screen size.
Sourcepub fn tick(
&mut self,
layers: &mut LayerManager,
images: &mut ImageManager,
project_dir: &Path,
w: u32,
h: u32,
script: &ScriptRuntimeState,
syscom: &SyscomRuntimeState,
editbox_lists: &HashMap<u32, EditBoxListState>,
focused_editbox: Option<(u32, usize)>,
)
pub fn tick( &mut self, layers: &mut LayerManager, images: &mut ImageManager, project_dir: &Path, w: u32, h: u32, script: &ScriptRuntimeState, syscom: &SyscomRuntimeState, editbox_lists: &HashMap<u32, EditBoxListState>, focused_editbox: Option<(u32, usize)>, )
Called once per frame to update UI and apply visibility.
pub fn mwnd_reveal_counts(&self) -> Vec<((u32, i64, usize), usize)>
pub fn apply_mwnd_projection_set( &mut self, projections: Vec<((u32, i64, usize), MwndProjectionState)>, preferred: Option<(u32, i64, usize)>, )
Sourcepub fn mwnd_base_sorter_for_ui_layer(
&self,
layer_id: Option<LayerId>,
) -> Option<(i32, i32)>
pub fn mwnd_base_sorter_for_ui_layer( &self, layer_id: Option<LayerId>, ) -> Option<(i32, i32)>
Return the C_elm_mwnd sorter used by C_elm_stage::get_sprite_tree() to include or exclude the complete message-window tree from a WIPE range. Individual MWND sprites use layer repetitions for drawing, but WIPE selection is based on this unmodified window sorter.
pub fn mwnd_sorter_for_ui_layer( &self, layer_id: Option<LayerId>, sentinel_order: i32, waku_rep: i64, filter_rep: i64, face_rep: i64, shadow_rep: i64, fuchi_rep: i64, moji_rep: i64, ) -> Option<(i32, i32)>
Sourcepub fn mwnd_owner_for_ui_layer(
&self,
layer_id: Option<LayerId>,
) -> Option<(u32, i64)>
pub fn mwnd_owner_for_ui_layer( &self, layer_id: Option<LayerId>, ) -> Option<(u32, i64)>
Resolve the stage that owns a message-window UI layer.
FRONT and NEXT message windows are materialized as independent
UiRuntime instances. Their sprites live in the generic
LayerManager, so render-list construction must explicitly filter them
by selected stage; otherwise both copies are submitted into both wipe
scene textures.
pub fn mwnd_stage_for_ui_layer(&self, layer_id: Option<LayerId>) -> Option<i64>
Sourcepub fn clear_mwnd_stage_projection(
&mut self,
layers: &mut LayerManager,
form_id: u32,
stage_idx: i64,
)
pub fn clear_mwnd_stage_projection( &mut self, layers: &mut LayerManager, form_id: u32, stage_idx: i64, )
Immediately discard every projected MWND instance owned by one stage.
Logical MwndState and the UI projection are separate in this port.
C_elm_stage::reinit(false) destroys the NEXT MWND sprite trees
synchronously, so waiting for the next projection-sync tick would leave
one stale NEXT texture available to a newly started wipe.
pub fn tick_additional_mwnds( &mut self, layers: &mut LayerManager, images: &mut ImageManager, project_dir: &Path, w: u32, h: u32, script: &ScriptRuntimeState, syscom: &SyscomRuntimeState, )
pub fn set_message_bg(&mut self, img: ImageHandle)
pub fn show_message_bg(&mut self, on: bool)
pub fn force_message_bg_visible(&mut self, on: bool)
pub fn begin_mwnd_open(&mut self, anime_type: i64, duration_ms: i64)
pub fn begin_mwnd_close(&mut self, anime_type: i64, duration_ms: i64)
pub fn finish_mwnd_animation(&mut self)
pub fn set_message_filter(&mut self, img: Option<ImageHandle>)
pub fn apply_mwnd_projection(&mut self, proj: &MwndProjectionState)
pub fn set_mwnd_window_state( &mut self, window_pos: Option<(i64, i64)>, window_size: Option<(i64, i64)>, message_pos: Option<(i64, i64)>, message_margin: Option<(i64, i64, i64, i64)>, window_moji_cnt: Option<(i64, i64)>, moji_size: Option<i64>, moji_space: Option<(i64, i64)>, mwnd_extend_type: i64, moji_color: Option<i64>, shadow_color: Option<i64>, fuchi_color: Option<i64>, face_file: Option<&str>, face_no: i64, rep_pos: Option<(i64, i64)>, slide_enabled: bool, slide_time: i64, vertical_writing: bool, name_extend_type: i64, name_window_align: i64, name_window_pos: (i64, i64), name_window_size: (i64, i64), name_window_rect: (i64, i64, i64, i64), name_message_pos: (i64, i64), name_message_pos_rep: (i64, i64), name_message_margin: (i64, i64, i64, i64), )
pub fn clear_mwnd_window_state(&mut self)
pub fn set_message(&mut self, msg: String)
pub fn append_message(&mut self, msg: &str)
pub fn append_linebreak(&mut self)
pub fn set_name(&mut self, name: String)
pub fn clear_name(&mut self)
pub fn clear_message(&mut self)
pub fn begin_message_reveal_wait(&mut self)
pub fn finish_message_reveal_wait(&mut self)
pub fn begin_wait_message(&mut self)
pub fn begin_wait_page_message(&mut self)
pub fn reveal_message_now(&mut self)
pub fn message_wait_text_fully_revealed(&self) -> bool
pub fn message_waiting(&self) -> bool
pub fn message_visible_chars(&self) -> usize
pub fn message_wait_message_len(&self) -> usize
pub fn needs_continuous_frame( &self, script: &ScriptRuntimeState, syscom: &SyscomRuntimeState, ) -> bool
pub fn end_wait_message(&mut self) -> MessageWaitClearAction
pub fn request_clear_message_on_wait_end(&mut self)
pub fn request_novel_clear_message_on_wait_end(&mut self)
pub fn set_sys_overlay(&mut self, active: bool, text: String)
Sourcepub fn sys_overlay_metrics(&self) -> Option<(usize, f32, f32)>
pub fn sys_overlay_metrics(&self) -> Option<(usize, f32, f32)>
Geometry of the drawn system overlay text: (line_count, line_pitch, top_y).
None when the overlay is not showing or has not been laid out yet; callers
then have to fall back to their own estimate.
pub fn message_text(&self) -> Option<&str>
pub fn name_text(&self) -> Option<&str>
pub fn auto_advance_due( &self, script: &ScriptRuntimeState, syscom: &SyscomRuntimeState, ) -> bool
pub fn set_msg_back_projection( &mut self, projection: Option<MsgBackUiProjection>, )
pub fn msg_back_slider_size(&self) -> Option<(u32, u32)>
pub fn msg_back_slider_screen_pos(&self) -> Option<(i32, i32)>
pub fn msg_back_hit_action(&self, x: i32, y: i32) -> Option<MsgBackHitAction>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UiRuntime
impl !UnwindSafe for UiRuntime
impl Freeze for UiRuntime
impl Send for UiRuntime
impl Sync for UiRuntime
impl Unpin for UiRuntime
impl UnsafeUnpin for UiRuntime
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.