From d79e3a8956ddb8c9caa47290136bf26b8dc99556 Mon Sep 17 00:00:00 2001 From: Settel Date: Mon, 30 Aug 2021 18:21:14 +0200 Subject: [PATCH] save and store selection --- client/src/components/GameControls.vue | 4 ++ client/src/components/Play.vue | 12 ++++- client/src/components/PlayerList.vue | 1 - client/src/components/Source.vue | 33 +++++++++----- client/src/components/Sources.vue | 3 +- client/src/plugins/engine/continueGame.js | 7 +++ client/src/plugins/engine/index.js | 2 + client/src/plugins/engine/saveSelection.js | 6 ++- client/src/store/round.js | 3 ++ server/src/application/continueGame.go | 25 ++++++++++ server/src/game/continueGame.go | 53 ++++++++++++++++++++++ server/src/game/game.go | 4 +- server/src/game/populateSyncDataCb.go | 35 +++++++------- server/src/game/runRound.go | 4 +- server/src/game/saveSelection.go | 15 +++++- server/src/game/struct.go | 12 +++-- server/src/knyt.go | 1 + server/src/syncdata/syncdata.go | 11 ++--- 18 files changed, 180 insertions(+), 51 deletions(-) create mode 100644 client/src/plugins/engine/continueGame.js create mode 100644 server/src/application/continueGame.go create mode 100644 server/src/game/continueGame.go diff --git a/client/src/components/GameControls.vue b/client/src/components/GameControls.vue index 2285c33..3892a71 100644 --- a/client/src/components/GameControls.vue +++ b/client/src/components/GameControls.vue @@ -2,6 +2,7 @@ @@ -23,6 +24,9 @@ export default { resetGame() { this.$engine.resetGame() }, + continueGame() { + this.$engine.continueGame() + }, }, } diff --git a/client/src/components/Play.vue b/client/src/components/Play.vue index cdbe0af..86dea11 100644 --- a/client/src/components/Play.vue +++ b/client/src/components/Play.vue @@ -3,8 +3,8 @@
- - + +
@@ -28,6 +28,14 @@ export default { players() { return this.$store.state.players.players }, + selectable() { + const userId = this.$store.state.engine.user.id + const selection = this.$store.state.round.selections[userId] + + if (this.$store.state.game.phase != 'select-quote') return false + if (typeof selection === 'undefined') return true + return !selection + }, }, } diff --git a/client/src/components/PlayerList.vue b/client/src/components/PlayerList.vue index 729d2f1..b73278d 100644 --- a/client/src/components/PlayerList.vue +++ b/client/src/components/PlayerList.vue @@ -29,7 +29,6 @@ export default { &__player { display: flex; - // height: 1.4em; color: #ffffff; font-family: Dosis; font-size: 18px; diff --git a/client/src/components/Source.vue b/client/src/components/Source.vue index 1e0f84e..05af22b 100644 --- a/client/src/components/Source.vue +++ b/client/src/components/Source.vue @@ -1,7 +1,7 @@