Remove file names automatically from autoloads

This commit is contained in:
Ategon 2024-08-27 18:55:22 -04:00
parent 65e3b47865
commit 33f28268cd
2 changed files with 3 additions and 3 deletions

View file

@ -20,10 +20,10 @@ func get_tracks():
while file_name != "":
if not dir.current_is_dir() and not file_name.ends_with(".import"):
var track_name = file_name.rsplit(".", true, 1)[0]
var regex = RegEx.new()
regex.compile(_autoload.pattern)
var result = regex.search(file_name)
var track_name = file_name
var result = regex.search(track_name)
if result:
track_name = result.get_string()

View file

@ -15,7 +15,7 @@ func _init():
_autoload = {
"path": "res://music/example",
"pattern": "^[^.]+"
"pattern": ".*"
}
# You can still override things using a _tracks variable and the track set to the path to the file for what you want to override