mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Use load() rather than preload() for terminal icon
Allows the plugin to load even if resources have not been imported yet. For example, if someone has opened a project with the plugin for the first time. Otherwise, the plugin will fail to load and be disable in the `project.godot` file.
This commit is contained in:
parent
10b9764fb3
commit
cceffd4edf
2 changed files with 4 additions and 6 deletions
|
@ -18,7 +18,9 @@ func _enter_tree():
|
|||
add_custom_type("Asciicast", "Animation", asciicast_script, null)
|
||||
|
||||
var terminal_script = preload("./terminal.gd")
|
||||
var terminal_icon = preload("./nodes/terminal/terminal_icon.svg")
|
||||
var terminal_icon = load(
|
||||
"%s/nodes/terminal/terminal_icon.svg" % get_script().resource_path.get_base_dir()
|
||||
)
|
||||
add_custom_type("Terminal", "Control", terminal_script, terminal_icon)
|
||||
|
||||
if pty_supported:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue