Added selectable container that can be focused with keyboard shortcut.
This commit is contained in:
1 parent
9bf7c3fa6e
commit
948b177eee
7 files changed
+265
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
@tool
|
||||
extends SelectableContainer
|
||||
signal command_requested(command: String)
|
||||
|
||||
@onready var output: RichTextLabel = $Output
|
||||
@onready var command_input: LineEdit = $Command
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
command_input.text_submitted.connect(_submit)
|
||||
|
||||
func _submit(command: String) -> void:
|
||||
if command.strip_edges().is_empty():
|
||||
return
|
||||
append_output("$ " + command + "\n")
|
||||
command_input.clear()
|
||||
if command_requested.get_connections().is_empty():
|
||||
append_output("No SSH transport connected. Command was not sent.\n")
|
||||
else:
|
||||
command_requested.emit(command)
|
||||
|
||||
func append_output(text: String) -> void:
|
||||
output.add_text(text)
|
||||
Reference in new issue
Block a user