mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-05-05 23:43:36 +02:00
Ajout d'un message quand le mot saisi est trop court
This commit is contained in:
parent
dec9ccfe09
commit
136af6028e
|
@ -79,6 +79,10 @@ 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.length !== this._motATrouver.length) {
|
||||
NotificationMessage.ajouterNotification("Le mot proposé est trop court");
|
||||
return;
|
||||
}
|
||||
if (mot[0] !== this._motATrouver[0]) {
|
||||
NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché");
|
||||
return;
|
||||
|
|
|
@ -76,8 +76,8 @@ export default class Input {
|
|||
private validerMot(): void {
|
||||
if (this._estBloque) return;
|
||||
let mot = this._motSaisi;
|
||||
this._gestionnaire.verifierMot(mot);
|
||||
if (mot.length === this._longueurMot) {
|
||||
this._gestionnaire.verifierMot(mot);
|
||||
this._motSaisi = "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue