moves shared store inside AppStorage.js
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { store } from '../App.vue'
|
||||
import { AppStorage } from '../AppStorage'
|
||||
import Request from './Request.vue'
|
||||
import PercentInput from './PercentInput.vue'
|
||||
import Loot from './Loot.vue'
|
||||
@@ -117,7 +117,7 @@
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
app_state: store.state,
|
||||
app_state: AppStorage.state,
|
||||
content: [
|
||||
{id: 10, name: "Épée longue +2 acérée",
|
||||
sell_value: 15000 },
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { store } from '../App.vue'
|
||||
import { AppStorage } from '../AppStorage'
|
||||
export default {
|
||||
props: ["item"],
|
||||
data () {
|
||||
return {
|
||||
state: store.state,
|
||||
state: AppStorage.state,
|
||||
_requested: false, // Dummy state
|
||||
};
|
||||
},
|
||||
@@ -66,11 +66,11 @@
|
||||
methods: {
|
||||
// The active player claims the item
|
||||
putRequest () {
|
||||
store.putRequest(this.item)
|
||||
AppStorage.putRequest(this.item)
|
||||
},
|
||||
// The active player withdraws his request
|
||||
cancelRequest () {
|
||||
store.cancelRequest(this.item)
|
||||
AppStorage.cancelRequest(this.item)
|
||||
},
|
||||
// The active player insist on his claim
|
||||
// TODO: Find a simple and fun system to express
|
||||
|
||||
Reference in New Issue
Block a user