From 8eb2b217b85d64dff799fd48ddbc06c2fa7cf86c Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Mon, 31 Jul 2023 09:34:28 +0200 Subject: [PATCH 1/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fef68c7..e9411d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Upcomming Version -### Version 3.15.1 +### Version 3.16.0 Updating night order (and its print) ### Version 3.15.0 From 0e0b1a5475600b50b2f1069d5b57962c42651c25 Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Mon, 31 Jul 2023 11:52:19 +0200 Subject: [PATCH 2/6] Update CHANGELOG.md --- CHANGELOG.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9411d1..428ce1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,12 +21,6 @@ Some corrections in the reminders tokens: - Putting some tokens in "remindersGlobal" - Deleting some useless tokens, or adding some other -### Version 3.13.1 -Some corrections in the reminders tokens: -- Correcting some french names -- Putting some tokens in "remindersGlobal" -- Deleting some useless tokens, or adding some other - --- ### Version 3.13.0 - Correcting the print when ST assigns roles (adding spaces) From b94e279101cee91a78590806449549cce43e5560 Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:07:48 +0200 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 428ce1c..949925b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,6 @@ # Release Notes ## Upcomming Version - -### Version 3.16.0 Updating night order (and its print) ### Version 3.15.0 From 3e7ec64c244403b4dfab0dc6d476f2327d80eeb5 Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:09:17 +0200 Subject: [PATCH 4/6] Update players.js --- src/store/modules/players.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/store/modules/players.js b/src/store/modules/players.js index 9a7ab0f..d60e094 100644 --- a/src/store/modules/players.js +++ b/src/store/modules/players.js @@ -28,33 +28,33 @@ const getters = { nightOrder({ players, fabled }) { const firstNight = [0]; const otherNight = [0]; - players.forEach(({ role }) => { - if (role.firstNight && !firstNight.includes(role.firstNight)) { - firstNight.push(role.firstNight); - } - if (role.otherNight && !otherNight.includes(role.otherNight)) { - otherNight.push(role.otherNight); - } - }); fabled.forEach(role => { if (role.firstNight && !firstNight.includes(role.firstNight)) { - firstNight.push(role.firstNight); + firstNight.push(role); } if (role.otherNight && !otherNight.includes(role.otherNight)) { - otherNight.push(role.otherNight); + otherNight.push(role); } }); - firstNight.sort((a, b) => a - b); - otherNight.sort((a, b) => a - b); + players.forEach(({ role }) => { + if (role.firstNight && !firstNight.includes(role.firstNight)) { + firstNight.push(role); + } + if (role.otherNight && !otherNight.includes(role.otherNight)) { + otherNight.push(role); + } + }); + firstNight.sort((a, b) => a.firstNight - b.firstNight); + otherNight.sort((a, b) => a.otherNight - b.otherNight); const nightOrder = new Map(); players.forEach(player => { - const first = Math.max(firstNight.indexOf(player.role.firstNight), 0); - const other = Math.max(otherNight.indexOf(player.role.otherNight), 0); + const first = Math.max(firstNight.indexOf(player.role), 0); + const other = Math.max(otherNight.indexOf(player.role), 0); nightOrder.set(player, { first, other }); }); fabled.forEach(role => { - const first = Math.max(firstNight.indexOf(role.firstNight), 0); - const other = Math.max(otherNight.indexOf(role.otherNight), 0); + const first = Math.max(firstNight.indexOf(role), 0); + const other = Math.max(otherNight.indexOf(role), 0); nightOrder.set(role, { first, other }); }); return nightOrder; From c42a3c5a13bc77bd48d1bae2c093c64c32726d3f Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Sat, 2 Sep 2023 10:47:08 +0200 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949925b..6a2d2ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Release Notes ## Upcomming Version -Updating night order (and its print) +- Updating night order (and its print) ### Version 3.15.0 - Night order bubbles always on for storyteller From cd32442088f79b9a31bcdbb505ba8c7c117506f4 Mon Sep 17 00:00:00 2001 From: MRegnard <62838312+MRegnard@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:05:32 +0200 Subject: [PATCH 6/6] Adding a forgotten change for the new version --- src/store/modules/players.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/modules/players.js b/src/store/modules/players.js index d60e094..1e81619 100644 --- a/src/store/modules/players.js +++ b/src/store/modules/players.js @@ -29,18 +29,18 @@ const getters = { const firstNight = [0]; const otherNight = [0]; fabled.forEach(role => { - if (role.firstNight && !firstNight.includes(role.firstNight)) { + if (role.firstNight && !firstNight.includes(role)) { firstNight.push(role); } - if (role.otherNight && !otherNight.includes(role.otherNight)) { + if (role.otherNight && !otherNight.includes(role)) { otherNight.push(role); } }); players.forEach(({ role }) => { - if (role.firstNight && !firstNight.includes(role.firstNight)) { + if (role.firstNight && !firstNight.includes(role)) { firstNight.push(role); } - if (role.otherNight && !otherNight.includes(role.otherNight)) { + if (role.otherNight && !otherNight.includes(role)) { otherNight.push(role); } });