From dbba1dccb5e3b89dc539e02020e46f1fe4176db8 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 24 Mar 2026 15:17:25 -0700 Subject: [PATCH] Display the name of the creator for flags & skins (#3510) ## Description: So artists get credit for the work they do. ## 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/FlagInputModal.ts | 7 ++++- src/client/Store.ts | 1 + src/client/components/ArtistInfo.ts | 37 ++++++++++++++++++++++++++ src/client/components/FlagButton.ts | 26 +++++++++--------- src/client/components/PatternButton.ts | 8 ++++-- src/core/CosmeticSchemas.ts | 2 ++ 7 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 src/client/components/ArtistInfo.ts diff --git a/resources/lang/en.json b/resources/lang/en.json index 7df65f56e..931304a3e 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -919,6 +919,9 @@ "select_skin": "Select Skin", "selected": "selected" }, + "cosmetics": { + "artist_label": "Artist:" + }, "flag_input": { "title": "Select Flag", "button_title": "Pick a flag!", diff --git a/src/client/FlagInputModal.ts b/src/client/FlagInputModal.ts index c51fc2036..950b9afcd 100644 --- a/src/client/FlagInputModal.ts +++ b/src/client/FlagInputModal.ts @@ -39,7 +39,12 @@ export class FlagInputModal extends BaseModal { .map( ([key, flag]) => html` diff --git a/src/client/Store.ts b/src/client/Store.ts index 29c23d54f..5cf67cdc8 100644 --- a/src/client/Store.ts +++ b/src/client/Store.ts @@ -188,6 +188,7 @@ export class StoreModal extends BaseModal { name: flag.name, url: flag.url, product: flag.product, + artist: flag.artist, }} .selected=${selectedFlag === `flag:${key}`} .requiresPurchase=${rel === "purchasable"} diff --git a/src/client/components/ArtistInfo.ts b/src/client/components/ArtistInfo.ts new file mode 100644 index 000000000..3a55856aa --- /dev/null +++ b/src/client/components/ArtistInfo.ts @@ -0,0 +1,37 @@ +import { html, LitElement, nothing } from "lit"; +import { customElement, property } from "lit/decorators.js"; +import { translateText } from "../Utils"; + +@customElement("artist-info") +export class ArtistInfo extends LitElement { + @property({ type: String }) + artist?: string; + + createRenderRoot() { + return this; + } + + render() { + if (!this.artist) { + return nothing; + } + + return html` +
e.stopPropagation()} + > +
+ ? +
+ +
+ `; + } +} diff --git a/src/client/components/FlagButton.ts b/src/client/components/FlagButton.ts index f2575dad5..938087ef2 100644 --- a/src/client/components/FlagButton.ts +++ b/src/client/components/FlagButton.ts @@ -2,6 +2,7 @@ import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators.js"; import { Product } from "../../core/CosmeticSchemas"; import { translateCosmetic } from "../Cosmetics"; +import "./ArtistInfo"; import "./PurchaseButton"; export interface FlagItem { @@ -9,6 +10,7 @@ export interface FlagItem { name: string; url: string; product?: Product | null; + artist?: string; } @customElement("flag-button") @@ -39,7 +41,7 @@ export class FlagButton extends LitElement { render() { return html`
-
-
- ${translateCosmetic("flags", this.flag.name)} -
-
+ +
+ ${translateCosmetic("flags", this.flag.name)}
+