(kind: Option<&str>, node_type: perro_scene::NodeType)
| 1257 | pub 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 | |
| 1263 | pub 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 | |
| 1270 | pub fn active_asset_node_type(state: &EditorState) -> Option<&'static str> { |
| 1271 | if state.active_asset_path.is_empty() || state.active_asset_path.ends_with('/') { |
no outgoing calls
no test coverage detected