diff --git a/lootalot_front/src/App.vue b/lootalot_front/src/App.vue index f06effd..1ddfba8 100644 --- a/lootalot_front/src/App.vue +++ b/lootalot_front/src/App.vue @@ -31,12 +31,13 @@
- +

ItemInput

+ + + + @@ -83,6 +94,8 @@ export default { data () { return { state: AppStorage.state, + activeView: 'group', + shopInventory: [{id: 1, name: "Item from shop #1", base_price: 2000}], }; }, components: { @@ -104,26 +117,23 @@ export default { AppStorage.initStorage(playerId); }, methods: { - setActivePlayer (idx) { AppStorage.setActivePlayer(idx); }, + setActivePlayer (idx) { + if (idx == 0) this.switchView('group'); + AppStorage.setActivePlayer(idx); + }, + switchView (viewId) { + if (!['group', 'player', 'adding'].includes(viewId)) { + console.error("Not a valid view ID :", viewId); + } + this.activeView = viewId; + }, switchPlayerChestVisibility () { AppStorage.switchPlayerChestVisibility(); }, }, computed: { - permissions () { - return { - canGrab: this.state.player_id != 0 && !this.state.show_player_chest, - canSell: this.state.show_player_chest || this.state.player_id == 0, - }; - }, + showPlayerChest () { return this.activeView == 'player' }, + isAdding () { return this.activeView == 'adding' }, playerIsGroup () { return this.state.player_id == 0 }, } } - diff --git a/lootalot_front/src/components/Chest.vue b/lootalot_front/src/components/Chest.vue index fb50377..75bfdce 100644 --- a/lootalot_front/src/components/Chest.vue +++ b/lootalot_front/src/components/Chest.vue @@ -2,10 +2,10 @@ - +
ObjetsObjets Valeur -
+