democratizedspace / dspace

Free, open source space exploration idle game. Build your home base on earth, gather resources, and launch into orbit.
https://democratized.space
BSD Zero Clause License
3 stars 2 forks source link

more robust unit system #34

Open futuroptimist opened 1 year ago

futuroptimist commented 1 year ago

Some items have units:

    {
        "id": "36",
        "name": "kevlar shock cord",
        "description": "Perfect for model rocketry. Used to attach the rocket body to the parachute.",
        "image": "/assets/kevlar_cord.jpg",
        "price": "0.3 dUSD",
        "unit": " m"
    },

The unit string is prefixed with a space if the unit should be displayed as such. Also, currently units can only be placed after the item amount, not before (but there may be edge cases where this should be supported too).