From e9dedff6041349af55827948430a52428350e9ce Mon Sep 17 00:00:00 2001 From: JonathanMM Date: Mon, 10 Jan 2022 19:55:14 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20#5:=20Am=C3=A9lioration=20du=20message=20?= =?UTF-8?q?d'erreur=20si=20le=20mot=20propos=C3=A9=20ne=20commence=20pas?= =?UTF-8?q?=20par=20la=20bonne=20lettre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ts/gestionnaire.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/gestionnaire.ts b/ts/gestionnaire.ts index cf5e745..e013f17 100644 --- a/ts/gestionnaire.ts +++ b/ts/gestionnaire.ts @@ -79,8 +79,12 @@ export default class Gestionnaire { public verifierMot(mot: string, skipAnimation: boolean = false): void { mot = this._dictionnaire.nettoyerMot(mot); //console.debug(mot + " => " + (this._dictionnaire.estMotValide(mot) ? "Oui" : "non")); - if (mot[0] !== this._motATrouver[0] || !this._dictionnaire.estMotValide(mot)) { - NotificationMessage.ajouterNotification("Ce mot n'est pas valide"); + if (mot[0] !== this._motATrouver[0]) { + NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché"); + return; + } + if (!this._dictionnaire.estMotValide(mot)) { + NotificationMessage.ajouterNotification("Ce mot n'est pas dans notre dictionnaire"); return; } if (!this._datePartieEnCours) this._datePartieEnCours = new Date();