1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-27 23:46:45 +00:00

mom chart

This commit is contained in:
Cameron Taylor 2020-12-22 19:57:55 -05:00
parent b889648968
commit a7111abeb3
3 changed files with 67 additions and 5 deletions

View file

@ -87,6 +87,11 @@ class MainMenuState extends MusicBeatState
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);
if (versionShit.text != NGio.GAME_VER)
{
openSubState(new OutdatedSubState());
}
NG.core.calls.event.logEvent('swag').send();
changeItem();

View file

@ -7,6 +7,10 @@ import io.newgrounds.components.ScoreBoardComponent.Period;
import io.newgrounds.objects.Medal;
import io.newgrounds.objects.Score;
import io.newgrounds.objects.ScoreBoard;
import io.newgrounds.objects.events.Response;
import io.newgrounds.objects.events.Result.GetCurrentVersionResult;
import io.newgrounds.objects.events.Result.GetVersionResult;
import lime.app.Application;
import openfl.display.Stage;
/**
@ -22,9 +26,26 @@ class NGio
public static var ngDataLoaded(default, null):FlxSignal = new FlxSignal();
public static var ngScoresLoaded(default, null):FlxSignal = new FlxSignal();
public static var GAME_VER:String = "";
public static function noLogin(api:String)
{
trace('INIT NOLOGIN');
GAME_VER = "v" + Application.current.meta.get('version');
NG.create(api);
NG.onCoreReady.add(function()
{
trace('READY SHIT??');
var call = NG.core.calls.gateway.getVersion().addDataHandler(function(response:Response<GetVersionResult>)
{
GAME_VER = response.result.data.version;
trace('CURRENT NG VERSION: ' + GAME_VER);
});
call.send();
});
}
public function new(api:String, encKey:String, ?sessionId:String)
@ -153,11 +174,8 @@ class NGio
inline static public function logEvent(event:String)
{
if (isLoggedIn)
{
NG.core.calls.event.logEvent(event);
trace('should have logged: ' + event);
}
NG.core.calls.event.logEvent(event).send();
trace('should have logged: ' + event);
}
inline static public function unlockMedal(id:Int)

View file

@ -0,0 +1,39 @@
package;
import flixel.FlxG;
import flixel.FlxSubState;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.app.Application;
class OutdatedSubState extends MusicBeatSubstate
{
public function new()
{
super();
var ver = "v" + Application.current.meta.get('version');
var txt:FlxText = new FlxText(0, 0, 0,
"HEY! You're running an outdated version of the game!\nCurrent version is "
+ ver
+ " while the current version is "
+ NGio.GAME_VER
+ " ! Press Space to go to itch.io, or ESCAPE to ignore this!!",
32);
txt.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
txt.screenCenter();
add(txt);
}
override function update(elapsed:Float)
{
if (controls.ACCEPT)
{
FlxG.openURL("https://ninja-muffin24.itch.io/funkin");
}
if (controls.BACK)
{
close();
}
super.update(elapsed);
}
}