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

Function parent_node_rank

perro_editor/res/scripts/scene/editor_nodes.rs:1259–1268  ·  view source on GitHub ↗
(kind: Option<&str>, node_type: perro_scene::NodeType)

Source from the content-addressed store, hash-verified

1257pub fn push_recent_node_type(state: &mut EditorState, node_type: &str) {
1258 state.recent_node_types.retain(|item| item != node_type);
1259 state.recent_node_types.insert(0, node_type.to_string());
1260 state.recent_node_types.truncate(8);
1261}
1262
1263pub fn recent_node_rank(state: &EditorState, node_type: &str) -> Option<usize> {
1264 state
1265 .recent_node_types
1266 .iter()
1267 .position(|item| item == node_type)
1268}
1269
1270pub fn active_asset_node_type(state: &EditorState) -> Option<&'static str> {
1271 if state.active_asset_path.is_empty() || state.active_asset_path.ends_with('/') {

Callers 2

picker_node_typesFunction · 0.85
picker_node_rowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected