diff --git a/assets/data/charts/test/modchart.hx b/assets/data/charts/test/modchart.hx index 26f274aa..45b9d362 100644 --- a/assets/data/charts/test/modchart.hx +++ b/assets/data/charts/test/modchart.hx @@ -1,7 +1,7 @@ function create() { importScript("data/scripts/pixel"); pixelNotesForBF = false; - enablePixelUI = false; + enablePixelUI = true; } function updatePost(elapsed) { diff --git a/assets/data/scripts/pixel.hx b/assets/data/scripts/pixel.hx index dc811ac7..c21c2bf0 100644 --- a/assets/data/scripts/pixel.hx +++ b/assets/data/scripts/pixel.hx @@ -1,5 +1,3 @@ -import flixel.FlxCamera.FlxCameraFollowStyle; - public var pixelNotesForBF = true; public var pixelNotesForDad = true; public var enablePixelUI = true; diff --git a/assets/data/scripts/week6-pause.hx b/assets/data/scripts/week6-pause.hx index a150a69e..2b97c5aa 100644 --- a/assets/data/scripts/week6-pause.hx +++ b/assets/data/scripts/week6-pause.hx @@ -100,7 +100,7 @@ function update(elapsed) { if (controls.ACCEPT) { FlxG.sound.play(Paths.sound('pixel/clickText')); - var option = menuItems[curSelected] + var option = menuItems[curSelected]; if (option == "Resume" || option == "Exit to menu") { canDoShit = false; for(t in texts) t.visible = false; diff --git a/buildnumber.txt b/buildnumber.txt index 646782c3..a899ac6c 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1157 \ No newline at end of file +1160 \ No newline at end of file diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 3f8a8a3c..aeaf5cde 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -384,7 +384,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom public function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0, Context:PlayAnimContext = NONE):Void { - var event = new PlayAnimEvent(AnimName, Force, Reversed, Frame); + var event = new PlayAnimEvent(AnimName, Force, Reversed, Frame, Context); script.call("onPlayAnim", [event]); @@ -400,7 +400,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom offset.set(globalOffset.x * (isPlayer != playerOffsets ? 1 : -1), -globalOffset.y); - if (event.animName.startsWith("sing")) + if (event.context != DANCE) lastHit = Conductor.songPosition; if (curCharacter == 'gf') diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 78673ea6..6b55e7f4 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -720,7 +720,7 @@ class PlayState extends MusicBeatState // TODO: Cancellable Discord Update Presence #if desktop // Song duration in a float, useful for the time left feature - songLength = FlxG.sound.music.length; + songLength = inst.length; // Updating Discord Rich Presence (with Time Left) DiscordClient.changePresence(detailsText, SONG.song + " (" + difficultyText + ")", iconRPC, true, songLength); diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index 9b4b4334..8bfe19d2 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -161,7 +161,7 @@ class FreeplayState extends MusicBeatState { super.update(elapsed); - if (FlxG.sound.music.volume < 0.7) + if (FlxG.sound.music != null && FlxG.sound.music.volume < 0.7) { FlxG.sound.music.volume += 0.5 * FlxG.elapsed; } @@ -336,7 +336,7 @@ class SongMetadata if (difficulties != null && difficulties.length > 0) { this.difficulties = difficulties; } else { - this.difficulties = difficulties = [for(f in Paths.getFolderContent('data/charts/${song}/')) if (Path.extension(f = f.toUpperCase()) == "JSON") Path.withoutExtension(f)]; + this.difficulties = difficulties = [for(f in Paths.getFolderContent('data/charts/${song}/', false)) if (Path.extension(f = f.toUpperCase()) == "JSON") Path.withoutExtension(f)]; if (difficulties.length == 3) { var hasHard = false, hasNormal = false, hasEasy = false; for(d in difficulties) { diff --git a/source/funkin/scripting/events/PlayAnimEvent.hx b/source/funkin/scripting/events/PlayAnimEvent.hx index 7d027651..08e75ab6 100644 --- a/source/funkin/scripting/events/PlayAnimEvent.hx +++ b/source/funkin/scripting/events/PlayAnimEvent.hx @@ -26,12 +26,13 @@ class PlayAnimEvent extends CancellableEvent { **/ public var context:PlayAnimContext; - public function new(animName:String, force:Bool, reverse:Bool, startingFrame:Int) { + public function new(animName:String, force:Bool, reverse:Bool, startingFrame:Int, context:PlayAnimContext) { super(); this.animName = animName; this.force = force; this.reverse = reverse; this.startingFrame = startingFrame; + this.context = context; } } @@ -50,6 +51,11 @@ abstract PlayAnimContext(String) { **/ var SING = "SING"; + /** + Whenever a dance animation is played. + **/ + var DANCE = "DANCE"; + /** Whenever a note is missed and a miss animation will be played. **/