Skip to content

Commit

Permalink
Version Checker DONE
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed Oct 21, 2024
1 parent f2efdbf commit 88bffee
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 304 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ABOUT DEVELOPMENT
- I feel like working on this again!
- stuff im planning to add:
- version checker
- [DONE] version checker
- Events (play animations, change characters, etc)
- Compatibility with other engines
- [DONE] option pack saver (saving all the options into a json that you can put back into the game)
Expand Down
68 changes: 0 additions & 68 deletions source/NoteHoldCover.hx

This file was deleted.

3 changes: 3 additions & 0 deletions source/SaveDataHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,8 @@ class SaveDataHandler

if (FlxG.save.data.curRS == null)
FlxG.save.data.curRS = '';

if (FlxG.save.data.checkVersion == null)
FlxG.save.data.checkVersion = true;
}
}
24 changes: 24 additions & 0 deletions source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class TitleState extends MusicBeatState
public static var currentMod:String = 'test';
public static var modFolder:String = '';
public static var onlyforabug:Bool = false;
public static var checkedVersion:Bool;


override public function create():Void
Expand Down Expand Up @@ -403,6 +404,29 @@ class TitleState extends MusicBeatState
/* #if debug
FlxG.save.data.exploitationState = null;
#end */
if (FlxG.save.data.checkVersion) {
var http = new haxe.Http("https://raw.githubusercontent.com/CamtheKirby/VsDave-Modable/refs/heads/main/version.downloadMe");
var returnedData:Array<String> = [];

http.onData = function(data:String)
{
returnedData[0] = data.substring(0, data.indexOf(';'));
returnedData[1] = data.substring(data.indexOf('-'), data.length);
if (!MainMenuState.kadeEngineVer.contains(returnedData[0].trim()) && !checkedVersion)
{
fancyOpenURL("https://github.com/CamtheKirby/VsDave-Modable/releases/latest");
}
checkedVersion = true;
}

http.onError = function(error)
{
trace('error: $error');
}

http.request();
}

FlxG.switchState(FlxG.save.data.alreadyGoneToWarningScreen && FlxG.save.data.exploitationState != 'playing' ? new MainMenuState() : new OutdatedSubState());
});
}
Expand Down
226 changes: 0 additions & 226 deletions source/UISelectState.hx

This file was deleted.

Loading

0 comments on commit 88bffee

Please sign in to comment.