1
0

feat: add case if the round end without guesses

This commit is contained in:
2026-06-05 17:23:49 +08:00
parent 11dc669656
commit 4e30e939ce
2 changed files with 17 additions and 2 deletions
@@ -147,7 +147,7 @@ Rectangle {
font.pixelSize: UIStyle.fontSizeM
font.bold: true
color: UIStyle.textColor
visible: root.gameService.state != GameService.GameState.Hidden
visible: root.gameService.revealed
text: "Fastest guess: " + root.guessed.seconds + "s (by " + root.guessed.username + ")"
}
@@ -158,11 +158,22 @@ Rectangle {
font.pixelSize: UIStyle.fontSizeM
font.bold: true
color: UIStyle.textColor
visible: root.gameService.state != GameService.GameState.Hidden && root.round.mode == GameService.GameScoring.FirstGuessThenHighestAmount
visible: root.gameService.revealed && root.round.mode == GameService.GameScoring.FirstGuessThenHighestAmount
text: "Highest count: " + root.highest.count + " (by " + root.highest.username + ")"
}
Text {
Layout.alignment: Qt.AlignHCenter
font.pixelSize: UIStyle.fontSizeM
font.bold: true
color: UIStyle.textColor
visible: root.gameService.state == GameService.GameState.Ended && !root.gameService.revealed
text: "No one guessed the item ;w;"
}
Item { Layout.fillHeight: true }
Button {
+4
View File
@@ -124,6 +124,10 @@ class GameService(QObject):
self.m_revealed = True
self.stateChanged.emit()
@Property(bool, notify=stateChanged)
def revealed(self) -> bool:
return self.m_revealed
@Slot()
def end(self):
self.m_game.end()