add max troops to control panel

This commit is contained in:
Evan
2024-10-31 15:08:39 -07:00
parent 092dde5a21
commit 4a3131d382
2 changed files with 6 additions and 8 deletions
+3
View File
@@ -168,6 +168,9 @@
* implement private game DONE 10/15/2024
* private game can select map DONE 10/16/2024
* Test on android DONE 10/17/2024
* add troop max
* use twitter emojis
* create build menu
* NPC has relations
* private game shows how many players joined
* optimize sendBoat function
+3 -8
View File
@@ -24,13 +24,7 @@ export class ControlPanel extends LitElement implements Layer {
private _maxTroops: number;
@state()
private _manpower: number = 0;
@state()
private _reserve: number = 0;
@state()
private _gold: number = 0
private troopRate: number;
@state()
private _isVisible = false;
@@ -52,6 +46,7 @@ export class ControlPanel extends LitElement implements Layer {
return
}
this._troops = player.troops()
this._maxTroops = this.game.config().maxTroops(player)
}
onAttackRatioChange(newRatio: number) {
@@ -135,7 +130,7 @@ export class ControlPanel extends LitElement implements Layer {
<div class="control-panel-info">
<div class="info-row">
<span class="info-label">Troops:</span>
<span>${renderTroops(this._troops)}</span>
<span>${renderTroops(this._troops)} / ${renderTroops(this._maxTroops)}</span>
</div>
</div>
<div class="slider-container">