From 7d51a426a54e26151d848df61fc7c5279b2d7e7c Mon Sep 17 00:00:00 2001 From: Robert Shi <42782709+robertyishi@users.noreply.github.com> Date: Wed, 16 Nov 2022 18:29:07 -0800 Subject: [PATCH] v5.0.0-alpha.172: Move history, initial position customization, and improvements (#61) * Initial position customization with validation * Move history import/export with validation * Search bar improvement: the user can now use the esc key to clear input * Restart game now clears the move history Co-authored-by: Victoria Phelps Co-authored-by: Cameron Cheung --- package.json | 2 +- src/components/units/AppGame.vue | 8 +- .../units/AppGameBodyHeaderOptions.vue | 10 +- src/components/units/AppGameMenu.vue | 61 +++++ src/components/units/AppGameMenuHeader.vue | 19 ++ src/components/units/AppGameMenuHistory.vue | 22 ++ .../units/AppGameMenuHistoryExport.vue | 66 ++++++ .../units/AppGameMenuHistoryImport.vue | 84 +++++++ .../units/AppGameMenuHistoryImportFile.vue | 48 ++++ src/components/units/AppGameMenuPosition.vue | 97 ++++++++ src/components/units/AppGameVvh.vue | 8 +- src/components/units/AppGames.vue | 2 +- src/models/datas/defaultApp.ts | 25 +- src/scripts/gamesmanUni/index.ts | 219 +++++++++++++++--- src/scripts/gamesmanUni/types.ts | 7 +- src/scripts/plugins/store/index.ts | 77 ++++-- tsconfig.json | 1 + 17 files changed, 687 insertions(+), 69 deletions(-) create mode 100644 src/components/units/AppGameMenu.vue create mode 100644 src/components/units/AppGameMenuHeader.vue create mode 100644 src/components/units/AppGameMenuHistory.vue create mode 100644 src/components/units/AppGameMenuHistoryExport.vue create mode 100644 src/components/units/AppGameMenuHistoryImport.vue create mode 100644 src/components/units/AppGameMenuHistoryImportFile.vue create mode 100644 src/components/units/AppGameMenuPosition.vue diff --git a/package.json b/package.json index 02eb16a5..10198b05 100644 --- a/package.json +++ b/package.json @@ -47,5 +47,5 @@ "preview:https": "serve dist", "reinstall": "rm -rf node_modules; yarn; vue-tsc --noEmit" }, - "version": "5.0.0-alpha.171" + "version": "5.0.0-alpha.172" } diff --git a/src/components/units/AppGame.vue b/src/components/units/AppGame.vue index f8fb2ec5..bc49c476 100644 --- a/src/components/units/AppGame.vue +++ b/src/components/units/AppGame.vue @@ -1,7 +1,7 @@ @@ -10,7 +10,7 @@ import { onBeforeRouteLeave, useRoute } from "vue-router"; import { actionTypes, useStore } from "../../scripts/plugins/store"; import AppGameBody from "./AppGameBody.vue"; - import AppGameVvh from "./AppGameVvh.vue"; + import AppGameMenu from "./AppGameMenu.vue"; const route = useRoute(); const store = useStore(); @@ -18,13 +18,15 @@ const gameId = computed(() => route.params.gameId as string); const variantId = computed(() => route.params.variantId as string); store.dispatch(actionTypes.initiateMatch, { gameType: gameType.value, gameId: gameId.value, variantId: variantId.value }); + const options = computed(() => (store.getters.currentPlayer ? store.getters.currentPlayer.options : undefined)); + const showVvh = computed(() => (options.value ? options.value.showMenu : true)); onBeforeRouteLeave(() => store.dispatch(actionTypes.exitMatch)); diff --git a/src/components/units/AppGameMenuHeader.vue b/src/components/units/AppGameMenuHeader.vue new file mode 100644 index 00000000..5228c426 --- /dev/null +++ b/src/components/units/AppGameMenuHeader.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/components/units/AppGameMenuHistory.vue b/src/components/units/AppGameMenuHistory.vue new file mode 100644 index 00000000..4eed8216 --- /dev/null +++ b/src/components/units/AppGameMenuHistory.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/components/units/AppGameMenuHistoryExport.vue b/src/components/units/AppGameMenuHistoryExport.vue new file mode 100644 index 00000000..854a5b0f --- /dev/null +++ b/src/components/units/AppGameMenuHistoryExport.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/components/units/AppGameMenuHistoryImport.vue b/src/components/units/AppGameMenuHistoryImport.vue new file mode 100644 index 00000000..e58d030a --- /dev/null +++ b/src/components/units/AppGameMenuHistoryImport.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/components/units/AppGameVvh.vue b/src/components/units/AppGameVvh.vue index 19be5de1..abc9921a 100644 --- a/src/components/units/AppGameVvh.vue +++ b/src/components/units/AppGameVvh.vue @@ -1,19 +1,13 @@