(
ctx: &mut ScriptContext<'_, API>,
name: &str,
align: UiHorizontalAlign,
)
| 4266 | |
| 4267 | pub fn set_text_box<API: ScriptAPI + ?Sized>( |
| 4268 | ctx: &mut ScriptContext<'_, API>, |
| 4269 | name: &str, |
| 4270 | text: &str, |
| 4271 | ) { |
| 4272 | let focused = with_state!(ctx.run, EditorState, ctx.id, |state| { |
| 4273 | state.focused_inspector_box == name |
| 4274 | }).unwrap_or_default(); |
| 4275 | if focused { |
| 4276 | return; |
| 4277 | } |
| 4278 | if let Some(id) = find_named(ctx, name) { |
| 4279 | let text = text.to_string(); |
| 4280 | let _ = with_node_mut!(ctx.run, UiTextBox, id, |node| { |
| 4281 | if node.text.as_ref() != text { |
no test coverage detected