Identity notices time out
[wgj58.git] / wgj58.js
index a50e494c279fa916ccdf27dfa76f50cd8857c2ef..d737ad82fe0fb9f347e980b5c4453eeeee663870 100644 (file)
--- a/wgj58.js
+++ b/wgj58.js
@@ -160,6 +160,7 @@ class Player extends Phaser.Sprite {
                this.loadTexture(npc.key);
                npc.kill();
                this.disguise = npc;
+               logic.gameinterface.dropNoticeTimeout(Phaser.Timer.SECOND * 5, "You are now identified as " + npc.fullname + "!");
        }
 }
 
@@ -592,6 +593,11 @@ class GameInterface extends Phaser.Group {
                this.text_notice.visible = true;
        }
 
+       dropNoticeTimeout(timeout, text) {
+               this.dropNotice(text);
+               game.time.events.add(timeout, this.clearNotice, this);
+       }
+
        clearNotice() {
                this.back_notice.visible = false;
                this.text_notice.visible = false;