+
-
+
diff --git a/lootalot_front/src/components/Player.vue b/lootalot_front/src/components/Player.vue
index e614f67..ac9d2bd 100644
--- a/lootalot_front/src/components/Player.vue
+++ b/lootalot_front/src/components/Player.vue
@@ -2,7 +2,7 @@
@@ -55,15 +60,42 @@
return {
app_state: store.state,
player: {
- name: "Player name",
+ name: "Groupe",
wealth: [1000,100,10,1],
+ debt: 0,
},
+ player_list: [
+ {id: 0, name: "Groupe"},
+ {id: 1, name: "Lomion"},
+ {id: 4, name: "Oilosse"},
+ {id: 3, name: "Fefi"},
+ ],
show_dropdown: false,
};
},
+ computed: {
+ name () {
+ return this.player.name;
+ },
+ // Check if the active player is the special 'Group' player
+ playerIsGroup () {
+ return this.app_state.player_id == 0;
+ }
+ },
methods: {
switchPlayerChestVisibility () {
- store.switchPlayerChestVisibility()
+ store.switchPlayerChestVisibility();
+ },
+ hidePlayerChest () {
+ if (this.app_state.show_player_chest) {
+ this.switchPlayerChestVisibility();
+ }
+ },
+ setActivePlayer (playerIdx) {
+ const newId = this.player_list[playerIdx].id;
+ store.setActivePlayer(newId);
+ if (newId == 0) { this.hidePlayerChest() }
+ this.player.name = this.player_list[playerIdx].name
},
closeDropdown () {
this.show_dropdown = false
@@ -84,7 +116,7 @@
}
});
- if (!el.contains(e.target) && !excludedElClicked) {
+ if (!excludedElClicked) {
console.log('outsideCloseDropdown');
vnode.context[handler]()
}
diff --git a/lootalot_front/src/components/Wealth.vue b/lootalot_front/src/components/Wealth.vue
index 5dc8e68..c23cdb9 100644
--- a/lootalot_front/src/components/Wealth.vue
+++ b/lootalot_front/src/components/Wealth.vue
@@ -1,5 +1,5 @@
-