Remove Player 2 stats from UI - show only current player info
This commit is contained in:
@@ -491,24 +491,15 @@ class GameUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateUI() {
|
updateUI() {
|
||||||
// Update player stats
|
// Update current player stats
|
||||||
const p1Cells = this.map.getPlayerCells(1);
|
const currentCells = this.map.getPlayerCells(this.currentPlayer);
|
||||||
const p2Cells = this.map.getPlayerCells(2);
|
const currentStrength = currentCells.reduce((sum, c) => sum + c.getStrength(), 0);
|
||||||
|
const currentSupply = this.map.calculateSupply(this.currentPlayer);
|
||||||
|
|
||||||
const p1Strength = p1Cells.reduce((sum, c) => sum + c.getStrength(), 0);
|
// Update player 1 card (only player for now)
|
||||||
const p2Strength = p2Cells.reduce((sum, c) => sum + c.getStrength(), 0);
|
document.getElementById('player1-cells').textContent = currentCells.length;
|
||||||
|
document.getElementById('player1-supply').textContent = currentSupply;
|
||||||
document.getElementById('player1-cells').textContent = p1Cells.length;
|
document.getElementById('player1-strength').textContent = currentStrength;
|
||||||
document.getElementById('player1-supply').textContent = this.map.calculateSupply(1);
|
|
||||||
document.getElementById('player1-strength').textContent = p1Strength;
|
|
||||||
|
|
||||||
document.getElementById('player2-cells').textContent = p2Cells.length;
|
|
||||||
document.getElementById('player2-supply').textContent = this.map.calculateSupply(2);
|
|
||||||
document.getElementById('player2-strength').textContent = p2Strength;
|
|
||||||
|
|
||||||
// Update active player
|
|
||||||
document.getElementById('player1-card').classList.toggle('active', this.currentPlayer === 1);
|
|
||||||
document.getElementById('player2-card').classList.toggle('active', this.currentPlayer === 2);
|
|
||||||
|
|
||||||
// Update game info
|
// Update game info
|
||||||
document.getElementById('current-turn').textContent = this.currentPlayer;
|
document.getElementById('current-turn').textContent = this.currentPlayer;
|
||||||
@@ -522,6 +513,16 @@ class GameUI {
|
|||||||
instruction.textContent = 'Select a cell with dice to move';
|
instruction.textContent = 'Select a cell with dice to move';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update selected cell info
|
||||||
|
const cellInfo = document.getElementById('selected-cell-info');
|
||||||
|
if (this.selectedCell) {
|
||||||
|
cellInfo.style.display = 'block';
|
||||||
|
document.getElementById('cell-strength').textContent = this.selectedCell.getStrength();
|
||||||
|
document.getElementById('cell-dice').textContent = this.selectedCell.dice.length;
|
||||||
|
} else {
|
||||||
|
cellInfo.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
// Update buttons
|
// Update buttons
|
||||||
const cancelBtn = document.getElementById('cancel-btn');
|
const cancelBtn = document.getElementById('cancel-btn');
|
||||||
const endTurnBtn = document.getElementById('end-turn-btn');
|
const endTurnBtn = document.getElementById('end-turn-btn');
|
||||||
|
|||||||
@@ -36,24 +36,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="player-card player-2" id="player2-card">
|
|
||||||
<h3>Player 2</h3>
|
|
||||||
<div class="player-stats">
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">Cells:</span>
|
|
||||||
<span class="stat-value" id="player2-cells">0</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">Supply:</span>
|
|
||||||
<span class="stat-value" id="player2-supply">0</span>
|
|
||||||
</div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">Total Strength:</span>
|
|
||||||
<span class="stat-value" id="player2-strength">0</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="game-info">
|
<div class="game-info">
|
||||||
<h3>Game Info</h3>
|
<h3>Game Info</h3>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
@@ -86,6 +68,20 @@
|
|||||||
<button class="btn btn-action" id="cancel-btn" style="width:100%" disabled>Cancel</button>
|
<button class="btn btn-action" id="cancel-btn" style="width:100%" disabled>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="selected-cell-info" id="selected-cell-info" style="display:none;">
|
||||||
|
<h3>Selected Cell</h3>
|
||||||
|
<div class="cell-stats">
|
||||||
|
<div class="stat">
|
||||||
|
<span class="stat-label">Strength:</span>
|
||||||
|
<span class="stat-value" id="cell-strength">0</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat">
|
||||||
|
<span class="stat-label">Dice:</span>
|
||||||
|
<span class="stat-value" id="cell-dice">0</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="battle-log">
|
<div class="battle-log">
|
||||||
<h3>Battle Log</h3>
|
<h3>Battle Log</h3>
|
||||||
<div class="log-entries" id="battle-log">
|
<div class="log-entries" id="battle-log">
|
||||||
|
|||||||
@@ -231,6 +231,32 @@ body {
|
|||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Selected Cell Info */
|
||||||
|
.selected-cell-info {
|
||||||
|
background: var(--bg-panel);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected-cell-info h3 {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-stats {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-stats .stat {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
.action-buttons {
|
.action-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
Reference in New Issue
Block a user