mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01: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
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -185,11 +185,7 @@ jobs:
|
||||||
path: addons/godot_xterm/native/bin
|
path: addons/godot_xterm/native/bin
|
||||||
- name: Import assets
|
- name: Import assets
|
||||||
shell: bash
|
shell: bash
|
||||||
# The GodotXterm plugin will be disabled the first time we run the editor as resources that it depends
|
run: godot --editor .github/import_assets.tscn
|
||||||
# (e.g. icons) will not have been imported yet so the plugin will fail to load. Without the plugin
|
|
||||||
# enabled resources imported by GodotXterm import plugins (e.g. .cast) will not be imported. Therefore,
|
|
||||||
# we need to re-enable the plugin by checking out project.godot and running the editor again.
|
|
||||||
run: godot --editor .github/import_assets.tscn && git checkout project.godot && godot --editor .github/import_assets.tscn
|
|
||||||
- name: Export HTML5
|
- name: Export HTML5
|
||||||
run: godot --no-window --export HTML5
|
run: godot --no-window --export HTML5
|
||||||
- name: NPM cache
|
- name: NPM cache
|
||||||
|
|
|
@ -18,7 +18,9 @@ func _enter_tree():
|
||||||
add_custom_type("Asciicast", "Animation", asciicast_script, null)
|
add_custom_type("Asciicast", "Animation", asciicast_script, null)
|
||||||
|
|
||||||
var terminal_script = preload("./terminal.gd")
|
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)
|
add_custom_type("Terminal", "Control", terminal_script, terminal_icon)
|
||||||
|
|
||||||
if pty_supported:
|
if pty_supported:
|
||||||
|
|
Loading…
Reference in a new issue