mirror of https://github.com/bra1n/townsquare.git
show reminders from roles selected as bluff/other
This commit is contained in:
parent
faf378dca3
commit
dcabc505fe
|
@ -36,8 +36,9 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
availableReminders() {
|
availableReminders() {
|
||||||
let reminders = [];
|
let reminders = [];
|
||||||
const players = this.$store.state.players.players;
|
const { players, bluffs } = this.$store.state.players;
|
||||||
this.$store.state.roles.forEach(role => {
|
this.$store.state.roles.forEach(role => {
|
||||||
|
// add reminders from player roles
|
||||||
if (players.some(p => p.role.id === role.id)) {
|
if (players.some(p => p.role.id === role.id)) {
|
||||||
reminders = [
|
reminders = [
|
||||||
...reminders,
|
...reminders,
|
||||||
|
@ -48,7 +49,19 @@ export default {
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (role.remindersGlobal && role.remindersGlobal.length) {
|
// add reminders from bluff/other roles
|
||||||
|
else if (bluffs.some(bluff => bluff.id === role.id)) {
|
||||||
|
reminders = [
|
||||||
|
...reminders,
|
||||||
|
...role.reminders.map(name => ({
|
||||||
|
role: role.id,
|
||||||
|
image: role.image,
|
||||||
|
name
|
||||||
|
}))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// add global reminders
|
||||||
|
else if (role.remindersGlobal && role.remindersGlobal.length) {
|
||||||
reminders = [
|
reminders = [
|
||||||
...reminders,
|
...reminders,
|
||||||
...role.remindersGlobal.map(name => ({
|
...role.remindersGlobal.map(name => ({
|
||||||
|
@ -59,6 +72,7 @@ export default {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// add fabled reminders
|
||||||
this.$store.state.players.fabled.forEach(role => {
|
this.$store.state.players.fabled.forEach(role => {
|
||||||
reminders = [
|
reminders = [
|
||||||
...reminders,
|
...reminders,
|
||||||
|
|
Loading…
Reference in New Issue