From 67b2d16897c8fd2221eb5353f86f1403437b0e9e Mon Sep 17 00:00:00 2001 From: MattCastUCM <100031127+MattCastUCM@users.noreply.github.com> Date: Sat, 10 Aug 2024 20:49:49 +0200 Subject: [PATCH] =?UTF-8?q?M=C3=A1s=20arreglos=20del=20icono=20del=20tel?= =?UTF-8?q?=C3=A9fono=20si=20no=20se=20recupera?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/managers/phoneManager.js | 23 ++++++++++++++++--- .../gameLoop/day4/playgroundAfternoonDay4.js | 9 +++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/managers/phoneManager.js b/src/managers/phoneManager.js index 65066e0..672e245 100644 --- a/src/managers/phoneManager.js +++ b/src/managers/phoneManager.js @@ -307,11 +307,28 @@ export default class PhoneManager { * @param {Boolean} active - true si se va a mostrar, false en caso contrario */ activate(active) { + // Se guarda el telefono al instante this.showPhone(false); - this.icon.visible = active; - this.notifications.visible = this.notificationAmount > 0 && active; + + // Si se quiere activar + if (active) { + // Si no es el dia 4, o si se han intercambiado las contrasenas, o si no se han intercambiado + // pero se ha recuperado el movil, vuelven a aparecer el icono del telefono y las notificaciones + if (this.gameManager.day !== 4 || this.gameManager.getValue("passwordExchanged") + || (!this.gameManager.getValue("passwordExchanged") && this.gameManager.getValue("phoneFound"))) + { + this.icon.visible = true; + // Las notificaciones solo aparecen si hay mas de 0 notificaciones + this.notifications.visible = this.notificationAmount > 0; + } + } + // Si no, se desactivan el icono y las notificaciones + else { + this.icon.visible = false; + this.notifications.visible = false; + } } - + /** * Muestra/oculta el telefono de manera inmediata * @param {Boolean} active - true si se va a activar, false en caso contrario diff --git a/src/scenes/gameLoop/day4/playgroundAfternoonDay4.js b/src/scenes/gameLoop/day4/playgroundAfternoonDay4.js index e610267..158661a 100644 --- a/src/scenes/gameLoop/day4/playgroundAfternoonDay4.js +++ b/src/scenes/gameLoop/day4/playgroundAfternoonDay4.js @@ -18,9 +18,12 @@ export default class PlaygroundAfternoonDay4 extends PlaygroundBase { // Si no se han intercambiado contrasenas, sale el dialogo de la nota if (!this.gameManager.getValue("passwordExchanged")) { - nodes = this.cache.json.get('playgroundAfternoonDay4'); - let node = super.readNodes(nodes, "day4\\playgroundAfternoonDay4","note", true); - this.dialogManager.setNode(node); + setTimeout(() => { + nodes = this.cache.json.get('playgroundAfternoonDay4'); + let node = super.readNodes(nodes, "day4\\playgroundAfternoonDay4", "note", true); + this.dialogManager.setNode(node); + }, 100); + } } }