From 39f813bec3f160f232b21c9e75305d0362491be7 Mon Sep 17 00:00:00 2001 From: Neshura Date: Wed, 16 Aug 2023 01:02:36 +0200 Subject: [PATCH] Always Display all Ethics + Text Formatting for the table --- src/routes/graphs/excel-style/+page.svelte | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/routes/graphs/excel-style/+page.svelte b/src/routes/graphs/excel-style/+page.svelte index a27ffc1..58cb18a 100644 --- a/src/routes/graphs/excel-style/+page.svelte +++ b/src/routes/graphs/excel-style/+page.svelte @@ -64,6 +64,21 @@ pageData.ethicsData = new Map(); pageData.gestaltCount = { total: 0, machines: 0 }; + chellarisData.ethics.forEach((ethic, id) => { + const newEthicsData: { + machine: boolean; + displayName: string; + regular: number; + fanatic: number; + } = { + machine: ethic.machine, + displayName: ethic.displayName, + regular: 0, + fanatic: 0 + }; + pageData.ethicsData.set(id, newEthicsData); + }) + tmpGameData.empires.forEach((empire, index) => { if (selectedGameGroups.includes(empire.group)) { groupEmpires.set(index, empire); @@ -187,7 +202,7 @@ {#each pageData.ethicsData as ethicData} {#if !ethicData[1].machine} - {ethicData[1].displayName} + {ethicData[1].displayName} {ethicData[1].regular} {ethicData[1].fanatic} @@ -207,7 +222,7 @@ {#each pageData.ethicsData as ethicData} {#if ethicData[1].machine} - {ethicData[1].displayName} + {ethicData[1].displayName} {ethicData[1].regular} {/if} @@ -238,6 +253,11 @@ td { padding: 0.3rem 0.5rem; border: 1px solid var(--color-text); + text-align: center; + } + + .table-label { + text-align: right; } h4 {