diff --git a/tracks/base.gd b/tracks/base.gd index 37eee4f..979cd9e 100644 --- a/tracks/base.gd +++ b/tracks/base.gd @@ -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() diff --git a/tracks/exampleautoload.gd b/tracks/exampleautoload.gd index ea10cbc..2c6d33c 100644 --- a/tracks/exampleautoload.gd +++ b/tracks/exampleautoload.gd @@ -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