mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-06-10 01:42:13 +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 {
|
public verifierMot(mot: string, skipAnimation: boolean = false): void {
|
||||||
mot = this._dictionnaire.nettoyerMot(mot);
|
mot = this._dictionnaire.nettoyerMot(mot);
|
||||||
//console.debug(mot + " => " + (this._dictionnaire.estMotValide(mot) ? "Oui" : "non"));
|
//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]) {
|
if (mot[0] !== this._motATrouver[0]) {
|
||||||
NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché");
|
NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -76,8 +76,8 @@ export default class Input {
|
||||||
private validerMot(): void {
|
private validerMot(): void {
|
||||||
if (this._estBloque) return;
|
if (this._estBloque) return;
|
||||||
let mot = this._motSaisi;
|
let mot = this._motSaisi;
|
||||||
|
this._gestionnaire.verifierMot(mot);
|
||||||
if (mot.length === this._longueurMot) {
|
if (mot.length === this._longueurMot) {
|
||||||
this._gestionnaire.verifierMot(mot);
|
|
||||||
this._motSaisi = "";
|
this._motSaisi = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue