From b7a276d54ae88fde32cd1fba0ec4bb1ac41cab55 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Mon, 21 May 2018 16:28:24 +0200
Subject: Support talentless modes

---
 src/TopTalentsBox.vue | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

(limited to 'src/TopTalentsBox.vue')

diff --git a/src/TopTalentsBox.vue b/src/TopTalentsBox.vue
index eb73ef0..44a4e16 100644
--- a/src/TopTalentsBox.vue
+++ b/src/TopTalentsBox.vue
@@ -7,13 +7,17 @@
           <hero-image :actor="props.row.Actor" class="is-square"></hero-image>
         </b-table-column>
 
-        <b-table-column field="Talent" label="Talent">
+        <b-table-column field="Talent" label="Talent" :visible="hasTalents">
           <div style="display: flex; align-items: center; justify-content: space-between;">
             <span>{{ getTalentName(props.row.Talent) }}</span>
             <talent-image :entry="props.row" :size="48"></talent-image>
           </div>
         </b-table-column>
 
+        <b-table-column field="Count" label="Pick Rate" :visible="!hasTalents" sortable numeric>
+          <span>{{ Math.round(100 * playersPerMatch * props.row.Count / totalPicks) }}%</span>
+        </b-table-column>
+
         <b-table-column field="Winner" label="Win Rate" sortable numeric>
           <span>{{ Math.round(100 * props.row.Winner) }}%</span>
         </b-table-column>
@@ -42,6 +46,15 @@ export default Vue.component('top-talents-box', {
     top10Talents: function() {
       return this.reportService.getTop10Picks(this.selectedMode);
     },
+    hasTalents: function() {
+      return maps.hasTalents(this.selectedMode);
+    },
+    totalPicks: function() {
+      return this.reportService.getTotalPicks(this.selectedMode);
+    },
+    playersPerMatch: function() {
+      return maps.playersPerMatch(this.selectedMode);
+    },
   },
   components: {
     TalentImage,
-- 
cgit v1.3.1

