1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-17 20:32:53 +00:00

Move version check screen to TitleState

This commit is contained in:
Gede Hari 2021-01-05 16:29:32 +08:00
parent c2332b5d42
commit 44e9882a38
2 changed files with 17 additions and 8 deletions

View file

@ -89,13 +89,6 @@ class MainMenuState extends MusicBeatState
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit); add(versionShit);
if (versionShit.text.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
{
trace('OLD VERSION!');
FlxG.switchState(new OutdatedSubState());
}
// NG.core.calls.event.logEvent('swag').send(); // NG.core.calls.event.logEvent('swag').send();
changeItem(); changeItem();

View file

@ -20,9 +20,13 @@ 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.utils.Assets; import lime.utils.Assets;
import polymod.Polymod; import polymod.Polymod;
using StringTools;
class TitleState extends MusicBeatState class TitleState extends MusicBeatState
{ {
static var initialized:Bool = false; static var initialized:Bool = false;
@ -260,8 +264,20 @@ class TitleState extends MusicBeatState
// FlxG.sound.music.stop(); // FlxG.sound.music.stop();
new FlxTimer().start(2, function(tmr:FlxTimer) new FlxTimer().start(2, function(tmr:FlxTimer)
{
// Check if version is outdated
var version:String = "v" + Application.current.meta.get('version');
if (version.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
{
trace('OLD VERSION!');
FlxG.switchState(new OutdatedSubState());
}
else
{ {
FlxG.switchState(new MainMenuState()); FlxG.switchState(new MainMenuState());
}
}); });
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7); // FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
} }