fix replay black screen and replays exiting in the wrong menus

This commit is contained in:
RandomityGuy 2025-11-12 11:50:56 +00:00
parent c3cbc30b29
commit e7c86cc05e
3 changed files with 10 additions and 12 deletions

View file

@ -355,6 +355,13 @@ class MarbleGame {
paused = false;
if (watching) {
canvas.setContent(Type.createInstance(replayExitGui, []));
setPreviewMission(lastMis, () -> {
#if js
var pointercontainer = js.Browser.document.querySelector("#pointercontainer");
pointercontainer.hidden = false;
#end
});
} else {
if (Net.isMP) {
if (weDisconnecting) {

View file

@ -1546,18 +1546,7 @@ class MarbleWorld extends Scheduler {
}
this.setCursorLock(false);
var misFile = haxe.io.Path.withoutExtension(haxe.io.Path.withoutDirectory(mission.path));
this.dispose();
MarbleGame.instance.setPreviewMission(misFile, () -> {
#if !js
MarbleGame.canvas.setContent(new ReplayCenterGui());
#end
#if js
MarbleGame.canvas.setContent(new MainMenuGui());
var pointercontainer = js.Browser.document.querySelector("#pointercontainer");
pointercontainer.hidden = false;
#end
});
MarbleGame.instance.quitMission();
return;
}
}

View file

@ -134,6 +134,8 @@ class PreviewWorld extends Scheduler {
_loadToken++;
var groupName = (misname + "group").toLowerCase();
var group = levelGroups.get(groupName);
if (group == null)
group = levelGroups.get("urban"); // Use this as fallback
if (group != null) {
destroyAllObjects();
this.currentMission = misname;