add currency display in inventory

This commit is contained in:
Sven Balzer 2025-02-04 22:30:30 +01:00
parent a3b6271bf3
commit add059a902
5 changed files with 79 additions and 0 deletions

View File

@ -290,6 +290,17 @@
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
<div class="currency">
{{>editable-input type="number" name="system.currency.dukaten" value=actor.system.currency.dukaten}}
<svg viewbox="80 0 40 40" data-tooltip="{{localize "DSA41.currency.dukaten"}}"> <use href="/systems/dsa-4th-edition/src/Assets/coins.svg#Gold"> </use></svg>
{{>editable-input type="number" name="system.currency.silbertaler" value=actor.system.currency.silbertaler}}
<svg viewbox="120 0 40 40" data-tooltip="{{localize "DSA41.currency.silbertaler"}}"><use href="/systems/dsa-4th-edition/src/Assets/coins.svg#Diamond"></use></svg>
{{>editable-input type="number" name="system.currency.heller" value=actor.system.currency.heller}}
<svg viewbox="0 0 40 40" data-tooltip="{{localize "DSA41.currency.heller"}}"> <use href="/systems/dsa-4th-edition/src/Assets/coins.svg#Copper"> </use></svg>
{{>editable-input type="number" name="system.currency.kreuzer" value=actor.system.currency.kreuzer}}
<svg viewbox="40 0 40 40" data-tooltip="{{localize "DSA41.currency.kreuzer"}}"> <use href="/systems/dsa-4th-edition/src/Assets/coins.svg#Silver"> </use></svg>
</div>
<div class="list Bewaffnung subgrid-columns">
<div class="list-header">
<div>{{localize "DSA41.inventar.bewaffnung"}}</div>

31
src/Assets/coins.svg Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="160" height="40" version="1.1" viewBox="0 0 160 40" xmlns="http://www.w3.org/2000/svg">
<g id="Diamond">
<path fill="#5796a1" d="M 154.15,5.9 H 154.1 Q 148.25,0 140,0 131.65,0 125.85,5.9 120.8,10.95 120.1,17.75 120,18.9 120,20 q 0,0.5 0.05,0.95 0,0.05 0,0.1 0,0.6 0.05,1.25 0.7,6.8 5.75,11.9 v 0.05 Q 131.7,40 140,40 q 8.25,0 14.1,-5.75 h 0.05 q 5.45,-5.55 5.85,-13.1 0,-0.05 0,-0.1 0,-0.05 0,-0.15 0,-0.4 0,-0.9 0,-8.25 -5.85,-14.1 m -26.9,1.4 Q 132.5,2 140,2 q 7.45,0 12.7,5.3 5.3,5.25 5.3,12.7 0,0.5 0,0.9 0,0.1 0,0.15 -0.35,6.8 -5.3,11.75 -5.25,5.2 -12.7,5.2 -7.5,0 -12.75,-5.2 -4.5,-4.6 -5.15,-10.7 -0.05,-0.55 -0.05,-1.05 0,-0.1 0,-0.15 Q 122,20.5 122,20 q 0,-1 0.1,-2.05 0.65,-6.1 5.15,-10.65 z"/>
<path fill="#b6ecf5" d="m 140,4.1 q -7.5,0 -12.75,5.3 -4.5,4.5 -5.15,10.7 -0.05,0.4 -0.05,0.8 0,0.05 0,0.15 0,0.5 0.05,1.05 0.65,6.1 5.15,10.7 5.25,5.2 12.75,5.2 7.45,0 12.7,-5.2 4.95,-4.95 5.3,-11.75 Q 158,21 158,20.9 157.6,14.2 152.7,9.4 147.45,4.1 140,4.1 m -7.65,8.3 q 3.15,-3.2 7.65,-3.2 4.5,0 7.65,3.2 3.15,3.15 3.15,7.6 0,0.35 0,0.65 0,0.15 0,0.25 0,0.15 0,0.25 -0.4,3.75 -3.15,6.55 -3.15,3.1 -7.65,3.1 -4.5,0 -7.65,-3.1 -2.9,-2.9 -3.1,-6.8 v -0.05 q 0,-0.1 0,-0.2 -0.05,-0.3 -0.05,-0.65 0,-4.45 3.15,-7.6 m 7.7,1.4 H 140 q -0.85,0 -1.55,0.6 -0.6,0.7 -0.6,1.55 v 8.15 q 0,0.85 0.6,1.5 0.7,0.65 1.55,0.65 h 0.05 q 0.9,0 1.5,-0.65 0.7,-0.65 0.7,-1.5 v -8.15 q 0,-0.85 -0.7,-1.55 -0.6,-0.6 -1.5,-0.6 z"/>
<path fill="#9cd6e0" d="m 140,11.3 q -4.5,0 -7.65,3.15 -2.65,2.7 -3.1,6.4 v 0.05 q 0.2,3.9 3.1,6.8 3.15,3.1 7.65,3.1 4.5,0 7.65,-3.1 2.75,-2.8 3.15,-6.55 0,-0.1 0,-0.25 -0.45,-3.7 -3.15,-6.45 Q 144.5,11.3 140,11.3 m 0,2.5 h 0.05 q 0.9,0 1.5,0.6 0.7,0.7 0.7,1.55 v 8.15 q 0,0.85 -0.7,1.5 -0.6,0.65 -1.5,0.65 H 140 q -0.85,0 -1.55,-0.65 -0.6,-0.65 -0.6,-1.5 v -8.15 q 0,-0.85 0.6,-1.55 0.7,-0.6 1.55,-0.6 z"/>
<path fill="#80c2cd" d="m 140,9.2 q -4.5,0 -7.65,3.2 -3.15,3.15 -3.15,7.6 0,0.35 0.05,0.65 0,0.1 0,0.2 0.45,-3.7 3.1,-6.4 3.15,-3.15 7.65,-3.15 4.5,0 7.65,3.15 2.7,2.75 3.15,6.45 0,-0.1 0,-0.25 0,-0.3 0,-0.65 0,-4.45 -3.15,-7.6 Q 144.5,9.2 140,9.2 Z"/>
<path fill="#d0f8ff" d="m 140,2 q -7.5,0 -12.75,5.3 -4.5,4.55 -5.15,10.65 Q 122,19 122,20 q 0,0.5 0.05,0.9 0,-0.4 0.05,-0.8 0.65,-6.2 5.15,-10.7 5.25,-5.3 12.75,-5.3 7.45,0 12.7,5.3 4.9,4.8 5.3,11.5 0,-0.4 0,-0.9 0,-7.45 -5.3,-12.7 Q 147.45,2 140,2 Z"/>
</g>
<g id="Silver">
<path fill="#778b8c" d="M 80,21.05 Q 80,21 80,20.9 80,20.5 80,20 80,11.75 74.15,5.9 H 74.1 Q 68.25,0 60,0 51.65,0 45.85,5.9 40.8,10.95 40.1,17.75 40,18.9 40,20 q 0,0.5 0.05,0.95 0,0.05 0,0.1 0,0.6 0.05,1.25 0.7,6.8 5.75,11.9 v 0.05 q 5.76172,5.66328 13.9,5.75 0.1248,0 0.25,0 8.25,0 14.1,-5.75 h 0.05 q 3.31836,-3.3793 4.75,-7.5 0.94355,-2.64707 1.1,-5.6 0,-0.05 0,-0.1 M 60,2 q 7.45,0 12.7,5.3 5.3,5.25 5.3,12.7 0,0.5 0,0.9 0,0.1 0,0.15 -0.15625,3.03437 -1.25,5.7 Q 75.44121,30.05879 72.7,32.8 67.45,38 60,38 q -0.1252,0 -0.25,0 -7.3377,-0.0867 -12.5,-5.2 -4.5,-4.6 -5.15,-10.7 -0.05,-0.55 -0.05,-1.05 0,-0.1 0,-0.15 Q 42,20.5 42,20 42,19 42.1,17.95 42.75,11.85 47.25,7.3 52.5,2 60,2 Z"/>
<path fill="#c7d4d4" d="m 60,4.1 q 7.45,0 12.7,5.3 4.9,4.8 5.3,11.5 Q 78,20.5 78,20 78,12.55 72.7,7.3 67.45,2 60,2 52.5,2 47.25,7.3 42.75,11.85 42.1,17.95 42,19 42,20 q 0,0.5 0.05,0.9 0,-0.4 0.05,-0.8 Q 42.75,13.9 47.25,9.4 52.5,4.1 60,4.1 Z"/>
<path fill="#acc0c1" d="M 72.7,9.4 Q 67.45,4.1 60,4.1 q -7.5,0 -12.75,5.3 -4.5,4.5 -5.15,10.7 -0.05,0.4 -0.05,0.8 0,0.05 0,0.15 0,0.5 0.05,1.05 0.65,6.1 5.15,10.7 5.1623,5.11328 12.5,5.2 0.1248,0 0.25,0 7.45,0 12.7,-5.2 2.74121,-2.74121 4.05,-6.05 Q 77.84375,24.08437 78,21.05 78,21 78,20.9 77.6,14.2 72.7,9.4 M 60,9.2 q 4.5,0 7.65,3.2 3.15,3.15 3.15,7.6 0,0.35 0,0.65 0,0.15 0,0.25 0,0.15 0,0.25 -0.33398,3.13125 -2.3,5.6 -0.39629,0.48789 -0.85,0.95 -3.15,3.1 -7.65,3.1 -0.12539,0 -0.25,0 -4.33789,-0.0863 -7.4,-3.1 -2.9,-2.9 -3.1,-6.8 v -0.05 q 0,-0.1 0,-0.2 Q 49.2,20.35 49.2,20 49.2,15.55 52.35,12.4 55.5,9.2 60,9.2 m 0.05,4.6 H 60 q -0.85,0 -1.55,0.6 -0.6,0.7 -0.6,1.55 v 8.15 q 0,0.85 0.6,1.5 0.7,0.65 1.55,0.65 h 0.05 q 0.9,0 1.5,-0.65 0.7,-0.65 0.7,-1.5 v -8.15 q 0,-0.85 -0.7,-1.55 -0.6,-0.6 -1.5,-0.6 z"/>
<path fill="#95aead" d="M 67.65,14.45 Q 64.5,11.3 60,11.3 q -4.5,0 -7.65,3.15 -2.65,2.7 -3.1,6.4 v 0.05 q 0.2,3.9 3.1,6.8 3.06211,3.01367 7.4,3.1 0.12461,0 0.25,0 4.5,0 7.65,-3.1 0.45371,-0.46211 0.85,-0.95 1.96602,-2.46875 2.3,-5.6 0,-0.1 0,-0.25 -0.45,-3.7 -3.15,-6.45 M 60,13.8 h 0.05 q 0.9,0 1.5,0.6 0.7,0.7 0.7,1.55 v 8.15 q 0,0.85 -0.7,1.5 -0.6,0.65 -1.5,0.65 H 60 q -0.85,0 -1.55,-0.65 -0.6,-0.65 -0.6,-1.5 v -8.15 q 0,-0.85 0.6,-1.55 0.7,-0.6 1.55,-0.6 z"/>
<path fill="#829f9f" d="m 60,11.3 q 4.5,0 7.65,3.15 2.7,2.75 3.15,6.45 0,-0.1 0,-0.25 0,-0.3 0,-0.65 0,-4.45 -3.15,-7.6 Q 64.5,9.2 60,9.2 q -4.5,0 -7.65,3.2 -3.15,3.15 -3.15,7.6 0,0.35 0.05,0.65 0,0.1 0,0.2 0.45,-3.7 3.1,-6.4 Q 55.5,11.3 60,11.3 Z"/>
</g>
<g id="Copper">
<path fill="#85572c" d="m 40.0002,20.9 q 0,-0.4 0,-0.9 -0.004,-8.26797 -5.9,-14.1 V 5.85 Q 28.26797,0.00352 20.0002,0 q -8.3377,0.005 -14.2,5.9 -4.98223,5.06113 -5.7,11.85 -0.10469,1.15234 -0.1,2.25 0.004,0.51504 0.05,0.95 0,0.0391 0,0.1 -0.004,0.58301 0.05,1.2 v 0.05 q 0.71973,6.78516 5.7,11.9 h 0.05 q 5.82656,5.79746 14.15,5.8 8.27148,-3.9e-4 14.1,-5.8 v 0 q 5.52207,-5.48301 5.9,-13.05 10e-4,-0.0559 0,-0.1 0,-0.05 0,-0.15 m -20,-18.9 q 7.45,0 12.7,5.3 5.3,5.25 5.3,12.7 0,0.5 0,0.9 0,0.1 0,0.15 -0.35,6.8 -5.3,11.75 -5.25,5.2 -12.7,5.2 -7.5,0 -12.75,-5.2 -4.5,-4.6 -5.15,-10.7 -0.05,-0.55 -0.05,-1.05 0,-0.1 0,-0.15 -0.05,-0.4 -0.05,-0.9 0,-1 0.1,-2.05 0.65,-6.1 5.15,-10.65 5.25,-5.3 12.75,-5.3 z"/>
<path fill="#cca277" d="m 20.0002,4.1 q 7.45,0 12.7,5.3 4.9,4.8 5.3,11.5 0,-0.4 0,-0.9 0,-7.45 -5.3,-12.7 -5.25,-5.3 -12.7,-5.3 -7.5,0 -12.75,5.3 -4.5,4.55 -5.15,10.65 -0.1,1.05 -0.1,2.05 0,0.5 0.05,0.9 0,-0.4 0.05,-0.8 0.65,-6.2 5.15,-10.7 5.25,-5.3 12.75,-5.3 z"/>
<path fill="#bf8851" d="m 32.7002,9.4 q -5.25,-5.3 -12.7,-5.3 -7.5,0 -12.75,5.3 -4.5,4.5 -5.15,10.7 -0.05,0.4 -0.05,0.8 0,0.05 0,0.15 0,0.5 0.05,1.05 0.65,6.1 5.15,10.7 5.25,5.2 12.75,5.2 7.45,0 12.7,-5.2 4.95,-4.95 5.3,-11.75 0,-0.05 0,-0.15 -0.4,-6.7 -5.3,-11.5 m -12.7,-0.2 q 4.5,0 7.65,3.2 3.15,3.15 3.15,7.6 0,0.35 0,0.65 0,0.15 0,0.25 0,0.15 0,0.25 -0.4,3.75 -3.15,6.55 -3.15,3.1 -7.65,3.1 -4.5,0 -7.65,-3.1 -2.9,-2.9 -3.1,-6.8 v -0.05 q 0,-0.1 0,-0.2 -0.05,-0.3 -0.05,-0.65 0,-4.45 3.15,-7.6 3.15,-3.2 7.65,-3.2 m 1.55,5.2 q -0.6,-0.6 -1.5,-0.6 h -0.05 q -0.85,0 -1.55,0.6 -0.6,0.7 -0.6,1.55 v 8.15 q 0,0.85 0.6,1.5 0.7,0.65 1.55,0.65 h 0.05 q 0.9,0 1.5,-0.65 0.7,-0.65 0.7,-1.5 v -8.15 q 0,-0.85 -0.7,-1.55 z"/>
<path fill="#ae7640" d="m 27.6502,14.45 q -3.15,-3.15 -7.65,-3.15 -4.5,0 -7.65,3.15 -2.65,2.7 -3.1,6.4 v 0.05 q 0.2,3.9 3.1,6.8 3.15,3.1 7.65,3.1 4.5,0 7.65,-3.1 2.75,-2.8 3.15,-6.55 0,-0.1 0,-0.25 -0.45,-3.7 -3.15,-6.45 m -7.6,-0.65 q 0.9,0 1.5,0.6 0.7,0.7 0.7,1.55 v 8.15 q 0,0.85 -0.7,1.5 -0.6,0.65 -1.5,0.65 h -0.05 q -0.85,0 -1.55,-0.65 -0.6,-0.65 -0.6,-1.5 v -8.15 q 0,-0.85 0.6,-1.55 0.7,-0.6 1.55,-0.6 z"/>
<path fill="#9c6938" d="m 27.6502,12.4 q -3.15,-3.2 -7.65,-3.2 -4.5,0 -7.65,3.2 -3.15,3.15 -3.15,7.6 0,0.35 0.05,0.65 0,0.1 0,0.2 0.45,-3.7 3.1,-6.4 3.15,-3.15 7.65,-3.15 4.5,0 7.65,3.15 2.7,2.75 3.15,6.45 0,-0.1 0,-0.25 0,-0.3 0,-0.65 0,-4.45 -3.15,-7.6 z"/>
</g>
<g id="Gold">
<path fill="#af8c00" d="M 114.15,5.9 H 114.1 Q 108.25,0 100,0 91.65,0 85.85,5.9 80.8,10.95 80.1,17.75 80,18.9 80,20 q 0,0.5 0.05,0.95 0,0.05 0,0.1 0,0.6 0.05,1.25 0.7,6.8 5.75,11.9 v 0.05 Q 91.7,40 100,40 q 8.25,0 14.1,-5.75 h 0.05 q 5.45,-5.55 5.85,-13.1 0,-0.05 0,-0.1 0,-0.05 0,-0.15 0,-0.4 0,-0.9 0,-8.25 -5.85,-14.1 M 87.25,7.3 Q 92.5,2 100,2 q 7.45,0 12.7,5.3 5.3,5.25 5.3,12.7 0,0.5 0,0.9 0,0.1 0,0.15 -0.35,6.8 -5.3,11.75 -5.25,5.2 -12.7,5.2 -7.5,0 -12.75,-5.2 -4.5,-4.6 -5.15,-10.7 -0.05,-0.55 -0.05,-1.05 0,-0.1 0,-0.15 Q 82,20.5 82,20 q 0,-1 0.1,-2.05 0.65,-6.1 5.15,-10.65 z"/>
<path fill="#ffcc00" d="m 100,4.1 q -7.5,0 -12.75,5.3 -4.5,4.5 -5.15,10.7 -0.05,0.4 -0.05,0.8 0,0.05 0,0.15 0,0.5 0.05,1.05 0.65,6.1 5.15,10.7 5.25,5.2 12.75,5.2 7.45,0 12.7,-5.2 4.95,-4.95 5.3,-11.75 Q 118,21 118,20.9 117.6,14.2 112.7,9.4 107.45,4.1 100,4.1 m -7.65,8.3 Q 95.5,9.2 100,9.2 q 4.5,0 7.65,3.2 3.15,3.15 3.15,7.6 0,0.35 0,0.65 0,0.15 0,0.25 0,0.15 0,0.25 -0.4,3.75 -3.15,6.55 -3.15,3.1 -7.65,3.1 -4.5,0 -7.65,-3.1 -2.9,-2.9 -3.1,-6.8 v -0.05 q 0,-0.1 0,-0.2 -0.05,-0.3 -0.05,-0.65 0,-4.45 3.15,-7.6 m 7.65,1.4 q -0.85,0 -1.55,0.6 -0.6,0.7 -0.6,1.55 v 8.15 q 0,0.85 0.6,1.5 0.7,0.65 1.55,0.65 h 0.05 q 0.9,0 1.5,-0.65 0.7,-0.65 0.7,-1.5 v -8.15 q 0,-0.85 -0.7,-1.55 -0.6,-0.6 -1.5,-0.6 z"/>
<path fill="#e3b602" d="m 100,11.3 q -4.5,0 -7.65,3.15 -2.65,2.7 -3.1,6.4 v 0.05 q 0.2,3.9 3.1,6.8 3.15,3.1 7.65,3.1 4.5,0 7.65,-3.1 2.75,-2.8 3.15,-6.55 0,-0.1 0,-0.25 -0.45,-3.7 -3.15,-6.45 Q 104.5,11.3 100,11.3 m -1.55,3.1 q 0.7,-0.6 1.55,-0.6 h 0.05 q 0.9,0 1.5,0.6 0.7,0.7 0.7,1.55 v 8.15 q 0,0.85 -0.7,1.5 -0.6,0.65 -1.5,0.65 H 100 q -0.85,0 -1.55,-0.65 -0.6,-0.65 -0.6,-1.5 v -8.15 q 0,-0.85 0.6,-1.55 z"/>
<path fill="#caa202" d="M 92.35,14.45 Q 95.5,11.3 100,11.3 q 4.5,0 7.65,3.15 2.7,2.75 3.15,6.45 0,-0.1 0,-0.25 0,-0.3 0,-0.65 0,-4.45 -3.15,-7.6 -3.15,-3.2 -7.65,-3.2 -4.5,0 -7.65,3.2 -3.15,3.15 -3.15,7.6 0,0.35 0.05,0.65 0,0.1 0,0.2 0.45,-3.7 3.1,-6.4 z"/>
<path fill="#fee481" d="M 100,2 Q 92.5,2 87.25,7.3 82.75,11.85 82.1,17.95 82,19 82,20 q 0,0.5 0.05,0.9 0,-0.4 0.05,-0.8 0.65,-6.2 5.15,-10.7 5.25,-5.3 12.75,-5.3 7.45,0 12.7,5.3 4.9,4.8 5.3,11.5 0,-0.4 0,-0.9 0,-7.45 -5.3,-12.7 Q 107.45,2 100,2 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -26,6 +26,13 @@
"list_empty": "Keine",
"currency": {
"dukaten": "Dukaten",
"silbertaler": "Silbertaler",
"heller": "Heller",
"kreuzer": "Kreuzer"
},
"chat": {
"result": "Ergebnis",
"success": "Geschafft",

View File

@ -268,6 +268,29 @@ html {
}
}
& .currency {
width: min-content;
margin-left: auto;
align-items: center;
display: grid;
grid-template-columns: repeat(8, 1fr);
& .editable-input {
display: inline-block;
width: 7ch;
& input {
padding: 0;
}
}
& svg {
width: 25px;
height: 25px;
}
}
& .tabs {
padding: .5rem;

View File

@ -284,6 +284,13 @@ class DSA41_CharacterData extends TypeDataModel {
profession: new StringField(),
sozialstatus: new NumberField({ integer: true, inital: 1 }),
currency: new SchemaField({
dukaten: new NumberField({ integer: true, initial: 0 }),
silbertaler: new NumberField({ integer: true, initial: 0 }),
heller: new NumberField({ integer: true, initial: 0 }),
kreuzer: new NumberField({ integer: true, initial: 0 }),
}),
attributes: new SchemaField({
courage: new AttributeField(),
cleverness: new AttributeField(),