From fa057f8efe61c276dfae2545390b438bad5c40fd Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Thu, 16 May 2013 22:14:01 +0200 Subject: [PATCH] fix a bug in the namefield hidden thingy --- dev/lib/game/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/lib/game/main.js b/dev/lib/game/main.js index 3c10730..7d7d625 100755 --- a/dev/lib/game/main.js +++ b/dev/lib/game/main.js @@ -133,11 +133,11 @@ ig.module( } if (ig.input.pressed('submit-score')) { - this.nameField.kill(); - //TODO: The name field does not kill itself ... this.draw(); this.saveScore(this.nameField.name(), ig.global.score, function(context) { setTimeout(function() { context.loadScores(); }, 2000); }); + this.nameField.kill(); + this.nameField = null; } this.parent(); }, @@ -173,7 +173,7 @@ ig.module( } } - this.nameField.draw(260, 200); + if (this.nameField !== null) this.nameField.draw(260, 200); this.font.draw(ig.global.score, 485, 150, ig.Font.ALIGN.RIGHT); } });