From 0ed641e27ca4e7cdd8edea041dd207a1aa3fd77c Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 16 Sep 2018 09:15:00 +0200 Subject: [PATCH] Identity notices time out After Take ID, notices time out after 5 seconds. modified: wgj58.js --- wgj58.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wgj58.js b/wgj58.js index b3f6ac1..d737ad8 100644 --- 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; -- 2.34.1