From bd865fb31ec0eab7d961b9d101b87a1466f0ac8b Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 08:47:28 +0800 Subject: [PATCH 1/5] Fixes MainMenu not playing music after playing/exiting level --- source/MainMenuState.hx | 9 ++++++--- source/TitleState.hx | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 6cad3b3e1..cabf8f046 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -29,6 +29,11 @@ class MainMenuState extends MusicBeatState override function create() { + if (!FlxG.sound.music.playing) + { + FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt); + } + persistentUpdate = persistentDraw = true; var bg:FlxSprite = new FlxSprite(-80).loadGraphic(AssetPaths.menuBG__png); @@ -114,12 +119,10 @@ class MainMenuState extends MusicBeatState if (optionShit[curSelected] == 'donate') { #if linux - Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]); + Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]); #else - FlxG.openURL('https://ninja-muffin24.itch.io/funkin'); #end - } else { diff --git a/source/TitleState.hx b/source/TitleState.hx index ba0012ec6..24f8a4d86 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -51,10 +51,10 @@ class TitleState extends MusicBeatState super.create(); - #if ng - var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); - trace('NEWGROUNDS LOL'); - #end + /* #if ng + var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); + trace('NEWGROUNDS LOL'); + #end */ FlxG.save.bind('funkin', 'ninjamuffin99'); From ecea8da1f6e208f65cbc474dd4d756e930070847 Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 08:58:46 +0800 Subject: [PATCH 2/5] Freeplay song not continuing fade in when exiting freeplay menu --- source/MainMenuState.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index cabf8f046..ecda7d3bf 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -95,6 +95,11 @@ class MainMenuState extends MusicBeatState override function update(elapsed:Float) { + if (FlxG.sound.music.volume < 1) + { + FlxG.sound.music.volume += 0.5 * FlxG.elapsed; + } + if (!selectedSomethin) { if (controls.UP_P) From 6f25fc8aa963c9269726089840af7d631700c198 Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 13:02:23 +0800 Subject: [PATCH 3/5] oopsie daisy this shouldn't be tracked my bad --- source/TitleState.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/TitleState.hx b/source/TitleState.hx index 24f8a4d86..ba0012ec6 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -51,10 +51,10 @@ class TitleState extends MusicBeatState super.create(); - /* #if ng - var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); - trace('NEWGROUNDS LOL'); - #end */ + #if ng + var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); + trace('NEWGROUNDS LOL'); + #end FlxG.save.bind('funkin', 'ninjamuffin99'); From ff2a107065daa2e91dce871b8f8f111d6f49da27 Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 13:04:36 +0800 Subject: [PATCH 4/5] Fixed song starting early when paused during countdown also tweaked something in main menu --- source/MainMenuState.hx | 2 +- source/PlayState.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index ecda7d3bf..9bb35e77f 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -95,7 +95,7 @@ class MainMenuState extends MusicBeatState override function update(elapsed:Float) { - if (FlxG.sound.music.volume < 1) + if (FlxG.sound.music.volume < 0.8) { FlxG.sound.music.volume += 0.5 * FlxG.elapsed; } diff --git a/source/PlayState.hx b/source/PlayState.hx index eb1380261..8240a064c 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -576,7 +576,7 @@ class PlayState extends MusicBeatState { if (paused) { - if (FlxG.sound.music != null) + if (FlxG.sound.music != null && !startingSong) { FlxG.sound.music.play(); Conductor.songPosition = FlxG.sound.music.time; From 914e3cefbb33ebdf083461ce0c8a8681520ac008 Mon Sep 17 00:00:00 2001 From: Gede Hari Date: Thu, 10 Dec 2020 13:41:31 +0800 Subject: [PATCH 5/5] Fixed song still playing when paused right when song starts This should be it. --- source/PlayState.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8240a064c..f48db0d72 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -378,11 +378,13 @@ class PlayState extends MusicBeatState function startSong():Void { + startingSong = false; + previousFrameTime = FlxG.game.ticks; lastReportedPlayheadPosition = 0; - startingSong = false; - FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false); + if (!paused) + FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false); FlxG.sound.music.onComplete = endSong; vocals.play(); }