A5. Controller source: lines 141-175
Command submission and text cleanup.
func dismiss_reply() -> void:
pending_reply = false
Runtime.hide_gui("reply_card")
var focused: Control = get_viewport().gui_get_focus_owner()
if focused != null:
focused.release_focus()
if text_mode():
focus_command()func presentation() -> void:
Runtime.variables["ta_text_mode"] = not text_mode()
screen_signature = ""
sync_view()
Runtime.state_changed()func run() -> void:
await send(str(context.get("command", "help")))func send(command: String) -> void:
if busy or pending_reply:
return
var cleaned: String = clean(command)
if cleaned.is_empty():
return
busy = true
Runtime.variables["ta_last"] = command
for element_id: String in ["text_command", "graph_command"]:
var field: LineEdit = control(element_id) as LineEdit
if is_instance_valid(field):
field.clear()
if not text_mode():
field.release_focus()
append_line("> " + command.strip_edges())
await execute_command(cleaned)
Runtime.state_changed()Continue directly with the next source block.
