From 7c3d5f76f3f1277cbb237953185e486e45d4bb37 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Tue, 20 Jul 2021 13:25:12 +0700 Subject: [PATCH] Make compatible with Godot v3.2 But still only officially support v3.3+ --- addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd | 5 ++++- addons/godot_xterm/nodes/pty/unix/pty_unix.gd | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd b/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd index fbd704c..e00a46a 100644 --- a/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd +++ b/addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd @@ -67,7 +67,10 @@ func _load_or_create_settings() -> void: func _update_settings() -> void: _load_or_create_settings() - var editor_scale: float = editor_interface.get_editor_scale() + var editor_scale: float = 1.0 + if editor_interface.has_method("get_editor_scale"): + editor_scale = editor_interface.get_editor_scale() + rect_min_size = Vector2(0, tabbar_container.rect_size.y + 182) * editor_scale rect_size.y = 415 diff --git a/addons/godot_xterm/nodes/pty/unix/pty_unix.gd b/addons/godot_xterm/nodes/pty/unix/pty_unix.gd index 44d207a..3f0fdf5 100644 --- a/addons/godot_xterm/nodes/pty/unix/pty_unix.gd +++ b/addons/godot_xterm/nodes/pty/unix/pty_unix.gd @@ -70,7 +70,7 @@ func fork( # Exit callback. _exit_cb = FuncRef.new() _exit_cb.set_instance(self) - _exit_cb.function = "_on_exit" + _exit_cb.set_function("_on_exit") # Actual fork. var result = PTYUnix.new().fork( # VERY IMPORTANT: The must be set null or 0, otherwise will get an ENOTSOCK error after connecting our pipe to the fd.