finalize prompts and uix
This commit is contained in:
parent
c95f24983f
commit
5c641abb45
20
Project.xml
20
Project.xml
|
@ -113,7 +113,7 @@
|
||||||
|
|
||||||
<!--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" unless="switch"/>
|
||||||
<haxelib name="faxe" if='switch'/>
|
<haxelib name="faxe" if='switch'/>
|
||||||
<haxelib name="polymod"/>
|
<haxelib name="polymod"/>
|
||||||
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
|
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
|
||||||
|
@ -167,11 +167,17 @@
|
||||||
|
|
||||||
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
|
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
|
||||||
|
|
||||||
<!-- Enables Ng.core.verbose -->
|
<haxedef name="CAN_OPEN_LINKS" unless="switch"/>
|
||||||
<!-- <haxedef name="NG_VERBOSE" /> -->
|
|
||||||
<!-- Enables a NG debug session, so medals don't permently unlock -->
|
<section if="newgrounds">
|
||||||
<!-- <haxedef name="NG_DEBUG" /> -->
|
<!-- Enables Ng.core.verbose -->
|
||||||
<!-- pretends that the saved session Id was expired, forcing the reconnect prompt -->
|
<haxedef name="NG_VERBOSE" />
|
||||||
<!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> -->
|
|
||||||
|
<!-- Enables a NG debug session, so medals don't permently unlock -->
|
||||||
|
<!-- <haxedef name="NG_DEBUG" /> -->
|
||||||
|
|
||||||
|
<!-- pretends that the saved session Id was expired, forcing the reconnect prompt -->
|
||||||
|
<!-- <haxedef name="NG_FORCE_EXPIRED_SESSION" if="debug" /> -->
|
||||||
|
</section>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -211,9 +211,7 @@ class FreeplayState extends MusicBeatState
|
||||||
if (curDifficulty > 2)
|
if (curDifficulty > 2)
|
||||||
curDifficulty = 0;
|
curDifficulty = 0;
|
||||||
|
|
||||||
#if !switch
|
|
||||||
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
||||||
#end
|
|
||||||
|
|
||||||
switch (curDifficulty)
|
switch (curDifficulty)
|
||||||
{
|
{
|
||||||
|
@ -228,9 +226,7 @@ class FreeplayState extends MusicBeatState
|
||||||
|
|
||||||
function changeSelection(change:Int = 0)
|
function changeSelection(change:Int = 0)
|
||||||
{
|
{
|
||||||
#if !switch
|
|
||||||
NGio.logEvent('Fresh');
|
NGio.logEvent('Fresh');
|
||||||
#end
|
|
||||||
|
|
||||||
// NGio.logEvent('Fresh');
|
// NGio.logEvent('Fresh');
|
||||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||||
|
@ -244,10 +240,8 @@ class FreeplayState extends MusicBeatState
|
||||||
|
|
||||||
// selector.y = (70 * curSelected) + 30;
|
// selector.y = (70 * curSelected) + 30;
|
||||||
|
|
||||||
#if !switch
|
|
||||||
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
||||||
// lerpScore = 0;
|
// lerpScore = 0;
|
||||||
#end
|
|
||||||
|
|
||||||
#if PRELOAD_ALL
|
#if PRELOAD_ALL
|
||||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected]), 0);
|
FlxG.sound.playMusic(Paths.inst(songs[curSelected]), 0);
|
||||||
|
|
|
@ -13,51 +13,55 @@ class Highscore
|
||||||
|
|
||||||
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 formattedSong:String = formatSong(song, diff);
|
||||||
|
|
||||||
|
#if newgrounds
|
||||||
#if !switch
|
|
||||||
NGio.postScore(score, song);
|
NGio.postScore(score, song);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
if (songScores.exists(formattedSong))
|
||||||
if (songScores.exists(daSong))
|
|
||||||
{
|
{
|
||||||
if (songScores.get(daSong) < score)
|
if (songScores.get(formattedSong) < score)
|
||||||
setScore(daSong, score);
|
setScore(formattedSong, score);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setScore(daSong, score);
|
setScore(formattedSong, score);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 newgrounds
|
||||||
#if !switch
|
|
||||||
NGio.postScore(score, "Week " + week);
|
NGio.postScore(score, "Week " + week);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
var formattedSong:String = formatSong('week' + week, diff);
|
||||||
|
|
||||||
var daWeek:String = formatSong('week' + week, diff);
|
if (songScores.exists(formattedSong))
|
||||||
|
|
||||||
if (songScores.exists(daWeek))
|
|
||||||
{
|
{
|
||||||
if (songScores.get(daWeek) < score)
|
if (songScores.get(formattedSong) < score)
|
||||||
setScore(daWeek, score);
|
setScore(formattedSong, score);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setScore(daWeek, score);
|
setScore(formattedSong, score);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE
|
* YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE
|
||||||
*/
|
*/
|
||||||
static function setScore(song:String, score:Int):Void
|
static function setScore(formattedSong:String, score:Int):Void
|
||||||
{
|
{
|
||||||
|
/** GeoKureli
|
||||||
|
* References to Highscore were wrapped in `#if !switch` blocks. I wasn't sure if this
|
||||||
|
* is because switch doesn't use NGio, or because switch has a different saving method.
|
||||||
|
* I moved the compiler flag here, rather than using it everywhere else.
|
||||||
|
*/
|
||||||
|
#if !switch
|
||||||
|
|
||||||
// Reminder that I don't need to format this song, it should come formatted!
|
// Reminder that I don't need to format this song, it should come formatted!
|
||||||
songScores.set(song, score);
|
songScores.set(formattedSong, score);
|
||||||
FlxG.save.data.songScores = songScores;
|
FlxG.save.data.songScores = songScores;
|
||||||
FlxG.save.flush();
|
FlxG.save.flush();
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function formatSong(song:String, diff:Int):String
|
public static function formatSong(song:String, diff:Int):String
|
||||||
|
|
|
@ -15,7 +15,6 @@ import flixel.tweens.FlxEase;
|
||||||
import flixel.tweens.FlxTween;
|
import flixel.tweens.FlxTween;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import io.newgrounds.NG;
|
|
||||||
import lime.app.Application;
|
import lime.app.Application;
|
||||||
|
|
||||||
import ui.MenuItemList;
|
import ui.MenuItemList;
|
||||||
|
@ -81,11 +80,11 @@ class MainMenuState extends MusicBeatState
|
||||||
menuItems.createItem('story mode', function () startExitState(new StoryMenuState()));
|
menuItems.createItem('story mode', function () startExitState(new StoryMenuState()));
|
||||||
menuItems.createItem('freeplay', function () startExitState(new FreeplayState()));
|
menuItems.createItem('freeplay', function () startExitState(new FreeplayState()));
|
||||||
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
||||||
#if (!switch)
|
#if CAN_OPEN_LINKS
|
||||||
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
||||||
#end
|
#end
|
||||||
#if newgrounds
|
#if newgrounds
|
||||||
if (NG.core.loggedIn)
|
if (NGio.isLoggedIn)
|
||||||
menuItems.createItem("logout", selectLogout);
|
menuItems.createItem("logout", selectLogout);
|
||||||
else
|
else
|
||||||
menuItems.createItem("login", selectLogin);
|
menuItems.createItem("login", selectLogin);
|
||||||
|
@ -119,8 +118,10 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
menuItems.enabled = true;
|
menuItems.enabled = true;
|
||||||
|
|
||||||
|
#if newgrounds
|
||||||
if (NGio.savedSessionFailed)
|
if (NGio.savedSessionFailed)
|
||||||
showSavedSessionFailed();
|
showSavedSessionFailed();
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMenuItemChange(selected:MenuItem)
|
function onMenuItemChange(selected:MenuItem)
|
||||||
|
@ -150,32 +151,37 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
function showNgPrompt(fromUi:Bool)
|
function showNgPrompt(fromUi:Bool)
|
||||||
{
|
{
|
||||||
menuItems.enabled = false;
|
var prompt = createNGPrompt("Talking to server...", None);
|
||||||
|
|
||||||
var prompt = new Prompt("prompt-ng_login", "Talking to server...", None);
|
|
||||||
prompt.closeCallback = function() menuItems.enabled = true;
|
|
||||||
openSubState(prompt);
|
openSubState(prompt);
|
||||||
function onLoginComplete(result:ConnectionResult)
|
function onLoginComplete(result:ConnectionResult)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
case Success:
|
case Success:
|
||||||
|
{
|
||||||
menuItems.resetItem("login", "logout", selectLogout);
|
menuItems.resetItem("login", "logout", selectLogout);
|
||||||
prompt.setText("Login Successful");
|
prompt.setText("Login Successful");
|
||||||
prompt.setButtons(Ok);
|
prompt.setButtons(Ok);
|
||||||
prompt.onYes = prompt.close;
|
prompt.onYes = prompt.close;
|
||||||
|
}
|
||||||
case Fail(msg):
|
case Fail(msg):
|
||||||
|
{
|
||||||
trace("Login Error:" + msg);
|
trace("Login Error:" + msg);
|
||||||
prompt.setText("Login failed");
|
prompt.setText("Login failed");
|
||||||
prompt.setButtons(Ok);
|
prompt.setButtons(Ok);
|
||||||
prompt.onYes = prompt.close;
|
prompt.onYes = prompt.close;
|
||||||
|
}
|
||||||
case Cancelled:
|
case Cancelled:
|
||||||
|
{
|
||||||
if (prompt != null)
|
if (prompt != null)
|
||||||
{
|
{
|
||||||
prompt.setText("Login cancelled by user");
|
prompt.setText("Login cancelled by user");
|
||||||
prompt.setButtons(Ok);
|
prompt.setButtons(Ok);
|
||||||
prompt.onYes = prompt.close;
|
prompt.onYes = prompt.close;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
trace("Login cancelled via prompt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +202,7 @@ class MainMenuState extends MusicBeatState
|
||||||
#end
|
#end
|
||||||
prompt.onYes = function()
|
prompt.onYes = function()
|
||||||
{
|
{
|
||||||
prompt.setText("Connecting...");
|
prompt.setText("Connecting..." #if web + "\n(check your popup blocker)" #end);
|
||||||
prompt.setButtons(None);
|
prompt.setButtons(None);
|
||||||
openPassportUrl();
|
openPassportUrl();
|
||||||
};
|
};
|
||||||
|
@ -204,7 +210,7 @@ class MainMenuState extends MusicBeatState
|
||||||
{
|
{
|
||||||
prompt.close();
|
prompt.close();
|
||||||
prompt = null;
|
prompt = null;
|
||||||
NG.core.cancelLoginRequest();
|
NGio.cancelLogin();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -219,9 +225,8 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
function selectLogout()
|
function selectLogout()
|
||||||
{
|
{
|
||||||
menuItems.enabled = false;
|
var user = io.newgrounds.NG.core.user.name;
|
||||||
var prompt = new Prompt("prompt-ng_login", "Log out of " + NG.core.user.name + "?", Yes_No);
|
var prompt = createNGPrompt('Log out of $user?', Yes_No);
|
||||||
prompt.closeCallback = function () menuItems.enabled = true;
|
|
||||||
prompt.onYes = function()
|
prompt.onYes = function()
|
||||||
{
|
{
|
||||||
NGio.logout();
|
NGio.logout();
|
||||||
|
@ -231,6 +236,22 @@ class MainMenuState extends MusicBeatState
|
||||||
prompt.onNo = prompt.close;
|
prompt.onNo = prompt.close;
|
||||||
openSubState(prompt);
|
openSubState(prompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createNGPrompt(text:String, style:ButtonStyle = Yes_No)
|
||||||
|
{
|
||||||
|
var oldAutoPause = FlxG.autoPause;
|
||||||
|
FlxG.autoPause = false;
|
||||||
|
menuItems.enabled = false;
|
||||||
|
|
||||||
|
var prompt = new Prompt("prompt-ng_login", text, style);
|
||||||
|
prompt.closeCallback = function ()
|
||||||
|
{
|
||||||
|
menuItems.enabled = true;
|
||||||
|
FlxG.autoPause = oldAutoPause;
|
||||||
|
}
|
||||||
|
|
||||||
|
return prompt;
|
||||||
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
function startExitState(state:FlxState)
|
function startExitState(state:FlxState)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package;
|
package;
|
||||||
|
#if newgrounds
|
||||||
|
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.util.FlxSignal;
|
import flixel.util.FlxSignal;
|
||||||
|
@ -17,19 +18,24 @@ import lime.app.Application;
|
||||||
import openfl.display.Stage;
|
import openfl.display.Stage;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
#end
|
||||||
/**
|
/**
|
||||||
* MADE BY GEOKURELI THE LEGENED GOD HERO MVP
|
* MADE BY GEOKURELI THE LEGENED GOD HERO MVP
|
||||||
*/
|
*/
|
||||||
class NGio
|
class NGio
|
||||||
{
|
{
|
||||||
|
#if newgrounds
|
||||||
/**
|
/**
|
||||||
* True, if the saved sessionId was used in the initial login, and failed to connect.
|
* True, if the saved sessionId was used in the initial login, and failed to connect.
|
||||||
* Used in MainMenuState to show a popup to establish a new connection
|
* Used in MainMenuState to show a popup to establish a new connection
|
||||||
*/
|
*/
|
||||||
public static var savedSessionFailed(default, null):Bool = false;
|
public static var savedSessionFailed(default, null):Bool = false;
|
||||||
public static var isLoggedIn:Bool = false;
|
|
||||||
public static var scoreboardsLoaded:Bool = false;
|
public static var scoreboardsLoaded:Bool = false;
|
||||||
|
public static var isLoggedIn(get, never):Bool;
|
||||||
|
inline static function get_isLoggedIn()
|
||||||
|
{
|
||||||
|
return NG.core != null && NG.core.loggedIn;
|
||||||
|
}
|
||||||
|
|
||||||
public static var scoreboardArray:Array<Score> = [];
|
public static var scoreboardArray:Array<Score> = [];
|
||||||
|
|
||||||
|
@ -38,7 +44,6 @@ class NGio
|
||||||
|
|
||||||
public static var GAME_VER:String = "";
|
public static var GAME_VER:String = "";
|
||||||
|
|
||||||
|
|
||||||
static public function checkVersion(callback:String->Void)
|
static public function checkVersion(callback:String->Void)
|
||||||
{
|
{
|
||||||
trace('checking NG.io version');
|
trace('checking NG.io version');
|
||||||
|
@ -54,7 +59,7 @@ class NGio
|
||||||
.send();
|
.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function init(api:String, encKey:String)
|
static public function init()
|
||||||
{
|
{
|
||||||
var api = APIStuff.API;
|
var api = APIStuff.API;
|
||||||
if (api == null || api.length == 0)
|
if (api == null || api.length == 0)
|
||||||
|
@ -149,11 +154,15 @@ class NGio
|
||||||
|
|
||||||
NG.core.requestLogin(onSuccess, onPending, onFail, onCancel);
|
NG.core.requestLogin(onSuccess, onPending, onFail, onCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static public function cancelLogin():Void
|
||||||
|
{
|
||||||
|
NG.core.cancelLoginRequest();
|
||||||
|
}
|
||||||
|
|
||||||
static function onNGLogin():Void
|
static function onNGLogin():Void
|
||||||
{
|
{
|
||||||
trace('logged in! user:${NG.core.user.name}');
|
trace('logged in! user:${NG.core.user.name}');
|
||||||
isLoggedIn = true;
|
|
||||||
FlxG.save.data.sessionId = NG.core.sessionId;
|
FlxG.save.data.sessionId = NG.core.sessionId;
|
||||||
FlxG.save.flush();
|
FlxG.save.flush();
|
||||||
// Load medals then call onNGMedalFetch()
|
// Load medals then call onNGMedalFetch()
|
||||||
|
@ -216,24 +225,6 @@ class NGio
|
||||||
// more info on scores --- http://www.newgrounds.io/help/components/#scoreboard-getscores
|
// more info on scores --- http://www.newgrounds.io/help/components/#scoreboard-getscores
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static public function postScore(score:Int = 0, song:String)
|
|
||||||
{
|
|
||||||
if (isLoggedIn)
|
|
||||||
{
|
|
||||||
for (id in NG.core.scoreBoards.keys())
|
|
||||||
{
|
|
||||||
var board = NG.core.scoreBoards.get(id);
|
|
||||||
|
|
||||||
if (song == board.name)
|
|
||||||
{
|
|
||||||
board.postScore(score, "Uhh meow?");
|
|
||||||
}
|
|
||||||
|
|
||||||
// trace('loaded scoreboard id:$id, name:${board.name}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static function onNGScoresFetch():Void
|
static function onNGScoresFetch():Void
|
||||||
{
|
{
|
||||||
scoreboardsLoaded = true;
|
scoreboardsLoaded = true;
|
||||||
|
@ -252,21 +243,52 @@ class NGio
|
||||||
|
|
||||||
// NGio.scoreboardArray = NG.core.scoreBoards.get(8004).scores;
|
// NGio.scoreboardArray = NG.core.scoreBoards.get(8004).scores;
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
inline static public function logEvent(event:String)
|
static public function logEvent(event:String)
|
||||||
{
|
{
|
||||||
|
#if newgrounds
|
||||||
NG.core.calls.event.logEvent(event).send();
|
NG.core.calls.event.logEvent(event).send();
|
||||||
trace('should have logged: ' + event);
|
trace('should have logged: ' + event);
|
||||||
|
#else
|
||||||
|
#if debug trace('event:$event - not logged, missing NG.io lib'); #end
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static public function unlockMedal(id:Int)
|
static public function unlockMedal(id:Int)
|
||||||
{
|
{
|
||||||
|
#if newgrounds
|
||||||
if (isLoggedIn)
|
if (isLoggedIn)
|
||||||
{
|
{
|
||||||
var medal = NG.core.medals.get(id);
|
var medal = NG.core.medals.get(id);
|
||||||
if (!medal.unlocked)
|
if (!medal.unlocked)
|
||||||
medal.sendUnlock();
|
medal.sendUnlock();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#if debug trace('medal:$id - not unlocked, missing NG.io lib'); #end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function postScore(score:Int = 0, song:String)
|
||||||
|
{
|
||||||
|
#if newgrounds
|
||||||
|
if (isLoggedIn)
|
||||||
|
{
|
||||||
|
for (id in NG.core.scoreBoards.keys())
|
||||||
|
{
|
||||||
|
var board = NG.core.scoreBoards.get(id);
|
||||||
|
|
||||||
|
if (song == board.name)
|
||||||
|
{
|
||||||
|
board.postScore(score, "Uhh meow?");
|
||||||
|
}
|
||||||
|
|
||||||
|
// trace('loaded scoreboard id:$id, name:${board.name}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#if debug trace('Song:$song, Score:$score - not posted, missing NG.io lib'); #end
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,7 @@ class OptionsMenu extends MusicBeatState
|
||||||
|
|
||||||
function changeSelection(change:Int = 0)
|
function changeSelection(change:Int = 0)
|
||||||
{
|
{
|
||||||
#if !switch
|
|
||||||
NGio.logEvent('Fresh');
|
NGio.logEvent('Fresh');
|
||||||
#end
|
|
||||||
|
|
||||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||||
|
|
||||||
|
|
|
@ -1604,9 +1604,7 @@ class PlayState extends MusicBeatState
|
||||||
vocals.volume = 0;
|
vocals.volume = 0;
|
||||||
if (SONG.validScore)
|
if (SONG.validScore)
|
||||||
{
|
{
|
||||||
#if !switch
|
|
||||||
Highscore.saveScore(SONG.song, songScore, storyDifficulty);
|
Highscore.saveScore(SONG.song, songScore, storyDifficulty);
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStoryMode)
|
if (isStoryMode)
|
||||||
|
|
|
@ -352,10 +352,6 @@ class StoryMenuState extends MusicBeatState
|
||||||
sprDifficulty.y = leftArrow.y - 15;
|
sprDifficulty.y = leftArrow.y - 15;
|
||||||
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
||||||
|
|
||||||
#if !switch
|
|
||||||
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
|
||||||
#end
|
|
||||||
|
|
||||||
FlxTween.tween(sprDifficulty, {y: leftArrow.y + 15, alpha: 1}, 0.07);
|
FlxTween.tween(sprDifficulty, {y: leftArrow.y + 15, alpha: 1}, 0.07);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,8 +427,6 @@ class StoryMenuState extends MusicBeatState
|
||||||
txtTracklist.screenCenter(X);
|
txtTracklist.screenCenter(X);
|
||||||
txtTracklist.x -= FlxG.width * 0.35;
|
txtTracklist.x -= FlxG.width * 0.35;
|
||||||
|
|
||||||
#if !switch
|
|
||||||
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ import flixel.tweens.FlxEase;
|
||||||
import flixel.tweens.FlxTween;
|
import flixel.tweens.FlxTween;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import io.newgrounds.NG;
|
|
||||||
import lime.app.Application;
|
import lime.app.Application;
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
|
|
||||||
|
@ -56,9 +55,11 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||||
Highscore.load();
|
Highscore.load();
|
||||||
|
|
||||||
NGio.init(APIStuff.API, APIStuff.EncKey);
|
#if newgrounds
|
||||||
|
NGio.init();
|
||||||
|
#end
|
||||||
|
|
||||||
if (FlxG.save.data.weekUnlocked != null)
|
if (FlxG.save.data.weekUnlocked != null)
|
||||||
{
|
{
|
||||||
// FIX LATER!!!
|
// FIX LATER!!!
|
||||||
|
@ -242,13 +243,11 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
if (pressedEnter && !transitioning && skippedIntro)
|
if (pressedEnter && !transitioning && skippedIntro)
|
||||||
{
|
{
|
||||||
#if !switch
|
|
||||||
NGio.unlockMedal(60960);
|
NGio.unlockMedal(60960);
|
||||||
|
|
||||||
// If it's Friday according to da clock
|
// If it's Friday according to da clock
|
||||||
if (Date.now().getDay() == 5)
|
if (Date.now().getDay() == 5)
|
||||||
NGio.unlockMedal(61034);
|
NGio.unlockMedal(61034);
|
||||||
#end
|
|
||||||
|
|
||||||
titleText.animation.play('press');
|
titleText.animation.play('press');
|
||||||
|
|
||||||
|
@ -258,6 +257,7 @@ class TitleState extends MusicBeatState
|
||||||
transitioning = true;
|
transitioning = true;
|
||||||
// FlxG.sound.music.stop();
|
// FlxG.sound.music.stop();
|
||||||
|
|
||||||
|
#if newgrounds
|
||||||
if (!OutdatedSubState.leftState)
|
if (!OutdatedSubState.leftState)
|
||||||
{
|
{
|
||||||
NGio.checkVersion(function(version)
|
NGio.checkVersion(function(version)
|
||||||
|
@ -278,6 +278,9 @@ class TitleState extends MusicBeatState
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
FlxG.switchState(new MainMenuState());
|
||||||
|
#end
|
||||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,8 @@ class MenuTypedItemList<T:MenuItem> extends FlxTypedGroup<T>
|
||||||
if (controls.RIGHT_P || controls.DOWN_P) next();
|
if (controls.RIGHT_P || controls.DOWN_P) next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Todo: bypass popup blocker on firefox
|
||||||
if (controls.ACCEPT)
|
if (controls.ACCEPT)
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue