From 63c14b4a54f56fd643fb549982f05de8766fb138 Mon Sep 17 00:00:00 2001 From: Artus Date: Fri, 5 Jul 2019 15:06:16 +0200 Subject: [PATCH] improves progressive rendering, work in progress... --- lootalot_db/db.sqlite3 | Bin 28672 -> 28672 bytes lootalot_front/src/App.vue | 2 +- lootalot_front/src/AppStorage.js | 20 +++--- lootalot_front/src/components/NumberInput.vue | 11 +-- lootalot_front/src/components/Player.vue | 66 ++++++++++-------- lootalot_front/src/components/Request.vue | 4 +- lootalot_front/src/components/Wealth.vue | 4 +- 7 files changed, 58 insertions(+), 49 deletions(-) diff --git a/lootalot_db/db.sqlite3 b/lootalot_db/db.sqlite3 index d0944f8e4b1657c33216fbb00d876007a8a6eef8..9ac5afea47f7c9eab367cb0950c2e631ad4c545a 100644 GIT binary patch delta 106 zcmZp8z}WDBae_3X)vH$=8 diff --git a/lootalot_front/src/App.vue b/lootalot_front/src/App.vue index 229ce0d..eaf8d58 100644 --- a/lootalot_front/src/App.vue +++ b/lootalot_front/src/App.vue @@ -1,7 +1,7 @@ @@ -71,7 +69,7 @@ components: { Chest, Wealth }, data () { return { - state: AppStorage.state, + app_state: AppStorage.state, show_dropdown: false, edit_wealth: false, handleOutsideClick: null, @@ -79,19 +77,24 @@ }, computed: { player () { - const idx = this.state.player_id; - return this.state.player_list[idx]; + if (!this.app_state.initiated) return {} + const idx = this.app_state.player_id; + return this.app_state.player_list[idx]; }, wealth () { - const cp = this.player.cp - const sp = this.player.sp - const gp = this.player.gp - const pp = this.player.pp - return [cp, sp, gp, pp]; + if (!this.app_state.initiated) { + return ["-", "-", "-", "-"]; + } else { + const cp = this.player.cp + const sp = this.player.sp + const gp = this.player.gp + const pp = this.player.pp + return [cp, sp, gp, pp]; + } }, // Check if the active player is the special 'Group' player playerIsGroup () { - return this.state.player_id == 0; + return this.app_state.player_id == 0; } }, methods: { @@ -99,7 +102,7 @@ AppStorage.switchPlayerChestVisibility(); }, hidePlayerChest () { - if (this.state.show_player_chest) { + if (this.app_state.show_player_chest) { this.switchPlayerChestVisibility(); } }, @@ -153,4 +156,5 @@ diff --git a/lootalot_front/src/components/Request.vue b/lootalot_front/src/components/Request.vue index 1ef0991..8f35886 100644 --- a/lootalot_front/src/components/Request.vue +++ b/lootalot_front/src/components/Request.vue @@ -40,12 +40,12 @@ computed: { // Check if item is requested by active player isRequested () { - const reqs = this.state.requests[this.state.player_id]; + const reqs = this.state.player_claims[this.state.player_id]; return reqs.includes(this.item); }, // Check if item is requested by multiple players including active one isInConflict () { - const reqs = this.state.requests; + const reqs = this.state.player_claims; const playerId = this.state.player_id; var reqByPlayer = false; var reqByOther = false; diff --git a/lootalot_front/src/components/Wealth.vue b/lootalot_front/src/components/Wealth.vue index a7798a2..63f9dcf 100644 --- a/lootalot_front/src/components/Wealth.vue +++ b/lootalot_front/src/components/Wealth.vue @@ -12,8 +12,8 @@

{{ wealth[3] }}

-

PG

-

{{ wealth[2] }}

+

PO

+

{{ wealth[2] }}

PA