projects
/
multypo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix score
[multypo.git]
/
qt
/
player.cpp
diff --git
a/qt/player.cpp
b/qt/player.cpp
index c75bb4614ec71fb004c41e8dda348dddb55f3452..036d547d4482405524cbb37f53e7020eba2cb6b7 100644
(file)
--- a/
qt/player.cpp
+++ b/
qt/player.cpp
@@
-27,22
+27,22
@@
void Player::handleKey(QString str)
if (str == "Return") {
name = currentWord;
state = Waiting;
if (str == "Return") {
name = currentWord;
state = Waiting;
- setLabel(
name
, READY_COLOR);
+ setLabel(
"<Bereit>"
, READY_COLOR);
}
break;
case Waiting:
break;
case Typing:
}
break;
case Waiting:
break;
case Typing:
- setLabel(currentWord, BASE_COLOR
, name+":"
);
+ setLabel(currentWord, BASE_COLOR);
break;
}
}
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);
{
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);
}
text += Qt::escape(body);
theLabel->setText(text);
@@
-52,7
+52,7
@@
void Player::wordComplete(int points)
{
score += points;
state = Waiting;
{
score += points;
state = Waiting;
- setLabel(currentWord, READY_COLOR
, name+":"
);
+ setLabel(currentWord, READY_COLOR);
}
QString Player::getCurrentWord() {
}
QString Player::getCurrentWord() {
@@
-63,11
+63,11
@@
QString Player::getCurrentWord() {
void Player::nextWord() {
Q_ASSERT(state == Waiting);
currentWord = "";
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);
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);
}
}