-
Notifications
You must be signed in to change notification settings - Fork 48
Modding Support #164
base: master
Are you sure you want to change the base?
Modding Support #164
Conversation
var path = "res://addons/" | ||
|
||
var directory := Directory.new() | ||
directory.make_dir(path) | ||
|
||
if not directory.open(path) == OK: | ||
print("Loader: failed to load ", path, ", return [] (open)") | ||
return | ||
|
||
if not directory.list_dir_begin(true, true) == OK: | ||
print("Loader: failed to load ", path, ", return [] (list_dir_begin)") | ||
return | ||
|
||
while true: | ||
var sub_path = directory.get_next() | ||
print(sub_path) | ||
|
||
if sub_path == "." or sub_path == ".." or sub_path.begins_with("_"): | ||
continue | ||
|
||
elif sub_path == "": | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the exact same code as in _load_addons(path) further down in the file. Why is this duplicated?
if (side.controller == Side.Controller.AI): | ||
var ai = Data.AIs[side.ai].new() | ||
add_child(ai) | ||
ai.initialize(side) | ||
AIs[side] = ai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These AI related changes should not be in the PR for mods.
@@ -29,6 +29,7 @@ static func _get_directory_data(path: String, directory_data: Array, extentions: | |||
elif directory.current_is_dir(): | |||
directory_data = _get_directory_data(directory.get_current_dir() + "/" + sub_path, directory_data, extentions, load_resource) | |||
else: | |||
sub_path = sub_path.replace(".import", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when exporting, the raw .pngs aren't kept, so this is a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.