MCPcopy Create free account
hub / github.com/PerroEngine/Perro / apply_selected_ui_overlay

Function apply_selected_ui_overlay

perro_editor/res/scripts/ui/editor_ui.rs:4146–4179  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    rect: Option<EditorUiRect>,
)

Source from the content-addressed store, hash-verified

4144 .parse::<usize>()
4145 .ok()
4146}
4147
4148pub fn inspector_var_component_row(name: &str) -> Option<usize> {
4149 let rest = name.strip_prefix("inspector_var_")?;
4150 let (row, component) = rest.split_once('_')?;
4151 let component = component.strip_suffix("_box")?;
4152 if !matches!(component, "0" | "1" | "2" | "3") {
4153 return None;
4154 }
4155 row.parse::<usize>().ok()
4156}
4157
4158pub fn set_log<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>, text: &str) {
4159 let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
4160 state.log = text.to_string();
4161 });
4162 set_label(ctx, "log_text", text);
4163}
4164
4165pub fn tick_script_schema_reload<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) {
4166 let changed = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
4167 if state.script_schema_reload_frames == 0 {
4168 return false;
4169 }
4170 state.script_schema_reload_frames = state.script_schema_reload_frames.saturating_sub(1);
4171 true
4172 })
4173 .unwrap_or(false);
4174 if changed {
4175 let visible = with_state!(ctx.run, EditorState, ctx.id, |state| {
4176 state.script_schema_reload_frames > 0
4177 }).unwrap_or_default();
4178 apply_script_reload_popup(ctx, visible);
4179 }
4180}
4181
4182pub fn apply_script_reload_popup<API: ScriptAPI + ?Sized>(

Callers 1

refresh_scene_pane_viewFunction · 0.85

Calls 3

viewport_window_aspectFunction · 0.85
find_namedFunction · 0.85

Tested by

no test coverage detected