Godot 4 automatic changes

This commit is contained in:
Daniel Inkpen 2022-11-09 20:57:46 +00:00
parent 8b5caafbc7
commit cdbf3f2adc
75 changed files with 1034 additions and 952 deletions

View file

@ -1,4 +1,4 @@
tool
@tool
extends Control
# This scene demonstrates how we can control the Terminal node directly by
# sending and receiving strings and ANSI escape sequences to the terminal
@ -38,15 +38,15 @@ var row: int
var menu_start_row: int
var offset: int
onready var tput = TPut.new($Terminal)
@onready var tput = TPut.new($Terminal)
func _ready():
if not $Terminal.is_connected("key_pressed", self, "_on_Terminal_key_pressed"):
if not $Terminal.is_connected("key_pressed",Callable(self,"_on_Terminal_key_pressed")):
# warning-ignore:return_value_discarded
$Terminal.connect("key_pressed", self, "_on_Terminal_key_pressed")
$Terminal.connect("key_pressed",Callable(self,"_on_Terminal_key_pressed"))
# warning-ignore:return_value_discarded
$Terminal.connect("size_changed", self, "draw_all")
$Terminal.connect("size_changed",Callable(self,"draw_all"))
$Terminal.grab_focus()
draw_all()
@ -132,12 +132,12 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
match item.name:
"Asciicast":
var scene = item.scene.instance()
var scene = item.scene.instantiate()
var animation_player: AnimationPlayer = scene.get_node("AnimationPlayer")
scene.connect("key_pressed", self, "_on_Asciicast_key_pressed", [animation_player])
scene.connect("key_pressed",Callable(self,"_on_Asciicast_key_pressed").bind(animation_player))
add_child(scene)
scene.grab_focus()
yield(animation_player, "animation_finished")
await animation_player.animation_finished
remove_child(scene)
$Terminal.grab_focus()
scene.queue_free()
@ -148,15 +148,15 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
(
"Psuedoterminal node currently"
+ " uses pty.h but needs to use either winpty or conpty"
+ " to work on Windows."
+ " to work checked Windows."
),
"Terminal not Supported on Windows"
"Terminal not Supported checked Windows"
)
var scene = item.scene.instance()
var scene = item.scene.instantiate()
var pty = scene if OS.has_feature("JavaScript") else scene.get_node("PTY")
add_child(scene)
scene.grab_focus()
yield(pty, "exited")
await pty.exited
$Terminal.grab_focus()
scene.queue_free()
"Exit":