Skip to content

Commit 1d5661b

Browse files
committed
Use resource loader for script existence check
Latest versions of godot can produce bytecode `gdc` files on export, so script existence check with FileAccess is not so reliable. ResourceLoader should manage this problem.
1 parent 9f9b621 commit 1d5661b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

addons/panku_console/common/panku_module.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ func _init_module():
8686
var env_script_path = module_script_dir + "/env.gd"
8787
var opt_script_path = module_script_dir + "/opt.gd"
8888

89-
if FileAccess.file_exists(env_script_path):
89+
if ResourceLoader.exists(env_script_path, "GDScript"):
9090
_env = load(env_script_path).new()
9191
_env._module = self
9292
core.gd_exprenv.register_env(get_module_name(), _env)
9393

94-
if FileAccess.file_exists(opt_script_path):
94+
if ResourceLoader.exists(opt_script_path, "GDScript"):
9595
#print(opt_script_path)
9696
_opt = load(opt_script_path).new() as ModuleOptions
9797
_opt._module = self

project.godot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config/description="**Panku Console is a feature-packed real-time debugging tool
1515
1616
Panku Console is designed to be modular and extensible, and it is easy to add and maintain features. It is also designed to be as unobtrusive as possible, so you can use it in your project without worrying about the impact on the final product."
1717
run/main_scene="res://example/main.tscn"
18-
config/features=PackedStringArray("4.2", "Forward Plus")
18+
config/features=PackedStringArray("4.3", "Forward Plus")
1919
boot_splash/bg_color=Color(1, 1, 1, 1)
2020
boot_splash/image="res://example/assets/bootsplash.png"
2121
boot_splash/fullsize=false

0 commit comments

Comments
 (0)