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

Method for_node

perro_editor/res/scripts/ui/editor_ui.rs:1240–1294  ·  view source on GitHub ↗
(doc: &SceneDoc, node: &SceneNodeEntry, state: &EditorState)

Source from the content-addressed store, hash-verified

1238 ctx,
1239 &format!("{prefix}_{idx}_box"),
1240 values.get(idx).map(String::as_str).unwrap_or(""),
1241 );
1242 }
1243}
1244
1245pub fn toggle_inspector_section<API: ScriptAPI + ?Sized>(
1246 ctx: &mut ScriptContext<'_, API>,
1247 section: &str,
1248) {
1249 let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
1250 if let Some(pos) = state
1251 .inspector_collapsed_sections
1252 .iter()
1253 .position(|item| item == section)
1254 {
1255 state.inspector_collapsed_sections.remove(pos);
1256 state.log = format!("inspector expand\n{section}");
1257 } else {
1258 state.inspector_collapsed_sections.push(section.to_string());
1259 state.log = format!("inspector collapse\n{section}");
1260 }
1261 });
1262 refresh_all(ctx);
1263}
1264
1265pub fn inspector_section_collapsed(sections: &[String], section: &str) -> bool {
1266 sections.iter().any(|item| item == section)
1267}
1268
1269#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
1270pub enum RowIndicator {
1271 #[default]
1272 None,
1273 Collapsed,
1274 Expanded,
1275}
1276
1277pub fn inspector_disclosure(collapsed: bool) -> RowIndicator {
1278 if collapsed {
1279 RowIndicator::Collapsed
1280 } else {
1281 RowIndicator::Expanded
1282 }
1283}
1284
1285fn take_inspector_layout_pass<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) -> bool {
1286 with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
1287 if state.inspector_layout_applied {
1288 false
1289 } else {
1290 state.inspector_layout_applied = true;
1291 true
1292 }
1293 })
1294 .unwrap_or(false)
1295}
1296
1297fn ensure_inspector_node_chain<API: ScriptAPI + ?Sized>(

Callers

nothing calls this directly

Calls 14

scene_value_componentsFunction · 0.85
node_chain_partsFunction · 0.85
script_vars_edit_textFunction · 0.85
key_name_or_idMethod · 0.80
cloneMethod · 0.80
apply_asset_actionsMethod · 0.80
as_refMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected