moves shared store inside AppStorage.js

This commit is contained in:
2019-06-16 15:37:03 +02:00
parent d9b629116c
commit ef9124cc74
5 changed files with 75 additions and 59 deletions

View File

@@ -50,7 +50,7 @@
</template>
<script>
import { store } from '../App.vue'
import { AppStorage } from '../AppStorage'
import Chest from './Chest.vue'
import Wealth from './Wealth.vue'
/*
@@ -74,7 +74,7 @@
components: { Chest, Wealth },
data () {
return {
state: store.state,
state: AppStorage.state,
show_dropdown: false,
edit_wealth: false,
handleOutsideClick: null,
@@ -96,7 +96,7 @@
},
methods: {
switchPlayerChestVisibility () {
store.switchPlayerChestVisibility();
AppStorage.switchPlayerChestVisibility();
},
hidePlayerChest () {
if (this.state.show_player_chest) {
@@ -105,7 +105,7 @@
},
setActivePlayer (playerIdx) {
const newId = this.state.player_list[playerIdx].id;
store.setActivePlayer(newId);
AppStorage.setActivePlayer(newId);
if (newId == 0) { this.hidePlayerChest() }
this.player.name = this.state.player_list[playerIdx].name
},