mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-04-27 19:52:55 +02:00
Ajout de la touche POINT
This commit is contained in:
parent
723d94fac7
commit
e1f02a666f
|
@ -170,15 +170,20 @@ export default class Gestionnaire {
|
||||||
mot = Dictionnaire.nettoyerMot(mot);
|
mot = Dictionnaire.nettoyerMot(mot);
|
||||||
//console.debug(mot + " => " + (Dictionnaire.estMotValide(mot) ? "Oui" : "non"));
|
//console.debug(mot + " => " + (Dictionnaire.estMotValide(mot) ? "Oui" : "non"));
|
||||||
if (mot.length !== this._motATrouver.length) {
|
if (mot.length !== this._motATrouver.length) {
|
||||||
NotificationMessage.ajouterNotification("Le mot proposé est trop court");
|
NotificationMessage.ajouterNotification("Le mot proposé est trop court.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (mot.includes(".")) {
|
||||||
|
NotificationMessage.ajouterNotification("Votre mot ne doit contenir que des lettres.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
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 false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(await Dictionnaire.estMotValide(mot, this._motATrouver[0], this._motATrouver.length))) {
|
if (!(await Dictionnaire.estMotValide(mot, this._motATrouver[0], this._motATrouver.length))) {
|
||||||
NotificationMessage.ajouterNotification("Ce mot n'est pas dans notre dictionnaire");
|
NotificationMessage.ajouterNotification("Ce mot n'est pas dans notre dictionnaire.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this._datePartieEnCours) this._datePartieEnCours = new Date();
|
if (!this._datePartieEnCours) this._datePartieEnCours = new Date();
|
||||||
|
|
12
ts/input.ts
12
ts/input.ts
|
@ -81,26 +81,26 @@ export default class Input {
|
||||||
case ClavierDisposition.Bépo:
|
case ClavierDisposition.Bépo:
|
||||||
return [
|
return [
|
||||||
["B", "E", "P", "O", "W", "V", "D", "L", "J", "Z"],
|
["B", "E", "P", "O", "W", "V", "D", "L", "J", "Z"],
|
||||||
["A", "U", "I", "C", "T", "S", "R", "N", "M"],
|
["A", "U", "I", "E", "C", "T", "S", "R", "N", "M"],
|
||||||
["_effacer", "Y", "X", "K", "Q", "G", "H", "F", "_entree"],
|
["_effacer", "Y", "X", ".", "K", "Q", "G", "H", "F", "_entree"],
|
||||||
];
|
];
|
||||||
case ClavierDisposition.Qwerty:
|
case ClavierDisposition.Qwerty:
|
||||||
return [
|
return [
|
||||||
["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
|
["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
|
||||||
["A", "S", "D", "F", "G", "H", "J", "K", "L"],
|
["A", "S", "D", "F", "G", "H", "J", "K", "L"],
|
||||||
["_vide", "Z", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"],
|
[".", "Z", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"],
|
||||||
];
|
];
|
||||||
case ClavierDisposition.Qwertz:
|
case ClavierDisposition.Qwertz:
|
||||||
return [
|
return [
|
||||||
["Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P"],
|
["Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P"],
|
||||||
["A", "S", "D", "F", "G", "H", "J", "K", "L"],
|
["A", "S", "D", "F", "G", "H", "J", "K", "L"],
|
||||||
["_vide", "Y", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"],
|
[".", "Y", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"],
|
||||||
];
|
];
|
||||||
default:
|
default:
|
||||||
return [
|
return [
|
||||||
["A", "Z", "E", "R", "T", "Y", "U", "I", "O", "P"],
|
["A", "Z", "E", "R", "T", "Y", "U", "I", "O", "P"],
|
||||||
["Q", "S", "D", "F", "G", "H", "J", "K", "L", "M"],
|
["Q", "S", "D", "F", "G", "H", "J", "K", "L", "M"],
|
||||||
["_videdouble", "W", "X", "C", "V", "B", "N", "_effacer", "_entree"],
|
["_vide", ".", "W", "X", "C", "V", "B", "N", "_effacer", "_entree"],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ export default class Input {
|
||||||
|
|
||||||
if (touche === "Enter") {
|
if (touche === "Enter") {
|
||||||
this.validerMot();
|
this.validerMot();
|
||||||
} else if (/^[A-Z]$/.test(Dictionnaire.nettoyerMot(touche))) {
|
} else if (/^[A-Z.]$/.test(Dictionnaire.nettoyerMot(touche))) {
|
||||||
this.saisirLettre(touche);
|
this.saisirLettre(touche);
|
||||||
}
|
}
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
|
|
Loading…
Reference in a new issue