From f9536c9419b95781d48882fa472ea649d34f6416 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 a1d01f64b420fdac3f039d13d31453100c7f9a8e 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 5175f48eba7e505eb8ea9bc8020504678d398b30 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 03b8daea351d7d413719a69827bda31512bd389b 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 2f763df9a8f3ceabcd127144c326f970cccf4ddd 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(); }