Identity notices time out
[wgj58.git] / wgj58.js
index b3f6ac13743ee93606539ac2030ff31dbc0e1c83..d737ad82fe0fb9f347e980b5c4453eeeee663870 100644 (file)
--- a/wgj58.js
+++ b/wgj58.js
@@ -160,7 +160,7 @@ class Player extends Phaser.Sprite {
                this.loadTexture(npc.key);
                npc.kill();
                this.disguise = npc;
-               logic.gameinterface.dropNotice("You are now identified as " + npc.fullname + "!");
+               logic.gameinterface.dropNoticeTimeout(Phaser.Timer.SECOND * 5, "You are now identified as " + npc.fullname + "!");
        }
 }
 
@@ -593,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;