Skip to content

Commit

Permalink
handle new path requirements for 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krazyjakee committed Jun 19, 2023
1 parent aa7cb64 commit fd94626
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/tbloader/src/toFgd.gd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func remove_attached_scripts(files):
return filtered_files

func get_entity_properties(files = []):
var properties = ["// Generated by Godot FGD Generator https://github.com/krazyjakee/godot-fgd\n\n"]
var properties = []

for file in files:
if file.ends_with(".gd"):
Expand Down Expand Up @@ -248,7 +248,11 @@ func build(entities_dir = "entities"):
var files = remove_attached_scripts(all_files) # Remove attached scripts
var properties = get_entity_properties(files) # Get the properties of each entity

var file = FileAccess.open("Game.fgd", FileAccess.WRITE)
var file = FileAccess.open("res://Game.fgd", FileAccess.WRITE)
if !file:
push_error("Failed to open/create Game.fgd!")
return

for property in properties:
if property:
file.store_string(property)
Expand Down

0 comments on commit fd94626

Please sign in to comment.