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
7f17e32ad3
commit
773efdd8dd
3 changed files with 10 additions and 2 deletions
|
|
@ -53,6 +53,7 @@ class MarbleGame {
|
|||
var console:ConsoleDlg;
|
||||
|
||||
var _mouseWheelDelta:Float;
|
||||
var _exitingToMenu:Bool = false;
|
||||
|
||||
public function new(scene2d:h2d.Scene, scene:h3d.scene.Scene) {
|
||||
Console.log("Initializing the game...");
|
||||
|
|
@ -289,7 +290,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();
|
||||
|
|
|
|||
|
|
@ -99,8 +99,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());
|
||||
}, () -> {}));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ class MainMenuGui extends GuiImage {
|
|||
var scene2d = MarbleGame.instance.scene2d;
|
||||
#end
|
||||
|
||||
MarbleGame.instance.toRecord = false;
|
||||
|
||||
var offsetX = (scene2d.width - 1280) / 2;
|
||||
var offsetY = (scene2d.height - 720) / 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue