Skip to content

Commit 9a7553e

Browse files
committed
Restore ability to test practices in the editor locally
1 parent 40da50f commit 9a7553e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

utils/SliceParser.gd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,13 @@ static func load_from_script(script_path: String, slice_name: String = "") -> Sc
141141
push_error("Script path must be a resource path: " + script_path)
142142
return null
143143

144-
if not Engine.editor_hint:
144+
var file := File.new()
145+
if not Engine.editor_hint and not file.file_exists(script_path):
146+
# When exporting the game, we need to make copies of GDScript files under a different
147+
# extension because Godot compiles GDScript files to bytecode.
148+
# This means in the web build, files have different extensions, which we handle here.
145149
script_path = script_path.replace(".gd", ".lgd")
146150

147-
var file := File.new()
148151
if file.open(script_path, File.READ) != OK:
149152
push_error("Failed to read script file: " + script_path)
150153
return null

0 commit comments

Comments
 (0)