update crap

This commit is contained in:
KadeDev
2021-03-09 12:23:52 -08:00
parent a02adfb7af
commit 136dd62114
2 changed files with 30 additions and 8 deletions

View File

@ -276,11 +276,31 @@ class TitleState extends MusicBeatState
new FlxTimer().start(2, function(tmr:FlxTimer)
{
// Check if version is outdated
var version:String = "v" + Application.current.meta.get('version');
// Get current version of Kade Engine
var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
http.onData = function (data:String) {
var result = haxe.Json.parse(data);
if (MainMenuState.kadeEngineVer != result && !OutdatedSubState.leftState)
{
OutdatedSubState.needVer = result;
FlxG.switchState(new OutdatedSubState());
}
else
{
FlxG.switchState(new MainMenuState());
}
}
http.onError = function (error) {
trace('error: $error');
FlxG.switchState(new MainMenuState()); // fail but we go anyway
}
http.request();
FlxG.switchState(new MainMenuState());
});
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
}