diff --git a/Project.xml b/Project.xml index cd6bf48e1..4d162fd88 100644 --- a/Project.xml +++ b/Project.xml @@ -3,7 +3,7 @@ - + @@ -42,13 +42,16 @@ - - + + + + + @@ -62,7 +65,8 @@ - + + @@ -106,6 +110,7 @@ + diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index d92e1b4c0..ccfdefaf2 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -180,10 +180,12 @@ class FreeplayState extends MusicBeatState if (curDifficulty > 2) curDifficulty = 0; + #if !switch intendedScore = Highscore.getScore(songs[curSelected], curDifficulty); #end + switch (curDifficulty) { case 0: @@ -197,6 +199,7 @@ class FreeplayState extends MusicBeatState function changeSelection(change:Int = 0) { + #if !switch NGio.logEvent('Fresh'); #end @@ -213,11 +216,13 @@ class FreeplayState extends MusicBeatState // selector.y = (70 * curSelected) + 30; + #if !switch intendedScore = Highscore.getScore(songs[curSelected], curDifficulty); // lerpScore = 0; #end + FlxG.sound.playMusic('assets/music/' + songs[curSelected] + "_Inst" + TitleState.soundExt, 0); var bullShit:Int = 0; diff --git a/source/Highscore.hx b/source/Highscore.hx index 462f70d1b..5fbc73298 100644 --- a/source/Highscore.hx +++ b/source/Highscore.hx @@ -10,14 +10,17 @@ class Highscore public static var songScores:Map = new Map(); #end + public static function saveScore(song:String, score:Int = 0, ?diff:Int = 0):Void { var daSong:String = formatSong(song, diff); + #if !switch NGio.postScore(score, song); #end + if (songScores.exists(daSong)) { if (songScores.get(daSong) < score) @@ -29,10 +32,12 @@ class Highscore public static function saveWeekScore(week:Int = 1, score:Int = 0, ?diff:Int = 0):Void { + #if !switch NGio.postScore(score, "Week " + week); #end + var daWeek:String = formatSong('week' + week, diff); if (songScores.exists(daWeek)) diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index ecaa59d4b..6cad3b3e1 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -116,8 +116,10 @@ class MainMenuState extends MusicBeatState #if linux Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]); #else + FlxG.openURL('https://ninja-muffin24.itch.io/funkin'); #end + } else { @@ -151,7 +153,9 @@ class MainMenuState extends MusicBeatState trace("Story Menu Selected"); case 'freeplay': FlxG.switchState(new FreeplayState()); + trace("Freeplay Menu Selected"); + case 'options': FlxG.switchState(new OptionsMenu()); } diff --git a/source/PlayState.hx b/source/PlayState.hx index 6437c0f5a..fb155f35d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -598,9 +598,6 @@ class PlayState extends MusicBeatState { super.update(elapsed); - trace("FlxG.sound.music.time: " + FlxG.sound.music.time); - trace("Conductor.songPosition: " + Conductor.songPosition); - scoreTxt.text = "Score:" + songScore; if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) @@ -854,6 +851,7 @@ class PlayState extends MusicBeatState { canPause = false; + #if !switch Highscore.saveScore(SONG.song, songScore, storyDifficulty); #end @@ -872,10 +870,9 @@ class PlayState extends MusicBeatState StoryMenuState.weekUnlocked[2] = true; - #if !switch NGio.unlockMedal(60961); Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); - #end + FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; FlxG.save.flush(); diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 5cde2bd4d..1bdfa866e 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -296,6 +296,7 @@ class StoryMenuState extends MusicBeatState // USING THESE WEIRD VALUES SO THAT IT DOESNT FLOAT UP sprDifficulty.y = leftArrow.y - 15; + intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); #if !switch intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); @@ -351,9 +352,10 @@ class StoryMenuState extends MusicBeatState txtTracklist.screenCenter(X); txtTracklist.x -= FlxG.width * 0.35; - + #if !switch intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); #end + } } diff --git a/source/TitleState.hx b/source/TitleState.hx index fdd89ac19..e492d0b2a 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -51,7 +51,8 @@ class TitleState extends MusicBeatState super.create(); - #if (web && !debug && NG_LOGIN) + #if (!switch && !debug && NG_LOGIN) + var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); #end