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);
|
||||
|
||||
function setButtonStates(enabled:Bool) {
|
||||
nextLevelBtn.disabled = !enabled;
|
||||
continueButton.disabled = !enabled;
|
||||
restartButton.disabled = !enabled;
|
||||
}
|
||||
|
||||
var arial14fontdata = ResourceLoader.getFileEntry("data/font/arial.fnt");
|
||||
var arial14b = new BitmapFont(arial14fontdata.entry);
|
||||
@:privateAccess arial14b.loader = ResourceLoader.loader;
|
||||
|
|
@ -309,7 +315,9 @@ class EndGameGui extends GuiControl {
|
|||
Settings.save();
|
||||
|
||||
if (idx <= 4) {
|
||||
setButtonStates(false);
|
||||
var end = new EnterNameDlg(idx, (name) -> {
|
||||
setButtonStates(true);
|
||||
if (scoreSubmitted)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package gui;
|
||||
|
||||
import h2d.Tile;
|
||||
import hxd.BitmapData;
|
||||
import h2d.filter.DropShadow;
|
||||
import src.Settings;
|
||||
import hxd.res.BitmapFont;
|
||||
|
|
@ -57,6 +59,9 @@ class EnterNameDlg extends GuiControl {
|
|||
enterNameEdit.position = new Vector(28, 130);
|
||||
enterNameEdit.extent = new Vector(363, 38);
|
||||
enterNameEdit.text.text = Settings.highscoreName;
|
||||
haxe.Timer.delay(() -> {
|
||||
enterNameEdit.text.focus();
|
||||
}, 5);
|
||||
|
||||
var okbutton = new GuiButton(loadButtonImages("data/ui/endgame/ok"));
|
||||
okbutton.position = new Vector(151, 184);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue