File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
addons/mod_loader/internal Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,30 @@ static func get_file_paths_in_dir(src_dir_path: String) -> Array:
126
126
return file_paths
127
127
128
128
129
+ # Returns an array of directory paths inside the src dir
130
+ static func get_dir_paths_in_dir (src_dir_path : String ) -> Array :
131
+ var dir_paths := []
132
+
133
+ var directory := Directory .new ()
134
+ var error := directory .open (src_dir_path )
135
+
136
+ if not error == OK :
137
+ return dir_paths
138
+ ModLoaderLog .error ("Error opening directory" , LOG_NAME )
139
+
140
+ directory .list_dir_begin ()
141
+ var file_name := directory .get_next ()
142
+ while (file_name != "" ):
143
+ if file_name == "." or file_name == ".." :
144
+ file_name = directory .get_next ()
145
+ continue
146
+ if directory .current_is_dir ():
147
+ dir_paths .push_back (src_dir_path .plus_file (file_name ))
148
+ file_name = directory .get_next ()
149
+
150
+ return dir_paths
151
+
152
+
129
153
# Get the path to the mods folder, with any applicable overrides applied
130
154
static func get_path_to_mods () -> String :
131
155
var mods_folder_path := get_local_folder_dir ("mods" )
You can’t perform that action at this time.
0 commit comments