diff --git a/package.json b/package.json index 67519765..7080054b 100644 --- a/package.json +++ b/package.json @@ -48,5 +48,5 @@ "preview:https": "serve dist", "reinstall": "rm -rf node_modules; yarn; vue-tsc --noEmit" }, - "version": "5.0.0-alpha.278" + "version": "5.0.0-alpha.280" } diff --git a/src/components/units/AppGame.vue b/src/components/units/AppGame.vue index e4856b7e..594cbfd5 100644 --- a/src/components/units/AppGame.vue +++ b/src/components/units/AppGame.vue @@ -15,11 +15,10 @@ const route = useRoute(); const store = useStore(); /* Change the following values to computed refs if game may change dynamically on this page. */ - const gameType = route.params.type as string; const gameId = route.params.gameId as string; const variantId = route.params.variantId as string; const initialPosition = route.params.initialPosition as string; - store.dispatch(actionTypes.initiateMatch, { gameType: gameType, gameId: gameId, variantId: variantId, startPosition: initialPosition }); + store.dispatch(actionTypes.initiateMatch, { gameId: gameId, variantId: variantId, startPosition: initialPosition }); const options = computed(() => store.getters.options); const showMenu = computed(() => (options.value ? options.value.showMenu : true)); onBeforeRouteLeave(() => store.dispatch(actionTypes.exitMatch)); diff --git a/src/components/units/AppGameVariants.vue b/src/components/units/AppGameVariants.vue index 2b7f8586..83e54437 100644 --- a/src/components/units/AppGameVariants.vue +++ b/src/components/units/AppGameVariants.vue @@ -3,12 +3,12 @@

{{ gameName }}

{{ t("gameVariantsTitle") }}

- - -

{{ variant.description }}

+ + +

{{ variant.name }}

-
- +
+

Custom

@@ -27,11 +27,13 @@ const { t } = useI18n(); const gameType = computed(() => route.params.type as string); const gameId = computed(() => route.params.gameId as string); - const game = computed(() => store.getters.game(gameType.value, gameId.value)); - const gameCustom = computed(() => (game.value ? game.value.custom : false)); + store.dispatch(actionTypes.loadVariants, { gameId: gameId.value }); + + const game = computed(() => store.getters.game(gameId.value)); + const gameCustom = computed(() => (game.value ? game.value.allowCustomVariantCreation : false)); const gameName = computed(() => (game.value ? game.value.name : "")); const gameVariants = computed(() => { - let total = game.value.variants.variants; + let total = game.value.variants; const asArray = Object.entries(total); if (asArray.length == 1 && !gameCustom.value) { router.replace({ name: 'game', params: { type: gameType.value, gameId: gameId.value, variantId: asArray[0][0] } }); @@ -67,12 +69,11 @@ return logo[appLogoFilePath].default; }; const customBoardRoute = () => { - let boardStr = window.prompt('Enter a valid variant:'); - if (boardStr !== null) { - router.push({ name: 'game', params: { type: gameType.value, gameId: gameId.value, variantId: boardStr } }) + let variantId = window.prompt('Enter a Valid Variant ID:'); + if (variantId !== null) { + router.push({ name: 'game', params: { type: gameType.value, gameId: gameId.value, variantId: variantId } }) } } - store.dispatch(actionTypes.loadVariants, { type: gameType.value, gameId: gameId.value });