Further progress towards Godot 4.0 support

- Primary example scenes (menu, terminal, and asciicast) working but
  still a lot of warning/error messages and some regressions.
- Editor integrated terminal works, but still a lot of warning/error
  messages and some regressions.
- Added support for "blink" display attribute.
- Removed GDScript terminal code. Terminal node is now purely a
  GDExtension. So is LibuvUtils.
- GUT tests not working yet.
- Still a lot of things to fix.
- So far, only built for and manually tested on Linux x86_64.
This commit is contained in:
Leroy Hopson 2023-01-08 22:41:48 +13:00
parent aad8e39dae
commit ad7f97e493
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
30 changed files with 1385 additions and 1459 deletions

View file

@ -42,11 +42,11 @@ var offset: int
func _ready():
if not $Terminal.is_connected("key_pressed",Callable(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",Callable(self,"_on_Terminal_key_pressed"))
$Terminal.connect("key_pressed", Callable(self, "_on_Terminal_key_pressed"))
# warning-ignore:return_value_discarded
$Terminal.connect("size_changed",Callable(self,"draw_all"))
$Terminal.connect("size_changed", Callable(self, "draw_all"))
$Terminal.grab_focus()
draw_all()
@ -134,7 +134,10 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
"Asciicast":
var scene = item.scene.instantiate()
var animation_player: AnimationPlayer = scene.get_node("AnimationPlayer")
scene.connect("key_pressed",Callable(self,"_on_Asciicast_key_pressed").bind(animation_player))
scene.connect(
"key_pressed",
Callable(self, "_on_Asciicast_key_pressed").bind(animation_player)
)
add_child(scene)
scene.grab_focus()
await animation_player.animation_finished
@ -163,7 +166,7 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
pass
# FIXME
#if OS.has_feature("JavaScript"):
#JavaScript.eval("window.history.back() || window.close()")
#JavaScript.eval("window.history.back() || window.close()")
#get_tree().quit()

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://brjrtf5fpptw8"]
[ext_resource type="Script" path="res://addons/godot_xterm/terminal.gd" id="1"]
[ext_resource type="Script" path="res://examples/menu/menu.gd" id="2"]
[ext_resource type="Theme" uid="uid://b7vd50tw2g1nl" path="res://themes/default.tres" id="2_o1653"]
[node name="Menu" type="Control"]
layout_mode = 3
@ -12,13 +12,11 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2")
[node name="Terminal" type="Control" parent="."]
[node name="Terminal" type="Terminal" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 1
script = ExtResource("1")
copy_on_selection = false
theme = ExtResource("2_o1653")