mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix replay exit bug
This commit is contained in:
parent
2d4deab45f
commit
0bfed0ffa0
3 changed files with 10 additions and 2 deletions
|
|
@ -52,6 +52,7 @@ class MarbleGame {
|
|||
|
||||
var consoleShown:Bool = false;
|
||||
var console:ConsoleDlg;
|
||||
var _exitingToMenu:Bool = false;
|
||||
|
||||
public function new(scene2d:h2d.Scene, scene:h3d.scene.Scene) {
|
||||
Console.log("Initializing the game...");
|
||||
|
|
@ -284,7 +285,12 @@ class MarbleGame {
|
|||
#end
|
||||
} else {
|
||||
var pmg = new LevelSelectGui(LevelSelectGui.currentDifficultyStatic);
|
||||
canvas.setContent(pmg);
|
||||
if (_exitingToMenu) {
|
||||
_exitingToMenu = false;
|
||||
canvas.setContent(new MainMenuGui());
|
||||
} else {
|
||||
canvas.setContent(pmg);
|
||||
}
|
||||
}
|
||||
|
||||
Settings.save();
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ class ExitGameDlg extends GuiImage {
|
|||
btnList.addButton(4, "Main Menu", (evt) -> {
|
||||
MarbleGame.canvas.pushDialog(new MessageBoxYesNoDlg("Are you sure you want to exit this level? You will lose your current level progress.",
|
||||
() -> {
|
||||
MarbleGame.instance._exitingToMenu = true;
|
||||
yesFunc(btnList);
|
||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||
}, () -> {}));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class MainMenuGui extends GuiImage {
|
|||
|
||||
var scene2d = MarbleGame.canvas.scene2d;
|
||||
|
||||
MarbleGame.instance.toRecord = false;
|
||||
|
||||
var offsetX = (scene2d.width - 1280) / 2;
|
||||
var offsetY = (scene2d.height - 720) / 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue