Merge branch 'master' into master

This commit is contained in:
Cameron Taylor 2020-11-25 00:22:22 -08:00 committed by GitHub
commit 48b2a77472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 11 deletions

View File

@ -42,13 +42,16 @@
<assets path="assets/images" /> <assets path="assets/images" />
<assets path="assets/data" /> <assets path="assets/data" />
<assets path="assets/music" include="*.mp3" if="web" /> <!-- <library name="noPreload" preload='false'/> -->
<assets path="assets/music" include="*.ogg" unless="web" /> <!-- <library name="noPreload"/> -->
<assets path="assets/music" include="*.mp3" if="web"/>
<assets path="assets/music" include="*.ogg" unless="web"/>
<assets path="assets/sounds" include="*.mp3" if="web" /> <assets path="assets/sounds" include="*.mp3" if="web" />
<assets path="assets/sounds" include="*.ogg" unless="web" /> <assets path="assets/sounds" include="*.ogg" unless="web" />
<assets path="CHANGELOG.md"/> <assets path="CHANGELOG.md"/>
<assets path="assets/fonts/vcr.ttf" embed="true" /> <assets path="assets/fonts/vcr.ttf" embed="true" />
<!-- _______________________________ Libraries ______________________________ --> <!-- _______________________________ Libraries ______________________________ -->
@ -62,7 +65,8 @@
<!--In case you want to use the ui package--> <!--In case you want to use the ui package-->
<haxelib name="flixel-ui" /> <haxelib name="flixel-ui" />
<haxelib name="newgrounds" /> <haxelib name="newgrounds" />
<haxelib name="faxe" /> <haxelib name="faxe" if='switch'/>
<!-- <haxelib name="markdown" /> --> <!-- <haxelib name="markdown" /> -->
<!-- <haxelib name="HtmlParser" /> --> <!-- <haxelib name="HtmlParser" /> -->
@ -106,6 +110,7 @@
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)--> <!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
<icon path="art/icon.png" /> <icon path="art/icon.png" />
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> --> <!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
<haxedef name="NG_LOGIN" if="newgrounds" /> <haxedef name="NG_LOGIN" if="newgrounds" />

View File

@ -180,10 +180,12 @@ class FreeplayState extends MusicBeatState
if (curDifficulty > 2) if (curDifficulty > 2)
curDifficulty = 0; curDifficulty = 0;
#if !switch #if !switch
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty); intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
#end #end
switch (curDifficulty) switch (curDifficulty)
{ {
case 0: case 0:
@ -197,6 +199,7 @@ class FreeplayState extends MusicBeatState
function changeSelection(change:Int = 0) function changeSelection(change:Int = 0)
{ {
#if !switch #if !switch
NGio.logEvent('Fresh'); NGio.logEvent('Fresh');
#end #end
@ -213,11 +216,13 @@ class FreeplayState extends MusicBeatState
// selector.y = (70 * curSelected) + 30; // selector.y = (70 * curSelected) + 30;
#if !switch #if !switch
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty); intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
// lerpScore = 0; // lerpScore = 0;
#end #end
FlxG.sound.playMusic('assets/music/' + songs[curSelected] + "_Inst" + TitleState.soundExt, 0); FlxG.sound.playMusic('assets/music/' + songs[curSelected] + "_Inst" + TitleState.soundExt, 0);
var bullShit:Int = 0; var bullShit:Int = 0;

View File

@ -10,14 +10,17 @@ class Highscore
public static var songScores:Map<String, Int> = new Map<String, Int>(); public static var songScores:Map<String, Int> = new Map<String, Int>();
#end #end
public static function saveScore(song:String, score:Int = 0, ?diff:Int = 0):Void public static function saveScore(song:String, score:Int = 0, ?diff:Int = 0):Void
{ {
var daSong:String = formatSong(song, diff); var daSong:String = formatSong(song, diff);
#if !switch #if !switch
NGio.postScore(score, song); NGio.postScore(score, song);
#end #end
if (songScores.exists(daSong)) if (songScores.exists(daSong))
{ {
if (songScores.get(daSong) < score) 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 public static function saveWeekScore(week:Int = 1, score:Int = 0, ?diff:Int = 0):Void
{ {
#if !switch #if !switch
NGio.postScore(score, "Week " + week); NGio.postScore(score, "Week " + week);
#end #end
var daWeek:String = formatSong('week' + week, diff); var daWeek:String = formatSong('week' + week, diff);
if (songScores.exists(daWeek)) if (songScores.exists(daWeek))

View File

@ -116,8 +116,10 @@ class MainMenuState extends MusicBeatState
#if linux #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 #else
FlxG.openURL('https://ninja-muffin24.itch.io/funkin'); FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
#end #end
} }
else else
{ {
@ -151,7 +153,9 @@ class MainMenuState extends MusicBeatState
trace("Story Menu Selected"); trace("Story Menu Selected");
case 'freeplay': case 'freeplay':
FlxG.switchState(new FreeplayState()); FlxG.switchState(new FreeplayState());
trace("Freeplay Menu Selected"); trace("Freeplay Menu Selected");
case 'options': case 'options':
FlxG.switchState(new OptionsMenu()); FlxG.switchState(new OptionsMenu());
} }

View File

@ -598,9 +598,6 @@ class PlayState extends MusicBeatState
{ {
super.update(elapsed); super.update(elapsed);
trace("FlxG.sound.music.time: " + FlxG.sound.music.time);
trace("Conductor.songPosition: " + Conductor.songPosition);
scoreTxt.text = "Score:" + songScore; scoreTxt.text = "Score:" + songScore;
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
@ -854,6 +851,7 @@ class PlayState extends MusicBeatState
{ {
canPause = false; canPause = false;
#if !switch #if !switch
Highscore.saveScore(SONG.song, songScore, storyDifficulty); Highscore.saveScore(SONG.song, songScore, storyDifficulty);
#end #end
@ -872,10 +870,9 @@ class PlayState extends MusicBeatState
StoryMenuState.weekUnlocked[2] = true; StoryMenuState.weekUnlocked[2] = true;
#if !switch
NGio.unlockMedal(60961); NGio.unlockMedal(60961);
Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
#end
FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
FlxG.save.flush(); FlxG.save.flush();

View File

@ -296,6 +296,7 @@ class StoryMenuState extends MusicBeatState
// USING THESE WEIRD VALUES SO THAT IT DOESNT FLOAT UP // USING THESE WEIRD VALUES SO THAT IT DOESNT FLOAT UP
sprDifficulty.y = leftArrow.y - 15; sprDifficulty.y = leftArrow.y - 15;
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
#if !switch #if !switch
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
@ -355,5 +356,6 @@ class StoryMenuState extends MusicBeatState
#if !switch #if !switch
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
#end #end
} }
} }

View File

@ -51,7 +51,8 @@ class TitleState extends MusicBeatState
super.create(); super.create();
#if (web && !debug && NG_LOGIN) #if (!switch && !debug && NG_LOGIN)
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
#end #end