Skip to content

Commit 25c3c2b

Browse files
Merge pull request FunkinCrew#155 from gedehari/version-check-fix
Move version check screen to TitleState
2 parents 64a03b1 + 5256154 commit 25c3c2b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

source/MainMenuState.hx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ class MainMenuState extends MusicBeatState
8989
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
9090
add(versionShit);
9191

92-
if (versionShit.text.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
93-
{
94-
trace('OLD VERSION!');
95-
96-
FlxG.switchState(new OutdatedSubState());
97-
}
98-
9992
// NG.core.calls.event.logEvent('swag').send();
10093

10194
changeItem();

source/TitleState.hx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ import flixel.tweens.FlxEase;
2020
import flixel.tweens.FlxTween;
2121
import flixel.util.FlxColor;
2222
import flixel.util.FlxTimer;
23+
import io.newgrounds.NG;
24+
import lime.app.Application;
2325
import lime.utils.Assets;
2426
import polymod.Polymod;
2527

28+
using StringTools;
29+
2630
class TitleState extends MusicBeatState
2731
{
2832
static var initialized:Bool = false;
@@ -261,7 +265,19 @@ class TitleState extends MusicBeatState
261265

262266
new FlxTimer().start(2, function(tmr:FlxTimer)
263267
{
264-
FlxG.switchState(new MainMenuState());
268+
// Check if version is outdated
269+
270+
var version:String = "v" + Application.current.meta.get('version');
271+
272+
if (version.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
273+
{
274+
trace('OLD VERSION!');
275+
FlxG.switchState(new OutdatedSubState());
276+
}
277+
else
278+
{
279+
FlxG.switchState(new MainMenuState());
280+
}
265281
});
266282
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
267283
}

0 commit comments

Comments
 (0)