mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
mom chart
This commit is contained in:
parent
b889648968
commit
a7111abeb3
3 changed files with 67 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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,12 +174,9 @@ class NGio
|
|||
|
||||
inline static public function logEvent(event:String)
|
||||
{
|
||||
if (isLoggedIn)
|
||||
{
|
||||
NG.core.calls.event.logEvent(event);
|
||||
NG.core.calls.event.logEvent(event).send();
|
||||
trace('should have logged: ' + event);
|
||||
}
|
||||
}
|
||||
|
||||
inline static public function unlockMedal(id:Int)
|
||||
{
|
||||
|
|
39
source/OutdatedSubState.hx
Normal file
39
source/OutdatedSubState.hx
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue