if (str == "Return") {
name = currentWord;
state = Waiting;
- setLabel(name, READY_COLOR);
+ setLabel("<Bereit>", READY_COLOR);
}
break;
case Waiting:
break;
case Typing:
- setLabel(currentWord, BASE_COLOR, name+":");
+ setLabel(currentWord, BASE_COLOR);
break;
}
}
-void Player::setLabel(QString body, QString color, QString header)
+void Player::setLabel(QString body, QString color)
{
QString text = QString("<font color=%1>").arg(color);
- if (!header.isEmpty()) {
- text += QString("<font size=-3>%1</font><br>").arg(Qt::escape(header));
+ if (state >= Waiting) {
+ text += QString("<font size=-3>%1:</font><br>").arg(Qt::escape(name));
}
text += Qt::escape(body);
theLabel->setText(text);
{
score += points;
state = Waiting;
- setLabel(currentWord, READY_COLOR, name+":");
+ setLabel(currentWord, READY_COLOR);
}
QString Player::getCurrentWord() {
void Player::nextWord() {
Q_ASSERT(state == Waiting);
currentWord = "";
- setLabel("<Eingabe erscheint hier>", BASE_COLOR, name+":");
+ setLabel("<Warte auf Eingabe>", BASE_COLOR);
state = Typing;
}
void Player::showScore() {
Q_ASSERT(state == Waiting);
- setLabel(QString ("Spieler %1 hat %2 Punkte.").arg(name).arg(score), READY_COLOR);
+ setLabel(QString ("%1 Punkte").arg(score), READY_COLOR);
}