Storage improve (#6976)
* wip
* wip
* wip
* wip
* wip
* Update storage.ts
* wip
* wip
* wip
* wip
* Update storage.ts
* Update storage.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update storage.ts
* wip
* wip
* wip
* wip
* 🍕
* wip
* wip
* wip
* wip
* wip
* wip
* Update deck-storage.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update store.ts
* wip
* wip
* wip
* wip
* Update init.ts
* wip
* wip
* Update pizzax.ts
* wip
* wip
* Update timeline.vue
* Update init.ts
* wip
* wip
* Update init.ts
This commit is contained in:
parent
57d0c19a98
commit
43930e6a84
146 changed files with 1458 additions and 1519 deletions
|
@ -22,11 +22,11 @@
|
|||
</div>
|
||||
|
||||
<div class="board">
|
||||
<div class="labels-x" v-if="$store.state.settings.gamesReversiShowBoardLabels">
|
||||
<div class="labels-x" v-if="$store.state.gamesReversiShowBoardLabels">
|
||||
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="labels-y" v-if="$store.state.settings.gamesReversiShowBoardLabels">
|
||||
<div class="labels-y" v-if="$store.state.gamesReversiShowBoardLabels">
|
||||
<div v-for="i in game.map.length">{{ i }}</div>
|
||||
</div>
|
||||
<div class="cells" :style="cellsStyle">
|
||||
|
@ -35,7 +35,7 @@
|
|||
@click="set(i)"
|
||||
:title="`${String.fromCharCode(65 + o.transformPosToXy(i)[0])}${o.transformPosToXy(i)[1] + 1}`"
|
||||
>
|
||||
<template v-if="$store.state.settings.gamesReversiUseAvatarStones || true">
|
||||
<template v-if="$store.state.gamesReversiUseAvatarStones || true">
|
||||
<img v-if="stone === true" :src="blackUser.avatarUrl" alt="black">
|
||||
<img v-if="stone === false" :src="whiteUser.avatarUrl" alt="white">
|
||||
</template>
|
||||
|
@ -45,11 +45,11 @@
|
|||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="labels-y" v-if="$store.state.settings.gamesReversiShowBoardLabels">
|
||||
<div class="labels-y" v-if="$store.state.gamesReversiShowBoardLabels">
|
||||
<div v-for="i in game.map.length">{{ i }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="labels-x" v-if="$store.state.settings.gamesReversiShowBoardLabels">
|
||||
<div class="labels-x" v-if="$store.state.gamesReversiShowBoardLabels">
|
||||
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -126,14 +126,14 @@ export default defineComponent({
|
|||
|
||||
computed: {
|
||||
iAmPlayer(): boolean {
|
||||
if (!this.$store.getters.isSignedIn) return false;
|
||||
return this.game.user1Id == this.$store.state.i.id || this.game.user2Id == this.$store.state.i.id;
|
||||
if (!this.$i) return false;
|
||||
return this.game.user1Id == this.$i.id || this.game.user2Id == this.$i.id;
|
||||
},
|
||||
|
||||
myColor(): Color {
|
||||
if (!this.iAmPlayer) return null;
|
||||
if (this.game.user1Id == this.$store.state.i.id && this.game.black == 1) return true;
|
||||
if (this.game.user2Id == this.$store.state.i.id && this.game.black == 2) return true;
|
||||
if (this.game.user1Id == this.$i.id && this.game.black == 1) return true;
|
||||
if (this.game.user2Id == this.$i.id && this.game.black == 2) return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
|
@ -234,7 +234,7 @@ export default defineComponent({
|
|||
isMyTurn(): boolean {
|
||||
if (!this.iAmPlayer) return false;
|
||||
if (this.turnUser() == null) return false;
|
||||
return this.turnUser().id == this.$store.state.i.id;
|
||||
return this.turnUser().id == this.$i.id;
|
||||
},
|
||||
|
||||
set(pos) {
|
||||
|
|
|
@ -169,13 +169,13 @@ export default defineComponent({
|
|||
return categories.filter((item, pos) => categories.indexOf(item) == pos);
|
||||
},
|
||||
isAccepted(): boolean {
|
||||
if (this.game.user1Id == this.$store.state.i.id && this.game.user1Accepted) return true;
|
||||
if (this.game.user2Id == this.$store.state.i.id && this.game.user2Accepted) return true;
|
||||
if (this.game.user1Id == this.$i.id && this.game.user1Accepted) return true;
|
||||
if (this.game.user2Id == this.$i.id && this.game.user2Accepted) return true;
|
||||
return false;
|
||||
},
|
||||
isOpAccepted(): boolean {
|
||||
if (this.game.user1Id != this.$store.state.i.id && this.game.user1Accepted) return true;
|
||||
if (this.game.user2Id != this.$store.state.i.id && this.game.user2Accepted) return true;
|
||||
if (this.game.user1Id != this.$i.id && this.game.user1Accepted) return true;
|
||||
if (this.game.user2Id != this.$i.id && this.game.user2Accepted) return true;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
@ -186,8 +186,8 @@ export default defineComponent({
|
|||
this.connection.on('initForm', this.onInitForm);
|
||||
this.connection.on('message', this.onMessage);
|
||||
|
||||
if (this.game.user1Id != this.$store.state.i.id && this.game.form1) this.form = this.game.form1;
|
||||
if (this.game.user2Id != this.$store.state.i.id && this.game.form2) this.form = this.game.form2;
|
||||
if (this.game.user1Id != this.$i.id && this.game.form1) this.form = this.game.form1;
|
||||
if (this.game.user2Id != this.$i.id && this.game.form2) this.form = this.game.form2;
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
|
@ -233,12 +233,12 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
onInitForm(x) {
|
||||
if (x.userId == this.$store.state.i.id) return;
|
||||
if (x.userId == this.$i.id) return;
|
||||
this.form = x.form;
|
||||
},
|
||||
|
||||
onMessage(x) {
|
||||
if (x.userId == this.$store.state.i.id) return;
|
||||
if (x.userId == this.$i.id) return;
|
||||
this.messages.unshift(x.message);
|
||||
},
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
mounted() {
|
||||
if (this.$store.getters.isSignedIn) {
|
||||
if (this.$i) {
|
||||
this.connection = os.stream.useSharedConnection('gamesReversi');
|
||||
|
||||
this.connection.on('invited', this.onInvited);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue