mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-22 02:32:01 +00:00
Add next level button as well
This commit is contained in:
parent
73b70ab6ab
commit
7f000d8021
2 changed files with 14 additions and 14 deletions
|
|
@ -1670,10 +1670,6 @@ class MarbleWorld extends Scheduler {
|
|||
if (Util.isTouchDevice()) {
|
||||
MarbleGame.instance.touchInput.hideControls(@:privateAccess this.playGui.playGuiCtrl);
|
||||
}
|
||||
if (this.isRecording) {
|
||||
this.isRecording = false; // Stop recording here if we haven't already
|
||||
this.clearScheduleId("stopRecordingTimeout");
|
||||
}
|
||||
var endGameCode = () -> {
|
||||
this.dispose();
|
||||
var pmg = new PlayMissionGui();
|
||||
|
|
@ -1701,9 +1697,6 @@ class MarbleWorld extends Scheduler {
|
|||
}
|
||||
// @:privateAccess playGui.playGuiCtrl.render(scene2d);
|
||||
}
|
||||
if (this.isRecording) {
|
||||
this.clearScheduleId("stopRecordingTimeout");
|
||||
}
|
||||
if (MarbleGame.instance.toRecord) {
|
||||
MarbleGame.canvas.pushDialog(new ReplayNameDlg(() -> {
|
||||
this.isRecording = true;
|
||||
|
|
@ -1712,6 +1705,18 @@ class MarbleWorld extends Scheduler {
|
|||
} else {
|
||||
restartGameCode();
|
||||
}
|
||||
}, (sender) -> {
|
||||
var nextLevelCode = () -> {
|
||||
var nextMission = mission.getNextMission();
|
||||
if (nextMission != null) {
|
||||
MarbleGame.instance.playMission(nextMission);
|
||||
}
|
||||
}
|
||||
if (MarbleGame.instance.toRecord) {
|
||||
MarbleGame.canvas.pushDialog(new ReplayNameDlg(nextLevelCode));
|
||||
} else {
|
||||
nextLevelCode();
|
||||
}
|
||||
}, mission, finishTime);
|
||||
MarbleGame.canvas.pushDialog(egg);
|
||||
this.setCursorLock(false);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class EndGameGui extends GuiControl {
|
|||
|
||||
var scoreSubmitted:Bool = false;
|
||||
|
||||
public function new(continueFunc:GuiControl->Void, restartFunc:GuiControl->Void, mission:Mission, timeState:TimeState) {
|
||||
public function new(continueFunc:GuiControl->Void, restartFunc:GuiControl->Void, nextLevelFunc:GuiControl->Void, mission:Mission, timeState:TimeState) {
|
||||
super();
|
||||
this.horizSizing = Width;
|
||||
this.vertSizing = Height;
|
||||
|
|
@ -77,12 +77,7 @@ class EndGameGui extends GuiControl {
|
|||
nextLevelBtn.vertSizing = Height;
|
||||
nextLevelBtn.position = new Vector(0, 0);
|
||||
nextLevelBtn.extent = new Vector(130, 110);
|
||||
nextLevelBtn.pressedAction = (e) -> {
|
||||
var nextMission = mission.getNextMission();
|
||||
if (nextMission != null) {
|
||||
cast(this.parent, Canvas).marbleGame.playMission(nextMission);
|
||||
}
|
||||
};
|
||||
nextLevelBtn.pressedAction = (e) -> nextLevelFunc(nextLevelBtn);
|
||||
nextLevel.addChild(nextLevelBtn);
|
||||
|
||||
function setButtonStates(enabled:Bool) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue