fix a bug in the namefield hidden thingy

This commit is contained in:
Aaron Mueller 2013-05-16 22:14:01 +02:00
parent 22084bd6fd
commit fa057f8efe

View file

@ -133,11 +133,11 @@ ig.module(
} }
if (ig.input.pressed('submit-score')) { 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) { this.saveScore(this.nameField.name(), ig.global.score, function(context) {
setTimeout(function() { context.loadScores(); }, 2000); setTimeout(function() { context.loadScores(); }, 2000);
}); });
this.nameField.kill();
this.nameField = null;
} }
this.parent(); 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); this.font.draw(ig.global.score, 485, 150, ig.Font.ALIGN.RIGHT);
} }
}); });