From ba812bbc03c4b6e5940ae2941ac6fc33cb9c98c5 Mon Sep 17 00:00:00 2001 From: Adrian Gaudebert Date: Tue, 5 Nov 2024 10:35:42 +0100 Subject: [PATCH] Display the time to recruit units in the University panel. --- package-lock.json | 17 +++++++++++++++ package.json | 2 ++ public/img/icons/time.png | Bin 0 -> 1512 bytes src/hud/Cost.svelte | 12 +++++++++++ src/hud/UniversityPanel.svelte | 38 ++++++++++++++++++--------------- 5 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 public/img/icons/time.png diff --git a/package-lock.json b/package-lock.json index 4609fa7..cf907a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,9 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tsconfig/svelte": "^5.0.4", + "@types/luxon": "^3.4.2", "immer": "^10.1.1", + "luxon": "^3.5.0", "svelte": "^4.2.19", "svelte-check": "^4.0.4", "tslib": "^2.7.0", @@ -706,6 +708,12 @@ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, + "node_modules/@types/luxon": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.4.2.tgz", + "integrity": "sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==", + "dev": true + }, "node_modules/acorn": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", @@ -912,6 +920,15 @@ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "dev": true }, + "node_modules/luxon": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/magic-string": { "version": "0.30.12", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", diff --git a/package.json b/package.json index 67a12e3..f1cd9ce 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tsconfig/svelte": "^5.0.4", + "@types/luxon": "^3.4.2", "immer": "^10.1.1", + "luxon": "^3.5.0", "svelte": "^4.2.19", "svelte-check": "^4.0.4", "tslib": "^2.7.0", diff --git a/public/img/icons/time.png b/public/img/icons/time.png new file mode 100644 index 0000000000000000000000000000000000000000..669413f9c5ccaa536066ec8ecf9ae11f6f4bdde8 GIT binary patch literal 1512 zcmVP)r^Mdt}pGWUii$-+bMW%yZTE zX&}|l4Kkn4AoX*B)PEwRfs-L$GY#SuUO2RJDkMzo(8_7O-oMCyGSba5E*q`k2oN7T|Q~=QtKL19_`GA@_I3A-)UJcrHj~W=OkVyMP6b6bA7_ z5<&vid2wrtvjzMT=@#!Q$%c6vLKNWDMXRxg`nYk5r5wsl2n|#TgZW{k`9|9?EJE;B zSVW{*sYkH62dzE8GlI3-sqaVt3T?-BS`i6bdeHeg15eB->$ae-tVtJ6 zxuh{*1KMjcCnh3{-MzQ+uHF=5wwU!~Leqt~mrZ`J3p>mfi%!*~5>pQ4lE%L>K<#aU z=mRlvdz1}r`c$*=S+}9Hy|U&(yMUXxruAV&gSslMtD{+`tuMbuv6Mr(gJOW7)d*sR zjdhxP8Qq39%l#Wi*dZi)PFr;`?%p|fiDD?0%NsNU1bd%u;esfGvgU@gz3xJfy@5Y( zo<7f3t*03KoIy2UGvT~FI<{3+TawRBu2!BuMSV2p7(eI+2)4Ckl7hkibU&u*d8X87oxN*WY-nsGOiS_0ian8ekK|(1%v4ZWYjp zr&0WVmmmXI8Xj!3eS|SXVt{@9@liW>)!)+UgwHIv)9@IArm}1UK?Yi$BB`>aBR*QV zyOv@HWWfG1ayW<*t*7C`CyDGbYBQK{rmk7LliLNgEiJL!F-$QOOF4sLfDRQp*;M-O zcy$m345CAt8QvdCSwm_c=XV$IGOyyF-%b3@r-@CvI~WOQJhjyqNZG? zQ8A#hJUwtK!XpH@SdfgaP94l9BP?bkOivBHCg-?!RSM+=xiwbbe&3o)8fgJu{V&T| zRm=*@i4d=vj^v-dMbW;sxR|;birh$4ort%hz9{N7IrVYl6iYdjOB$p_noRrkWjXy) z{M;T>Rh+ZT6^B<&Lf*Qm$lEv*xf^FezHSDx*3W`Cz!Q!&q1fL8(p6r_4D^JIk;MvH z*>ZPe@+LsCcq~N!RK=Zr8Xz$_Gmys&6t4He*^oK7vcntYiG17^uSRuNFluwR^s0)> z_w!H^_Z==p&c~UbXQOE26dVnlh-}|+$oT#fh`c}QyDX>QuS+Im4pmuB+I<>ezjtPh zd2iBUulM=EUpU8yEf|w6@c#7F&PC%CdlrvZG1LcqT^~EX0_vkNilJD_p7|wW`F@iCYF^cg4V>IJKhBIS~1J1Uw(YDx8w%idmEz%t3Xy9){^p#xa=9DA= O0000 + import { Duration } from 'luxon'; + import type { CostType } from "../types"; export let cost: CostType; + export let duration: number | null = null; + + + $: prettyDuration = (duration !== null) ? Duration.fromMillis(duration * 1000).toFormat(`mm:ss:SS`) : '';
@@ -21,6 +27,12 @@ Food { cost.food }
+ { #if duration !== null } +
+ Duration + { prettyDuration } +
+ { /if }