(
ctx: &mut ScriptContext<'_, API>,
name: &str,
visible: bool,
)
| 4223 | node.text_size_ratio = 0.36; |
| 4224 | node.color = Color::from_hex(theme::TEXT).unwrap_or(node.color); |
| 4225 | node.visible = false; |
| 4226 | node.input_enabled = false; |
| 4227 | }); |
| 4228 | } |
| 4229 | |
| 4230 | pub fn set_label<API: ScriptAPI + ?Sized>( |
| 4231 | ctx: &mut ScriptContext<'_, API>, |
| 4232 | name: &str, |
| 4233 | text: &str, |
| 4234 | ) { |
| 4235 | if let Some(id) = find_named(ctx, name) { |
| 4236 | let _ = with_node_mut!(ctx.run, UiLabel, id, |node| { |
| 4237 | if node.text.as_ref() != text { |
| 4238 | node.set_text(text.to_string()); |
| 4239 | } |
no test coverage detected