diff --git a/src/features/buyable.tsx b/src/features/buyable.tsx index 1ab8a83..cf49443 100644 --- a/src/features/buyable.tsx +++ b/src/features/buyable.tsx @@ -68,7 +68,7 @@ export type Buyable = Replace< cost: GetComputableType; resource: GetComputableType; canPurchase: GetComputableTypeWithDefault>; - purchaseLimit: GetComputableTypeWithDefault; + purchaseLimit: GetComputableTypeWithDefault; classes: GetComputableType; style: GetComputableType; mark: GetComputableType; @@ -172,6 +172,16 @@ export function createBuyable( const Title = coerceComponent(currDisplay.title || "", "h3"); const Description = coerceComponent(currDisplay.description); const EffectDisplay = coerceComponent(currDisplay.effectDisplay || ""); + const amountDisplay = + unref(genericBuyable.purchaseLimit) === Decimal.dInf ? ( + <>Amount: {formatWhole(genericBuyable.amount.value)} + ) : ( + <> + Amount: {formatWhole(genericBuyable.amount.value)} /{" "} + {formatWhole(unref(genericBuyable.purchaseLimit))} + + ); + return ( {currDisplay.title ? ( @@ -182,8 +192,7 @@ export function createBuyable(

- Amount: {formatWhole(genericBuyable.amount.value)} /{" "} - {formatWhole(unref(genericBuyable.purchaseLimit))} + {amountDisplay}
{currDisplay.effectDisplay ? (
@@ -209,7 +218,7 @@ export function createBuyable( processComputable(buyable as T, "cost"); processComputable(buyable as T, "resource"); processComputable(buyable as T, "purchaseLimit"); - setDefault(buyable, "purchaseLimit", 1); + setDefault(buyable, "purchaseLimit", Decimal.dInf); processComputable(buyable as T, "style"); processComputable(buyable as T, "mark"); processComputable(buyable as T, "small");