Browse Source

Debug aktualisiert zu GameStats

main
Nicolas Fritz 2 years ago
parent
commit
80ed5f908e
  1. 2
      uno/css/uno.css
  2. 1
      uno/index.html
  3. 22
      uno/web/Style.js

2
uno/css/uno.css

@ -2,6 +2,8 @@
*{ *{
font-family: 'Cabin', sans-serif; font-family: 'Cabin', sans-serif;
font-size: large;
color: white;
} }
body body

1
uno/index.html

@ -25,7 +25,6 @@
<p id="player"></p> <p id="player"></p>
<p id="cardOnDeck"></p> <p id="cardOnDeck"></p>
<div id="playerCards"></div> <div id="playerCards"></div>
<button id="drawCard">Karte Ziehen</button>
</div> </div>
<div> <div>

22
uno/web/Style.js

@ -72,8 +72,6 @@ export default class Style {
}); });
this.startUnoLoop();
} }
refreshHtml() { refreshHtml() {
@ -98,24 +96,14 @@ export default class Style {
refreshDebug() { refreshDebug() {
$('#drawCard').css('background-color', 'white'); $('#drawCard').css('background-color', 'white');
$("#player").html("Spieler: " + this.game.currentPlayerInstanz.name);
$("#playerCards").html("Karten: ");
for (let i = 0; i < this.game.currentPlayerInstanz.hand.length; i++) {
$('#playerCards').append(this.game.currentPlayerInstanz.hand[i].name + " - " + this.game.currentPlayerInstanz.hand[i].color);
$('#playerCards').append('<button id="button' + i + '">+</button> | ');
$('#button' + i).on('click', () => {
this.game.currentPlayerInstanz.putCard(i);
setTimeout(() => {
this.showPlayerDeck(this.game.currentPlayerInstanz, false, true, false);
}, 100);
});
if (this.game.currentPlayerInstanz.hand[i].canPut) $('#button' + i).css('background-color', 'green');
$("#player").html("Aktueller Spieler: " + this.game.currentPlayerInstanz.name + " | " + this.game.currentPlayerInstanz.hand.length);
$("#playerCards").html("Weitere Spieler: <br>");
for (let i = 0; i < this.game.players.length; i++) {
if(this.game.players[i] === this.game.currentPlayerInstanz) continue;
$('#playerCards').append("" + this.game.players[i].name + " | " + this.game.players[i].hand.length + "<br>");
} }
$('#playerCards').append("" + this.game.currentPlayerInstanz.hand.length)
$("#cardOnDeck").html("Karte auf dem Tisch: " + this.game.cardOnDeck.name + " - " + this.game.cardOnDeck.color);
$("#playerInGame").html("Spieler im Spiel: " + this.game.players.length); $("#playerInGame").html("Spieler im Spiel: " + this.game.players.length);
if (!this.game.currentPlayerInstanz.canPlay) $('#drawCard').css('background-color', 'red');
} }
showUnoButton(){ showUnoButton(){

Loading…
Cancel
Save