Merge pull request #155 from gedehari/version-check-fix

Move version check screen to TitleState
This commit is contained in:
Cameron Taylor 2021-01-14 23:38:05 -05:00 committed by GitHub
commit 106e7accd6
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);
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();
changeItem();

View file

@ -20,9 +20,13 @@ import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import io.newgrounds.NG;
import lime.app.Application;
import lime.utils.Assets;
import polymod.Polymod;
using StringTools;
class TitleState extends MusicBeatState
{
static var initialized:Bool = false;
@ -261,7 +265,19 @@ class TitleState extends MusicBeatState
new FlxTimer().start(2, function(tmr:FlxTimer)
{
FlxG.switchState(new MainMenuState());
// 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.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
}