load roles from gamestate that belong to different editions (like travelers)

This commit is contained in:
Steffen 2020-12-23 21:18:35 +01:00
parent 984c02980c
commit efa4a0fa4b
4 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# Release Notes # Release Notes
## Version 2.0.3 ## Version 2.0.3
- load roles that belong to different editions (like travelers) from gamestate
- close session when missing custom roles and open edition modal - close session when missing custom roles and open edition modal
- added a few more metrics - added a few more metrics

View File

@ -92,7 +92,10 @@ export default {
"players/set", "players/set",
players.map(player => ({ players.map(player => ({
...player, ...player,
role: this.$store.state.roles.get(player.role) || {} role:
this.$store.state.roles.get(player.role) ||
this.$store.getters.rolesJSONbyId.get(player.role) ||
{}
})) }))
); );
} }

View File

@ -102,7 +102,8 @@ export default new Vuex.Store({
} }
}); });
return customRoles; return customRoles;
} },
rolesJSONbyId: () => rolesJSONbyId
}, },
mutations: { mutations: {
toggleMenu({ grimoire }) { toggleMenu({ grimoire }) {

View File

@ -21,7 +21,8 @@ module.exports = store => {
JSON.parse(localStorage.bluffs).forEach((role, index) => { JSON.parse(localStorage.bluffs).forEach((role, index) => {
store.commit("players/setBluff", { store.commit("players/setBluff", {
index, index,
role: store.state.roles.get(role) || {} role:
store.state.roles.get(role) || {}
}); });
}); });
} }
@ -37,7 +38,10 @@ module.exports = store => {
"players/set", "players/set",
JSON.parse(localStorage.players).map(player => ({ JSON.parse(localStorage.players).map(player => ({
...player, ...player,
role: store.state.roles.get(player.role) || {} role:
store.state.roles.get(player.role) ||
store.getters.rolesJSONbyId.get(player.role) ||
{}
})) }))
); );
} }