Use relative rather than absolute paths

This should allow GodotXterm be installed in locations other than
`addons/godot_xterm`.
This commit is contained in:
Leroy Hopson 2021-07-15 21:30:09 +07:00
parent 18d25579fd
commit 30807f1436
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
3 changed files with 9 additions and 8 deletions

View file

@ -1,5 +1,5 @@
tool tool
extends "res://addons/godot_xterm/nodes/terminal/terminal.gd" extends "../../nodes/terminal/terminal.gd"
signal exited(exit_code, signum) signal exited(exit_code, signum)

View file

@ -1,7 +1,7 @@
tool tool
extends EditorImportPlugin extends EditorImportPlugin
const Asciicast = preload("res://addons/godot_xterm/resources/asciicast.gd") const Asciicast = preload("../resources/asciicast.gd")
func get_importer_name(): func get_importer_name():

View file

@ -7,22 +7,23 @@ var terminal_panel: Control
func _enter_tree(): func _enter_tree():
asciicast_import_plugin = preload("res://addons/godot_xterm/import_plugins/asciicast_import_plugin.gd").new() asciicast_import_plugin = preload("./import_plugins/asciicast_import_plugin.gd").new()
add_import_plugin(asciicast_import_plugin) add_import_plugin(asciicast_import_plugin)
var asciicast_script = preload("res://addons/godot_xterm/resources/asciicast.gd") var asciicast_script = preload("./resources/asciicast.gd")
add_custom_type("Asciicast", "Animation", asciicast_script, null) add_custom_type("Asciicast", "Animation", asciicast_script, null)
var terminal_script = preload("res://addons/godot_xterm/nodes/terminal/terminal.gd") var terminal_script = preload("./nodes/terminal/terminal.gd")
var terminal_icon = preload("res://addons/godot_xterm/nodes/terminal/terminal_icon.svg") var terminal_icon = preload("./nodes/terminal/terminal_icon.svg")
add_custom_type("Terminal", "Control", terminal_script, terminal_icon) add_custom_type("Terminal", "Control", terminal_script, terminal_icon)
if pty_supported: if pty_supported:
var pty_icon = load("res://addons/godot_xterm/nodes/pty/pty_icon.svg") var base_dir = get_script().resource_path.get_base_dir()
var pty_icon = load("%s/nodes/pty/pty_icon.svg" % base_dir)
var pty_script var pty_script
match OS.get_name(): match OS.get_name():
"X11", "Server", "OSX": "X11", "Server", "OSX":
pty_script = load("res://addons/godot_xterm/nodes/pty/unix/pty_unix.gd") pty_script = load("%s/nodes/pty/unix/pty_unix.gd" % base_dir)
add_custom_type("PTY", "Node", pty_script, pty_icon) add_custom_type("PTY", "Node", pty_script, pty_icon)
var terminal_settings_script = preload("./editor_plugins/terminal/settings/terminal_settings.gd") var terminal_settings_script = preload("./editor_plugins/terminal/settings/terminal_settings.gd")
add_custom_type("TerminalSettings", "Resource", terminal_settings_script, null) add_custom_type("TerminalSettings", "Resource", terminal_settings_script, null)