Skip to content

Commit 432e818

Browse files
committed
Merge branch 'Archipelago' of https://github.com/Z11Coding/Mixtape-Engine-Rework into Archipelago
2 parents 821607a + 46918fe commit 432e818

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

source/archipelago/APEntryState.hx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,48 @@ class APEntryState extends MusicBeatState
440440
runArch();
441441
}
442442

443+
public static function checkAPWorld():{status:String, message:String}
444+
{
445+
#if sys
446+
var programDataPath = "C:/ProgramData/Archipelago/";
447+
var customWorldsPath = programDataPath + "custom_worlds/";
448+
var apWorldFile = customWorldsPath + "fridaynightfunkin.apworld";
449+
450+
try {
451+
if (FileSystem.exists(apWorldFile))
452+
{
453+
trace("APWorld file found.");
454+
var apworld = haxe.Resource.getBytes("apworld");
455+
var installedApworld = File.getBytes(apWorldFile);
456+
if (apworld.compare(installedApworld) == 0) {
457+
trace("APWorld file matches the current version.");
458+
return {status: "exact", message: "APWorld file matches the current version."};
459+
} else {
460+
trace("APWorld file does not match the current version.");
461+
return {status: "outdated", message: "APWorld file does not match the current version."};
462+
}
463+
}
464+
else
465+
{
466+
trace("APWorld file not found.");
467+
return {status: "missing", message: "APWorld file not found."};
468+
}
469+
} catch (e:Dynamic) {
470+
trace("Error checking APWorld file: " + e);
471+
return {status: "error", message: "Error checking APWorld file: " + e};
472+
}
473+
#end
474+
return {status: "unsupported", message: "System not supported."};
475+
}
476+
477+
public static function checkAndAlertAPWorld():Void
478+
{
479+
var result = checkAPWorld();
480+
if (result.status == "outdated") {
481+
Application.current.window.alert(result.message + "\nPlease update it in the AP Menu.", "APWorld Update Recommended");
482+
}
483+
}
484+
443485
public static function installAPWorld():Void
444486
{
445487
#if sys

source/archipelago/APPlayState.hx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,11 @@ public function doEffect(effect:String)
18031803
if (deathLinkPacket.cause != null && (deathLinkPacket.cause != "" || deathLinkPacket.cause != " ")) cause = deathLinkPacket.cause + "\n[pause:0.5](Sounds like a skill issue...)";
18041804
}
18051805
catch(e) {trace('DEATHLINKPACK WAS NULL!');}
1806-
if (cause.trim() == "") cause = deathLinkPacket.source + " has died.\n[pause:0.5](How Unfortunate...)";
1806+
try {
1807+
if (cause.trim() == "") cause = deathLinkPacket.source + " has died.\n[pause:0.5](How Unfortunate...)";
1808+
} catch (e:Dynamic) {
1809+
cause = "???\n[pause:0.5](Someone died... somehow...)\n[pause:0.5](Unsure how...)";
1810+
}
18071811
COD.setCOD(null, cause);
18081812
die();
18091813
trace("Triggering DeathLink!");

source/states/FirstCheckState.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ class FirstCheckState extends MusicBeatState
136136
updateRibbon.visible = true;
137137
updateRibbon.alpha = 1;
138138
});
139+
140+
archipelago.APEntryState.checkAndAlertAPWorld();
139141
}
140142
else
141143
{

0 commit comments

Comments
 (0)