mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:10:42 +00:00
Show alliances on the PlayerPanel (#1053)
## Description: Added a list of Alliances to the PlayerPanel. Displays `None` if player has no Alliances <img width="272" alt="Screenshot 2025-06-05 at 19 55 26" src="https://github.com/user-attachments/assets/1378a56b-5033-45fa-b173-6b17054d40a3" /> <img width="318" alt="Screenshot 2025-06-05 at 19 54 41" src="https://github.com/user-attachments/assets/4d931cef-67a0-4dc9-a02c-13b0cce46864" /> ## 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_
This commit is contained in:
@@ -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!",
|
||||
|
||||
@@ -329,6 +329,25 @@ export class PlayerPanel extends LitElement implements Layer {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Alliances -->
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-white text-opacity-80 text-sm px-2">
|
||||
${translateText("player_panel.alliances")}
|
||||
(${other.allies().length})
|
||||
</div>
|
||||
<div
|
||||
class="bg-opacity-50 bg-gray-700 rounded p-2 text-white max-w-72 max-h-20 overflow-y-auto"
|
||||
translate="no"
|
||||
>
|
||||
${other.allies().length > 0
|
||||
? other
|
||||
.allies()
|
||||
.map((p) => p.name())
|
||||
.join(", ")
|
||||
: translateText("player_panel.none")}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${this.allianceExpiryText !== null
|
||||
? html`
|
||||
<div class="flex flex-col gap-1">
|
||||
|
||||
Reference in New Issue
Block a user