From 9e1e8a450b2f2f4ae5de4e9ea1f04882289d66a9 Mon Sep 17 00:00:00 2001 From: Max Lundgren Date: Fri, 6 Jun 2025 01:17:22 +0300 Subject: [PATCH] Show alliances on the PlayerPanel (#1053) ## Description: Added a list of Alliances to the PlayerPanel. Displays `None` if player has no Alliances Screenshot 2025-06-05 at 19 55 26 Screenshot 2025-06-05 at 19 54 41 ## 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 understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: maxion_ --- resources/lang/en.json | 4 +++- src/client/graphics/layers/PlayerPanel.ts | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 275953b10..d059c9261 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -424,7 +424,9 @@ "start_trade": "Start trading", "stop_trade": "Stop trading", "yes": "Yes", - "no": "No" + "no": "No", + "none": "None", + "alliances": "Alliances" }, "error_modal": { "crashed": "Game crashed!", diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index 859803e7c..cf9d71a8d 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -329,6 +329,25 @@ export class PlayerPanel extends LitElement implements Layer { + +
+
+ ${translateText("player_panel.alliances")} + (${other.allies().length}) +
+
+ ${other.allies().length > 0 + ? other + .allies() + .map((p) => p.name()) + .join(", ") + : translateText("player_panel.none")} +
+
+ ${this.allianceExpiryText !== null ? html`