fix: score display
All checks were successful
Linux arm64 / Build (push) Successful in 28s

This commit is contained in:
2025-02-01 12:54:11 +01:00
parent 02089c649b
commit f22debdf5f
6 changed files with 20 additions and 17 deletions

View File

@@ -22,9 +22,12 @@ public class LeaderboardRenderer {
private final ImVec4 cellColorEnemy = new ImVec4(1.0f, 0.0f, 0.0f, 0.5f);
private final int maxPlayersShowed = 2;
private final int emptyCellCount;
public LeaderboardRenderer(Game game, Player player) {
this.game = game;
this.currentPlayer = player;
this.emptyCellCount = game.getDoku().getEmptyCells().size();
}
private void renderRank(int rank) {
@@ -48,7 +51,7 @@ public class LeaderboardRenderer {
ImGui.sameLine();
renderName(player.getPseudo());
ImGui.sameLine();
renderScore(player.getScore());
renderScore(emptyCellCount - player.getRemainingCells());
ImGui.endChild();
ImGui.popStyleColor(3);
}

View File

@@ -21,8 +21,8 @@ public class MultiPlayerCompleteProgress {
public void render() {
Player firstPlayer = game.getLeaderboard().get(0);
ImGui.setCursorPosX(ImGui.getIO().getDisplaySizeX() / 2.0f - progressSize.x / 2.0f);
String progressText = firstPlayer.getPseudo() + " - " + firstPlayer.getScore() + "/" + emptyCellCount;
this.progressBar.render(progressText, progressSize, 1.0f - firstPlayer.getScore() / (float) emptyCellCount);
String progressText = firstPlayer.getPseudo() + " - " + (emptyCellCount - firstPlayer.getRemainingCells()) + "/" + emptyCellCount;
this.progressBar.render(progressText, progressSize, 1.0f - firstPlayer.getRemainingCells() / (float) emptyCellCount);
}
}