fix endgame

This commit is contained in:
RandomityGuy 2022-12-18 01:06:07 +05:30
parent 08e3c6ad23
commit c9a1c47dea
2 changed files with 11 additions and 0 deletions

View file

@ -52,6 +52,12 @@ class EndGameGui extends GuiControl {
restartButton.extent = new Vector(104, 48);
restartButton.pressedAction = restartFunc;
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;
@ -173,7 +179,9 @@ class EndGameGui extends GuiControl {
Settings.save();
if (idx <= 2) {
setButtonStates(false);
var end = new EnterNameDlg(idx, (name) -> {
setButtonStates(true);
if (scoreSubmitted)
return;

View file

@ -61,6 +61,9 @@ class EnterNameDlg extends GuiControl {
enterNameEdit.position = new Vector(87, 136);
enterNameEdit.extent = new Vector(255, 36);
enterNameEdit.text.text = Settings.highscoreName;
haxe.Timer.delay(() -> {
enterNameEdit.text.focus();
}, 5);
var okbutton = new GuiButton(loadButtonImages("data/ui/common/ok"));
okbutton.position = new Vector(163, 182);