mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-19 02:04:39 +00:00
Show max troops in PlayerInfoOverlay and leaderboard 🖌️ (#2625)
## Description: In the main discord, people seem to be divided in their opinions about this. But lets see what the playtest-people are saying, we can easily roll this back. <img width="197" height="312" alt="Screenshot 2025-12-15 220648" src="https://github.com/user-attachments/assets/c6acd1f8-03b1-4949-b15e-6a32f8460e18" /> <img width="405" height="323" alt="Screenshot 2025-12-15 220623" src="https://github.com/user-attachments/assets/21190a6f-1a0b-4db3-b6d0-c0722e98902a" /> ## 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: FloPinguin
This commit is contained in:
@@ -254,6 +254,7 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
|
||||
const isFriendly = myPlayer?.isFriendly(player);
|
||||
const isAllied = myPlayer?.isAlliedWith(player);
|
||||
let relationHtml: TemplateResult | null = null;
|
||||
const maxTroops = this.game.config().maxTroops(player);
|
||||
const attackingTroops = player
|
||||
.outgoingAttacks()
|
||||
.map((a) => a.troops)
|
||||
@@ -359,6 +360,17 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
|
||||
</span>
|
||||
</div>`
|
||||
: ""}
|
||||
${maxTroops >= 1
|
||||
? html`<div
|
||||
class="flex gap-2 text-sm opacity-80"
|
||||
translate="no"
|
||||
>
|
||||
${translateText("player_info_overlay.maxtroops")}
|
||||
<span class="ml-auto mr-0 font-bold">
|
||||
${renderTroops(maxTroops)}
|
||||
</span>
|
||||
</div>`
|
||||
: ""}
|
||||
${attackingTroops >= 1
|
||||
? html`<div
|
||||
class="flex gap-2 text-sm opacity-80"
|
||||
|
||||
Reference in New Issue
Block a user