cleaned up interaction code
This commit is contained in:
@@ -38,20 +38,19 @@ func reset_blink() -> void:
|
||||
|
||||
# --- Input Handling ---
|
||||
func InputChar(input) -> void:
|
||||
var charPos = terminalLine.get_character_bounds(max(0, terminalLine.text.length() - 1))
|
||||
if input == null:
|
||||
return
|
||||
if charPos.end.x > 1600:
|
||||
pass
|
||||
else:
|
||||
command = input
|
||||
terminalLine.text += command
|
||||
UpdateCaretPos()
|
||||
await get_tree().create_timer(.01).timeout
|
||||
reset_blink()
|
||||
func InputDelChar() -> void:
|
||||
if terminalLine.text.length() > ("user@work " + directory).length() + 1:
|
||||
terminalLine.text = terminalLine.text.left(-1)
|
||||
UpdateCaretPos()
|
||||
await get_tree().create_timer(.01).timeout
|
||||
reset_blink()
|
||||
|
||||
func EnterCommand() -> void:
|
||||
@@ -199,7 +198,7 @@ func ScrollUp():
|
||||
|
||||
await get_tree().create_timer(.0001).timeout
|
||||
scroll.set_deferred("scroll_vertical", scroll.get_v_scroll_bar().value - 10 )
|
||||
call("ScrollUp")
|
||||
call_deferred("ScrollUp")
|
||||
|
||||
|
||||
func ScrollDown():
|
||||
@@ -207,7 +206,7 @@ func ScrollDown():
|
||||
|
||||
await get_tree().create_timer(.0001).timeout
|
||||
scroll.set_deferred("scroll_vertical", scroll.get_v_scroll_bar().value + 10 )
|
||||
call("ScrollDown")
|
||||
call_deferred("ScrollDown")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user