From 767466589cbee32aa875eed99a40419309cc20cb Mon Sep 17 00:00:00 2001 From: Til Tjardes Date: Sat, 14 Dec 2024 11:43:14 -0700 Subject: [PATCH] better listInstrumentalAltIds to support mods --- preload/scripts/songs/blammed.hxc | 24 ++++++++++++------------ preload/scripts/songs/bopeebo.hxc | 26 +++++++++++++------------- preload/scripts/songs/dadbattle.hxc | 23 +++++++++++++---------- preload/scripts/songs/eggnog.hxc | 27 +++++++++++++++------------ preload/scripts/songs/fresh.hxc | 23 +++++++++++++---------- preload/scripts/songs/guns.hxc | 23 +++++++++++++---------- preload/scripts/songs/philly-nice.hxc | 23 +++++++++++++---------- preload/scripts/songs/pico.hxc | 23 +++++++++++++---------- preload/scripts/songs/south.hxc | 23 +++++++++++++---------- preload/scripts/songs/spookeez.hxc | 23 +++++++++++++---------- preload/scripts/songs/ugh.hxc | 23 +++++++++++++---------- 11 files changed, 144 insertions(+), 117 deletions(-) diff --git a/preload/scripts/songs/blammed.hxc b/preload/scripts/songs/blammed.hxc index 83f1f5e6..930b4cff 100644 --- a/preload/scripts/songs/blammed.hxc +++ b/preload/scripts/songs/blammed.hxc @@ -28,20 +28,20 @@ class BlammedSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') + if(variationId == 'default') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } - } - return []; + return toReturn; + } + else + { + return []; + } } } diff --git a/preload/scripts/songs/bopeebo.hxc b/preload/scripts/songs/bopeebo.hxc index 0b2d686f..b415312d 100644 --- a/preload/scripts/songs/bopeebo.hxc +++ b/preload/scripts/songs/bopeebo.hxc @@ -26,20 +26,20 @@ class BopeeboSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } - } - return []; + return toReturn; + } + else + { + return []; + } } } diff --git a/preload/scripts/songs/dadbattle.hxc b/preload/scripts/songs/dadbattle.hxc index d7366630..623ca490 100644 --- a/preload/scripts/songs/dadbattle.hxc +++ b/preload/scripts/songs/dadbattle.hxc @@ -27,17 +27,20 @@ class DadBattleSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/eggnog.hxc b/preload/scripts/songs/eggnog.hxc index 16cc28dc..f1b99961 100644 --- a/preload/scripts/songs/eggnog.hxc +++ b/preload/scripts/songs/eggnog.hxc @@ -53,18 +53,21 @@ class EggnogSong extends Song } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; - } - } + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); + } + + return toReturn; + } + else + { + return []; + } } public override function onSongEnd(event:CountdownScriptEvent):Void { diff --git a/preload/scripts/songs/fresh.hxc b/preload/scripts/songs/fresh.hxc index 94ff5914..0b361654 100644 --- a/preload/scripts/songs/fresh.hxc +++ b/preload/scripts/songs/fresh.hxc @@ -28,17 +28,20 @@ class FreshSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/guns.hxc b/preload/scripts/songs/guns.hxc index ab9f7277..3a483d76 100644 --- a/preload/scripts/songs/guns.hxc +++ b/preload/scripts/songs/guns.hxc @@ -22,17 +22,20 @@ class GunsSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } diff --git a/preload/scripts/songs/philly-nice.hxc b/preload/scripts/songs/philly-nice.hxc index e127a48f..1308b709 100644 --- a/preload/scripts/songs/philly-nice.hxc +++ b/preload/scripts/songs/philly-nice.hxc @@ -27,17 +27,20 @@ class PhillyNiceSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/pico.hxc b/preload/scripts/songs/pico.hxc index 9e8d8838..cc5584ae 100644 --- a/preload/scripts/songs/pico.hxc +++ b/preload/scripts/songs/pico.hxc @@ -27,17 +27,20 @@ class PhillyNiceSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/south.hxc b/preload/scripts/songs/south.hxc index 567de25a..c09dd9ef 100644 --- a/preload/scripts/songs/south.hxc +++ b/preload/scripts/songs/south.hxc @@ -27,17 +27,20 @@ class SouthSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/spookeez.hxc b/preload/scripts/songs/spookeez.hxc index 6a4bafeb..04b3055a 100644 --- a/preload/scripts/songs/spookeez.hxc +++ b/preload/scripts/songs/spookeez.hxc @@ -27,17 +27,20 @@ class SpookeezSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } } } diff --git a/preload/scripts/songs/ugh.hxc b/preload/scripts/songs/ugh.hxc index c60753cf..65705803 100644 --- a/preload/scripts/songs/ugh.hxc +++ b/preload/scripts/songs/ugh.hxc @@ -15,17 +15,20 @@ class UghSong extends Song { } public override function listAltInstrumentalIds(difficultyId:String, variationId:String):Array { - if (difficultyId == 'easy' || difficultyId == 'normal' || difficultyId == 'hard') { - var hasBeatenPicoMix = Save.instance.hasBeatenSong(this.id, null, 'pico'); - - switch (variationId) { - case 'pico': - // return hasBeatenPicoMix ? [''] : []; - // No Pico mix on BF instrumental, sorry! - return []; - default: - return hasBeatenPicoMix ? ['pico'] : []; + if(variationId == 'default') + { + var toReturn:Array = []; + for(variation in super.listAltInstrumentalIds(difficultyId, variationId)) + { + if(Save.instance.hasBeatenSong(this.id, null, variation)) + toReturn.push(variation); } + + return toReturn; + } + else + { + return []; } }