From ead260162352049eff997f199d5d1480f39db937 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 12 May 2026 07:44:44 -0700 Subject: [PATCH] Show bonus amount on currency packs (#3907) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Show bonus amount on currency packs - Add `bonusAmount` field to `PackSchema` (non-negative int) - Render a rotated green corner ribbon (`+X FREE!`) on pack tiles when `bonusAmount > 0` - Add `cosmetics.free` translation key with `numFree` param Screenshot 2026-05-12 at 7 40 12 AM Describe the PR. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan --- resources/lang/en.json | 3 ++- src/client/components/CosmeticButton.ts | 11 ++++++++++- src/core/CosmeticSchemas.ts | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 26eb27c29..5135cc399 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -1116,7 +1116,8 @@ "legendary": "Legendary", "adfree": "ad-free for life!", "hard": "Plutonium", - "soft": "Caps" + "soft": "Caps", + "free": "+{numFree} BONUS!" }, "flag_input": { "title": "Select Flag", diff --git a/src/client/components/CosmeticButton.ts b/src/client/components/CosmeticButton.ts index 8799aaef8..33467c0cc 100644 --- a/src/client/components/CosmeticButton.ts +++ b/src/client/components/CosmeticButton.ts @@ -79,7 +79,7 @@ export class CosmeticButton extends LitElement { const colorClass = isHard ? "text-green-400" : "text-amber-700"; const currencyKey = isHard ? "cosmetics.hard" : "cosmetics.soft"; return html`
${icon} ${translateText(currencyKey)} + ${pack.bonusAmount > 0 + ? html`
+ ${translateText("cosmetics.free", { + numFree: pack.bonusAmount.toLocaleString(), + })} +
` + : nothing}
`; } diff --git a/src/core/CosmeticSchemas.ts b/src/core/CosmeticSchemas.ts index ae6196294..031a1d9ca 100644 --- a/src/core/CosmeticSchemas.ts +++ b/src/core/CosmeticSchemas.ts @@ -83,6 +83,7 @@ export const PackSchema = CosmeticSchema.extend({ displayName: z.string(), currency: z.enum(["hard", "soft"]), amount: z.number().int().positive(), + bonusAmount: z.number().int().nonnegative(), }); // Schema for resources/cosmetics/cosmetics.json