Skip to content

Commit

Permalink
Más arreglos del icono del teléfono si no se recupera
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCastUCM committed Aug 10, 2024
1 parent 7cf1963 commit 67b2d16
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
23 changes: 20 additions & 3 deletions src/managers/phoneManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/scenes/gameLoop/day4/playgroundAfternoonDay4.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
}
}

0 comments on commit 67b2d16

Please sign in to comment.