mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix endgame
This commit is contained in:
parent
ba1fd21174
commit
ec6e7785e5
2 changed files with 13 additions and 0 deletions
|
|
@ -84,6 +84,12 @@ class EndGameGui extends GuiControl {
|
||||||
};
|
};
|
||||||
nextLevel.addChild(nextLevelBtn);
|
nextLevel.addChild(nextLevelBtn);
|
||||||
|
|
||||||
|
function setButtonStates(enabled:Bool) {
|
||||||
|
nextLevelBtn.disabled = !enabled;
|
||||||
|
continueButton.disabled = !enabled;
|
||||||
|
restartButton.disabled = !enabled;
|
||||||
|
}
|
||||||
|
|
||||||
var arial14fontdata = ResourceLoader.getFileEntry("data/font/arial.fnt");
|
var arial14fontdata = ResourceLoader.getFileEntry("data/font/arial.fnt");
|
||||||
var arial14b = new BitmapFont(arial14fontdata.entry);
|
var arial14b = new BitmapFont(arial14fontdata.entry);
|
||||||
@:privateAccess arial14b.loader = ResourceLoader.loader;
|
@:privateAccess arial14b.loader = ResourceLoader.loader;
|
||||||
|
|
@ -309,7 +315,9 @@ class EndGameGui extends GuiControl {
|
||||||
Settings.save();
|
Settings.save();
|
||||||
|
|
||||||
if (idx <= 4) {
|
if (idx <= 4) {
|
||||||
|
setButtonStates(false);
|
||||||
var end = new EnterNameDlg(idx, (name) -> {
|
var end = new EnterNameDlg(idx, (name) -> {
|
||||||
|
setButtonStates(true);
|
||||||
if (scoreSubmitted)
|
if (scoreSubmitted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import h2d.Tile;
|
||||||
|
import hxd.BitmapData;
|
||||||
import h2d.filter.DropShadow;
|
import h2d.filter.DropShadow;
|
||||||
import src.Settings;
|
import src.Settings;
|
||||||
import hxd.res.BitmapFont;
|
import hxd.res.BitmapFont;
|
||||||
|
|
@ -57,6 +59,9 @@ class EnterNameDlg extends GuiControl {
|
||||||
enterNameEdit.position = new Vector(28, 130);
|
enterNameEdit.position = new Vector(28, 130);
|
||||||
enterNameEdit.extent = new Vector(363, 38);
|
enterNameEdit.extent = new Vector(363, 38);
|
||||||
enterNameEdit.text.text = Settings.highscoreName;
|
enterNameEdit.text.text = Settings.highscoreName;
|
||||||
|
haxe.Timer.delay(() -> {
|
||||||
|
enterNameEdit.text.focus();
|
||||||
|
}, 5);
|
||||||
|
|
||||||
var okbutton = new GuiButton(loadButtonImages("data/ui/endgame/ok"));
|
var okbutton = new GuiButton(loadButtonImages("data/ui/endgame/ok"));
|
||||||
okbutton.position = new Vector(151, 184);
|
okbutton.position = new Vector(151, 184);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue