diff --git a/src/components/TownSquare.vue b/src/components/TownSquare.vue
index ef6ac39..1ef520c 100644
--- a/src/components/TownSquare.vue
+++ b/src/components/TownSquare.vue
@@ -81,6 +81,16 @@
⏵
+
+
☀
☽
@@ -317,16 +327,46 @@ export default {
this.nominate = -1;
},
renameTimer() {
- let newName = prompt("Timer Name", "");
+ let newName = prompt(this.locale.townsquare.timer.prompt.name, this.timerName);
if (newName === "") {
- return;
+ newName = this.locale.townsquare.timer.default.text;
}
this.timerName = newName.trim();
},
+ setDaytimeTimer() {
+ this.timerDuration = 8;
+ this.timerName = this.locale.townsquare.timer.daytime.text;
+ },
+ setNominationTimer() {
+ this.timerDuration = 2;
+ this.timerName = this.timerName = this.locale.townsquare.timer.nominations.text;
+ },
+ setDuskTimer() {
+ this.timerDuration = 1;
+ this.timerName = this.timerName = this.locale.townsquare.timer.dusk.text;
+ },
+ setAccusationTimer() {
+ this.timerDuration = 1;
+ let timerText = this.locale.townsquare.timer.accusation.text;
+ timerText = timerText.replace("$accusator", this.players[this.session.nomination[0]].name).replace("$accusee", this.players[this.session.nomination[1]].name);
+ this.timerName = timerText;
+ },
+ setDefenseTimer() {
+ this.timerDuration = 1;
+ let timerText = this.locale.townsquare.timer.defense.text;
+ timerText = timerText.replace("$accusee", this.players[this.session.nomination[1]].name).replace("$accusator", this.players[this.session.nomination[0]].name);
+ this.timerName = timerText;
+ },
+ setDebateTimer() {
+ this.timerDuration = 2;
+ let timerText = this.locale.townsquare.timer.debate.text;
+ timerText = timerText.replace("$accusee", this.players[this.session.nomination[1]].name);
+ this.timerName = timerText;
+ },
setTimer() {
- let newDuration = prompt("Timer Duration in minutes");
+ let newDuration = prompt(this.locale.townsquare.timer.prompt.duration);
if (isNaN(newDuration)) {
- return alert("Incorrect number");
+ return alert(this.locale.townsquare.timer.prompt.durationError);
}
if (newDuration > 0) {
this.timerDuration = newDuration;
diff --git a/src/store/locale/en/ui.json b/src/store/locale/en/ui.json
index ffdc183..39eb349 100644
--- a/src/store/locale/en/ui.json
+++ b/src/store/locale/en/ui.json
@@ -93,7 +93,41 @@
"others": "Other characters",
"bluffs": "Demon bluffs",
"fabled": "Fabled",
- "storytellerTools": "Storytelling"
+ "storytellerTools": "Storytelling",
+ "timer": {
+ "default": {
+ "text": "Timer"
+ },
+ "prompt": {
+ "name": "Timer name",
+ "duration": "Timer duration in minutes",
+ "durationError": "Timer duration must be a number"
+ },
+ "daytime": {
+ "button": "Daytime",
+ "text": "Daytime"
+ },
+ "nominations": {
+ "button": "Nominations",
+ "text": "Nominations open"
+ },
+ "dusk": {
+ "button": "Dusk",
+ "text": "End of day"
+ },
+ "accusation": {
+ "button": "Accusation",
+ "text": "$accusator accuses $accusee"
+ },
+ "defense": {
+ "button": "Defense",
+ "text": "$accusee defends against $accusator"
+ },
+ "debate": {
+ "button": "Debate",
+ "text": "Should $accusee be executed ?"
+ }
+ }
},
"towninfo":{
"addPlayers":"Please add more players!",
diff --git a/src/store/locale/fr/ui.json b/src/store/locale/fr/ui.json
index dc961b9..6db7e28 100644
--- a/src/store/locale/fr/ui.json
+++ b/src/store/locale/fr/ui.json
@@ -93,7 +93,41 @@
"others": "Autres Rôles",
"bluffs": "Bluffs de Démon",
"fabled": "Fabuleux",
- "storytellerTools": "Narration"
+ "storytellerTools": "Narration",
+ "timer": {
+ "default": {
+ "text": "Compte à rebours"
+ },
+ "prompt": {
+ "name": "Nom du compte à rebours",
+ "duration": "Durée en minutes",
+ "durationError": "Veuillez saisir un nombre en minutes"
+ },
+ "daytime": {
+ "button": "Journée",
+ "text": "Journée"
+ },
+ "nominations": {
+ "button": "Nominations",
+ "text": "Nominations ouvertes"
+ },
+ "dusk": {
+ "button": "Fin de Journée",
+ "text": "Fin de Journée"
+ },
+ "accusation": {
+ "button": "Accusation",
+ "text": "$accusator accuse $accusee"
+ },
+ "defense": {
+ "button": "Défense",
+ "text": "$accusee se défend de $accusator"
+ },
+ "debate": {
+ "button": "Débat",
+ "text": "$accusee doit mourrir ?"
+ }
+ }
},
"towninfo":{
"addPlayers": "Appuyez sur [A] pour ajouter plus de joueurs !",