Identity notices time out
authorMegaBrutal <code+git@megabrutal.com>
Sun, 16 Sep 2018 07:15:00 +0000 (09:15 +0200)
committerMegaBrutal <code+git@megabrutal.com>
Sun, 16 Sep 2018 07:15:00 +0000 (09:15 +0200)
After Take ID, notices time out after 5 seconds.

modified:   wgj58.js

wgj58.js

index b3f6ac1..d737ad8 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;