From 914e7a21f7614bcffcc74c4cb0ec69991b3a9f1b Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 10 Nov 2023 17:03:26 +0000 Subject: [PATCH] fixing to support new script tool output --- src/components/modals/EditionModal.vue | 37 +++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/components/modals/EditionModal.vue b/src/components/modals/EditionModal.vue index 551b1af..942c429 100644 --- a/src/components/modals/EditionModal.vue +++ b/src/components/modals/EditionModal.vue @@ -10,7 +10,7 @@ :style="{ backgroundImage: `url(${require('../../assets/editions/' + edition.id + - '.png')})` + '.png')})`, }" :key="edition.id" @click="setEdition(edition)" @@ -21,7 +21,7 @@ class="edition edition-custom" @click="isCustom = true" :style="{ - backgroundImage: `url(${require('../../assets/editions/custom.png')})` + backgroundImage: `url(${require('../../assets/editions/custom.png')})`, }" > Custom Script / Characters @@ -87,38 +87,38 @@ import Modal from "./Modal"; export default { components: { - Modal + Modal, }, - data: function() { + data: function () { return { editions: editionJSON, isCustom: false, scripts: [ [ "Deadly Penance Day", - "https://gist.githubusercontent.com/bra1n/0337cc44c6fd2c44f7589256ed5486d2/raw/16be38fa3c01aaf49827303ac80577bdb52c0b25/penanceday.json" + "https://gist.githubusercontent.com/bra1n/0337cc44c6fd2c44f7589256ed5486d2/raw/16be38fa3c01aaf49827303ac80577bdb52c0b25/penanceday.json", ], [ "Catfishing 11.1", - "https://gist.githubusercontent.com/bra1n/8a5ec41a7bbf945f6b7dfc1cef72b569/raw/a312ab93c2f302e0ef83c8b65a4e8e82760fda3a/catfishing.json" + "https://gist.githubusercontent.com/bra1n/8a5ec41a7bbf945f6b7dfc1cef72b569/raw/a312ab93c2f302e0ef83c8b65a4e8e82760fda3a/catfishing.json", ], [ "On Thin Ice (Teensyville)", - "https://gist.githubusercontent.com/bra1n/8dacd9f2abc6f428331ea1213ab153f5/raw/0cacbcaf8ed9bddae0cca25a9ada97e9958d868b/on-thin-ice.json" + "https://gist.githubusercontent.com/bra1n/8dacd9f2abc6f428331ea1213ab153f5/raw/0cacbcaf8ed9bddae0cca25a9ada97e9958d868b/on-thin-ice.json", ], [ "Race To The Bottom (Teensyville)", - "https://gist.githubusercontent.com/bra1n/63e1354cb3dc9d4032bcd0623dc48888/raw/5acb0eedcc0a67a64a99c7e0e6271de0b7b2e1b2/race-to-the-bottom.json" + "https://gist.githubusercontent.com/bra1n/63e1354cb3dc9d4032bcd0623dc48888/raw/5acb0eedcc0a67a64a99c7e0e6271de0b7b2e1b2/race-to-the-bottom.json", ], [ "Frankenstein's Mayor by Ted (Teensyville)", - "https://gist.githubusercontent.com/bra1n/32c52b422cc01b934a4291eeb81dbcee/raw/5bf770693bbf7aff5e86601c82ca4af3222f4ba6/Frankensteins_Mayor_by_Ted.json" + "https://gist.githubusercontent.com/bra1n/32c52b422cc01b934a4291eeb81dbcee/raw/5bf770693bbf7aff5e86601c82ca4af3222f4ba6/Frankensteins_Mayor_by_Ted.json", ], [ "Vigormortis High School (Teensyville)", - "https://gist.githubusercontent.com/bra1n/1f65bd4a999524719d5dabe98c3c2d27/raw/22bbec6bf56a51a7459e5ae41ed47e41971c5445/VigormortisHighSchool.json" - ] - ] + "https://gist.githubusercontent.com/bra1n/1f65bd4a999524719d5dabe98c3c2d27/raw/22bbec6bf56a51a7459e5ae41ed47e41971c5445/VigormortisHighSchool.json", + ], + ], }; }, computed: mapState(["modals"]), @@ -175,7 +175,14 @@ export default { if (metaIndex > -1) { meta = roles.splice(metaIndex, 1).pop(); } - this.$store.commit("setCustomRoles", roles); + this.$store.commit( + "setCustomRoles", + roles.map((role) => + typeof role === "string" || role instanceof String + ? { id: role } + : role + ) + ); this.$store.commit( "setEdition", Object.assign({}, meta, { id: "custom" }) @@ -192,8 +199,8 @@ export default { } this.isCustom = false; }, - ...mapMutations(["toggleModal", "setEdition"]) - } + ...mapMutations(["toggleModal", "setEdition"]), + }, };