Skip to content

Commit

Permalink
ughh 1.1 coming like in a few
Browse files Browse the repository at this point in the history
  • Loading branch information
yophlox committed Oct 28, 2024
1 parent d6afca6 commit eeac915
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/Utils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import flixel.math.FlxPoint;

class Utils {
// MAIN SWAGGER SHITS!
public static var VERSION:String = " v1.0";
public static var VERSION:String = " v1.1";
static public var soundExt:String = ".mp3";
public static final discordRpc:String = "1139936005785407578";

Expand Down
24 changes: 10 additions & 14 deletions source/states/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,17 @@ class TitleState extends SwagState {

override public function update(elapsed:Float):Void {
if (FlxG.keys.justPressed.ENTER || FlxG.keys.justPressed.SPACE) {
new FlxTimer().start(2, function(tmr:FlxTimer)
{
// Check if version is outdated
AutoUpdater.checkForUpdates();
AutoUpdater.checkForUpdates();

if (AutoUpdater.isNewerVersion(AutoUpdater.latestVersion, AutoUpdater.CURRENT_VERSION) && !OutdatedState.leftState)
{
trace('OLD VERSION!');
transitionState(new OutdatedState());
}
else
{
transitionState(new MainMenuState());
}
});
if (AutoUpdater.isNewerVersion(AutoUpdater.latestVersion, AutoUpdater.CURRENT_VERSION) && !OutdatedState.leftState)
{
trace('OLD VERSION!');
transitionState(new OutdatedState());
}
else
{
transitionState(new MainMenuState());
}
}
super.update(elapsed);
}
Expand Down
13 changes: 10 additions & 3 deletions source/util/AutoUpdater.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* MIT License
*
Expand Down Expand Up @@ -41,7 +40,15 @@ using StringTools;
class AutoUpdater
{
private static inline var VERSION_URL = "https://raw.githubusercontent.com/yophlox/VersionShit/refs/heads/main/Moon4KVer.txt"; // Replace with your repo and txt file
private static inline var DOWNLOAD_URL = "https://github.com/yophlox/Moon4K/releases/latest/download/Moon4K-Release.zip"; // Replace with your repo and zip file
private static inline var DOWNLOAD_URL =
#if windows
"https://github.com/yophlox/Moon4K/releases/latest/download/Moon4K-Win-Release.zip"
#elseif macos
"https://github.com/yophlox/Moon4K/releases/latest/download/Moon4K-Mac-Release.zip"
#elseif linux
"https://github.com/yophlox/Moon4K/releases/latest/download/Moon4K-Linux-Release.zip"
#end
; // Replace with your repo and zip file
public static inline var CURRENT_VERSION = "1.0"; // Replace with your version

public static var latestVersion:String = "";
Expand Down Expand Up @@ -248,4 +255,4 @@ class AutoUpdater
Sys.command("start finish_update.bat");
Application.current.window.close();
}
}
}

0 comments on commit eeac915

Please sign in to comment.