Difficulty based scripts (#623)

Makes possible things like `songs/dadbattle/scripts/erect/`.

* exclusive difficulty scripts

* fixing a small ordering bug + optimization

* actually, allowing both scripts to exist

* im a super fucking dumbass

* SPACES!!!

* suggestion from sen

---------

Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
This commit is contained in:
Hero
2025-05-01 23:45:26 +02:00
committed by GitHub
co-authored by ⍚~Nex
parent 315c5e007c
commit 75e934fd40
+4 -3
View File
@@ -609,10 +609,11 @@ class PlayState extends MusicBeatState
// case "":
// ADD YOUR HARDCODED SCRIPTS HERE!
default:
var scriptsFolders:Array<String> = ['songs/${SONG.meta.name.toLowerCase()}/scripts', 'data/charts/', 'songs/'];
var normal = 'songs/${SONG.meta.name.toLowerCase()}/scripts';
var scriptsFolders:Array<String> = [normal, normal + '/$difficulty/', 'data/charts/', 'songs/'];
for(folder in scriptsFolders) {
for(file in Paths.getFolderContent(folder, true, fromMods ? MODS : BOTH)) {
for (folder in scriptsFolders) {
for (file in Paths.getFolderContent(folder, true, fromMods ? MODS : BOTH)) {
if (folder == 'data/charts/')
Logs.trace('data/charts/ is deprecrated and will be removed in the future. Please move script $file to songs/', WARNING, DARKYELLOW);