Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move version check screen to TitleState #155

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
18 changes: 17 additions & 1 deletion source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down