renaming travellers to travelers for consistancy with existing code.

This commit is contained in:
Dave 2021-01-25 14:46:37 +00:00
parent 0ef34ca3a1
commit 64f5621d7c
3 changed files with 13 additions and 13 deletions

View File

@ -83,8 +83,8 @@ export default {
]; ];
}); });
// add out of script traveller reminders // add out of script traveler reminders
this.$store.state.extraTravellers.forEach(role => { this.$store.state.extraTravelers.forEach(role => {
if (players.some(p => p.role.id === role.id)) { if (players.some(p => p.role.id === role.id)) {
reminders = [ reminders = [
...reminders, ...reminders,

View File

@ -18,9 +18,9 @@
<Token :role="role" /> <Token :role="role" />
</li> </li>
</ul> </ul>
<ul class="tokens" v-if="tab === 'otherTravellers'"> <ul class="tokens" v-if="tab === 'otherTravelers'">
<li <li
v-for="role in extraTravellers" v-for="role in extraTravelers"
:class="[role.team]" :class="[role.team]"
:key="role.id" :key="role.id"
@click="setRole(role)" @click="setRole(role)"
@ -37,9 +37,9 @@
> >
<span <span
class="button" class="button"
:class="{ townsfolk: tab === 'otherTravellers' }" :class="{ townsfolk: tab === 'otherTravelers' }"
@click="tab = 'otherTravellers'" @click="tab = 'otherTravelers'"
>Other Travellers</span >Other Travelers</span
> >
</div> </div>
</Modal> </Modal>
@ -54,8 +54,8 @@ export default {
components: { Token, Modal }, components: { Token, Modal },
props: ["playerIndex"], props: ["playerIndex"],
computed: { computed: {
extraTravellers() { extraTravelers() {
return [...this.$store.state.extraTravellers.values()]; return [...this.$store.state.extraTravelers.values()];
}, },
availableRoles() { availableRoles() {
const availableRoles = []; const availableRoles = [];

View File

@ -25,7 +25,7 @@ const getRolesByEdition = (edition = editionJSON[0]) => {
); );
}; };
const getTravellersNotInEdition = (edition = editionJSON[0]) => { const getTravelersNotInEdition = (edition = editionJSON[0]) => {
return new Map( return new Map(
rolesJSON rolesJSON
.filter( .filter(
@ -83,7 +83,7 @@ export default new Vuex.Store({
}, },
edition: editionJSONbyId.get("tb"), edition: editionJSONbyId.get("tb"),
roles: getRolesByEdition(), roles: getRolesByEdition(),
extraTravellers: getTravellersNotInEdition(), extraTravelers: getTravelersNotInEdition(),
fabled fabled
}, },
getters: { getters: {
@ -196,7 +196,7 @@ export default new Vuex.Store({
); );
// update travelers by edition list // update travelers by edition list
state.extraTravellers = new Map( state.extraTravelers = new Map(
rolesJSON rolesJSON
.filter(r => r.team === "traveler" && !roles.some(i => i.id === r.id)) .filter(r => r.team === "traveler" && !roles.some(i => i.id === r.id))
.map(role => [role.id, role]) .map(role => [role.id, role])
@ -206,7 +206,7 @@ export default new Vuex.Store({
if (editionJSONbyId.has(edition.id)) { if (editionJSONbyId.has(edition.id)) {
state.edition = editionJSONbyId.get(edition.id); state.edition = editionJSONbyId.get(edition.id);
state.roles = getRolesByEdition(state.edition); state.roles = getRolesByEdition(state.edition);
state.extraTravellers = getTravellersNotInEdition(state.edition); state.extraTravelers = getTravelersNotInEdition(state.edition);
} else { } else {
state.edition = edition; state.edition = edition;
} }