diff --git a/src/locales/en.json b/src/locales/en.json index 8a88ea95..27135a83 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -594,6 +594,9 @@ "info": [ "This shows how much load the area can take. Each furniture has a hidden load value that can be viewed below.", "(the maximum value is not comfirmed yet!)" - ] + ], + "hall": "Hall", + "room": "Room {number}", + "corridor": "Corridor" } } \ No newline at end of file diff --git a/src/routes/furnishing/index.svelte b/src/routes/furnishing/index.svelte index ea743909..a79c99a6 100644 --- a/src/routes/furnishing/index.svelte +++ b/src/routes/furnishing/index.svelte @@ -18,29 +18,45 @@ export let data; - let type = 'interior'; + let type = 'hall'; let items = []; let max = 0; const maxLoad = { - exterior: 4500, - interior: 2000, + exterior: 8700, + hall: 8700, + room1: 3700, + room2: 3700, + room3: 3700, + corridor: 3700, }; let currentUsage = { - interior: {}, exterior: {}, + hall: {}, + room1: {}, + room2: {}, + room3: {}, + corridor: {}, }; - $: currentLoad = Object.entries(currentUsage[type]).reduce((prev, [id, val]) => { - prev += data[id].load * val; - return prev; - }, 0); + $: currentLoad = Object.entries(currentUsage[type]).reduce( + (prev, [id, val]) => { + prev.load += data[id].load * val; + prev.energy += data[id].energy * val; + return prev; + }, + { + load: 0, + energy: 0, + }, + ); let sortBy = 'ratio'; let sortOrder = false; async function parseFurnishing() { + const currentType = type === 'exterior' ? 'exterior' : 'interior'; items = Object.values(data) - .filter((e) => e.type === type || e.type === '') + .filter((e) => e.type === currentType || e.type === '') .sort((a, b) => { switch (sortBy) { case 'ratio': @@ -112,7 +128,10 @@ const prefix = getAccountPrefix(); const furnishingData = readSave(`${prefix}furnishing`); if (furnishingData !== null) { - currentUsage = JSON.parse(furnishingData); + currentUsage = { + ...currentUsage, + ...JSON.parse(furnishingData), + }; } } @@ -135,31 +154,56 @@

{$t('furnishing.title')}

-
- - {$t('furnishing.load')} - {currentLoad} / {maxLoad[type]} +
+
+ {$t('furnishing.energy')} + {currentLoad.energy}
-
- - +
+ +
+ {#if type !== 'exterior'} +
+ + + + + +
+ {/if}
@@ -228,12 +272,19 @@ {item.ratio.toFixed(2)}
-

{currentUsage[type][item.id] || 0}

+

+ {currentUsage[type][item.id] || 0} +

@@ -259,6 +310,7 @@ @apply outline-none; @apply transition; @apply duration-100; + @apply whitespace-no-wrap; &:hover { @apply border-primary; diff --git a/static/images/furnishing/alchemists_crafting_bench.png b/static/images/furnishing/alchemists_crafting_bench.png new file mode 100644 index 00000000..e392477e Binary files /dev/null and b/static/images/furnishing/alchemists_crafting_bench.png differ diff --git a/static/images/furnishing/azure_crane.png b/static/images/furnishing/azure_crane.png new file mode 100644 index 00000000..f080e39f Binary files /dev/null and b/static/images/furnishing/azure_crane.png differ diff --git a/static/images/furnishing/black-back_hound.png b/static/images/furnishing/black-back_hound.png new file mode 100644 index 00000000..b3ada908 Binary files /dev/null and b/static/images/furnishing/black-back_hound.png differ diff --git a/static/images/furnishing/forest-patrol_hound.png b/static/images/furnishing/forest-patrol_hound.png new file mode 100644 index 00000000..201bdf59 Binary files /dev/null and b/static/images/furnishing/forest-patrol_hound.png differ diff --git a/static/images/furnishing/forest_boar.png b/static/images/furnishing/forest_boar.png new file mode 100644 index 00000000..57675fca Binary files /dev/null and b/static/images/furnishing/forest_boar.png differ diff --git a/static/images/furnishing/jade-eyed_cat.png b/static/images/furnishing/jade-eyed_cat.png new file mode 100644 index 00000000..dfcb708d Binary files /dev/null and b/static/images/furnishing/jade-eyed_cat.png differ diff --git a/static/images/furnishing/northland_cat.png b/static/images/furnishing/northland_cat.png new file mode 100644 index 00000000..f6f4a3c5 Binary files /dev/null and b/static/images/furnishing/northland_cat.png differ diff --git a/static/images/furnishing/northland_hound.png b/static/images/furnishing/northland_hound.png new file mode 100644 index 00000000..6042555d Binary files /dev/null and b/static/images/furnishing/northland_hound.png differ diff --git a/static/images/furnishing/sheriff_cat.png b/static/images/furnishing/sheriff_cat.png new file mode 100644 index 00000000..d9265200 Binary files /dev/null and b/static/images/furnishing/sheriff_cat.png differ diff --git a/static/images/furnishing/shiba.png b/static/images/furnishing/shiba.png new file mode 100644 index 00000000..58e94eaf Binary files /dev/null and b/static/images/furnishing/shiba.png differ diff --git a/static/images/furnishing/tiger-striped_cat.png b/static/images/furnishing/tiger-striped_cat.png new file mode 100644 index 00000000..0318b0a1 Binary files /dev/null and b/static/images/furnishing/tiger-striped_cat.png differ