From b479d04c6cfde2750a367776e902efc83163a138 Mon Sep 17 00:00:00 2001 From: Vivacious Box Date: Mon, 4 Aug 2025 19:06:53 +0200 Subject: [PATCH] Icons update (#1562) ## Description: Add option toggle for structure sprites Add new icons Add new shapes Add scaling for text and bigger text image image ## 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 - [x] I have read and accepted the CLA aggreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: Mr. Box --------- Co-authored-by: evanpelle --- resources/images/AnchorIcon.png | Bin 198 -> 229 bytes resources/images/FactoryUnit.png | Bin 310 -> 291 bytes resources/images/SamLauncherUnit.png | Bin 361 -> 284 bytes resources/images/ShieldIcon.png | Bin 224 -> 235 bytes resources/lang/en.json | 4 + src/client/UserSettingModal.ts | 18 ++ src/client/graphics/layers/SettingsModal.ts | 33 ++ .../graphics/layers/StructureIconsLayer.ts | 304 ++++++++++++------ src/client/graphics/layers/StructureLayer.ts | 7 +- src/client/graphics/layers/UnitDisplay.ts | 4 +- src/core/game/UserSettings.ts | 8 + 11 files changed, 280 insertions(+), 98 deletions(-) diff --git a/resources/images/AnchorIcon.png b/resources/images/AnchorIcon.png index cd0582fc7f76f5ed96b35ec8bbd82ed0e492d678..b3005c0987408495b66b25bb66e2afd3321ad89d 100644 GIT binary patch delta 188 zcmV;t07L)A0p$UZF@K*)L_t(IjkQv-4Z|=Dql0|Yp~Z^Ce!;tNk8suw ztiTl?89Yq_O0U}BTG>0?0aS|O6X-0hWXzvIY7kl^y@OkW@HNlX1|xu2A&$b`Azw1F q9Z7%XyP7am#((GpwxTmJdfYEI?!p)vfeV`e0000bgeltB>lqEOSfLTXj|x1?oV3xfGy! zt(K9G)rtD4KByygtJ)N>IpNPI{7Kz^iKc*7xb%syz&-F0^&D75z67Sgar(J{0k8qC zqJ9U4k*B~Lko<7`^$MMk#0LDT)yA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8=yC#U!KBsZ z>pK_Z;Vv! ll2d`~aD=K|ZKbocsU)002ovPDHLkV1i{{Q@H>D diff --git a/resources/lang/en.json b/resources/lang/en.json index ae3c6405d..df37a229f 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -276,6 +276,10 @@ "special_effects_desc": "Toggle special effects. Deactivate to improve performances", "special_effects_enabled": "Special effects enabled", "special_effects_disabled": "Special effects disabled", + "structure_sprites_label": "Structure Sprites", + "structure_sprites_desc": "Toggle structure sprites", + "structure_sprites_enabled": "Structure Sprites enabled", + "structure_sprites_disabled": "Structure Sprites disabled", "anonymous_names_label": "Hidden Names", "anonymous_names_desc": "Hide real player names with random ones on your screen.", "anonymous_names_enabled": "Anonymous names enabled", diff --git a/src/client/UserSettingModal.ts b/src/client/UserSettingModal.ts index 70782e83a..14f79c190 100644 --- a/src/client/UserSettingModal.ts +++ b/src/client/UserSettingModal.ts @@ -125,6 +125,15 @@ export class UserSettingModal extends LitElement { console.log("💥 Special effects:", enabled ? "ON" : "OFF"); } + private toggleStructureSprites(e: CustomEvent<{ checked: boolean }>) { + const enabled = e.detail?.checked; + if (typeof enabled !== "boolean") return; + + this.userSettings.set("settings.structureSprites", enabled); + + console.log("🏠 Structure sprites:", enabled ? "ON" : "OFF"); + } + private toggleAnonymousNames(e: CustomEvent<{ checked: boolean }>) { const enabled = e.detail?.checked; if (typeof enabled !== "boolean") return; @@ -291,6 +300,15 @@ export class UserSettingModal extends LitElement { @change=${this.toggleFxLayer} > + + + + +