diff --git a/src/inventory_wars/gui/InventoryWars/OngoingView.qml b/src/inventory_wars/gui/InventoryWars/OngoingView.qml index e798009..c338152 100644 --- a/src/inventory_wars/gui/InventoryWars/OngoingView.qml +++ b/src/inventory_wars/gui/InventoryWars/OngoingView.qml @@ -169,7 +169,7 @@ Rectangle { font.pixelSize: UIStyle.fontSizeM font.bold: true color: UIStyle.textColor - visible: root.gameService.state == GameService.GameState.Ended && !root.gameService.revealed + visible: !root.gameService.revealed && root.gameService.state == GameService.GameState.Ended text: "No one guessed the item ;w;" } diff --git a/src/inventory_wars/gui/app.py b/src/inventory_wars/gui/app.py index 3864b63..09bcb05 100644 --- a/src/inventory_wars/gui/app.py +++ b/src/inventory_wars/gui/app.py @@ -35,6 +35,7 @@ class FirstGuessGui(FirstGuess): def calculate_score(self, item: ItemShare) -> int: result = super().calculate_score(item) if result: + self.game.reveal() self.game.guessed.emit(item.user.username, self.game.elapsedSeconds) self.game.end() return result @@ -124,6 +125,11 @@ class GameService(QObject): self.m_revealed = True self.stateChanged.emit() + @Slot() + def end(self) -> None: + self.m_game.end() + self.stateChanged.emit() + @Property(bool, notify=stateChanged) def revealed(self) -> bool: return self.m_revealed @@ -134,11 +140,6 @@ class GameService(QObject): session.execute(stmt) session.commit() - @Slot() - def end(self) -> None: - self.m_game.end() - self.stateChanged.emit() - @Property(GameState, notify=stateChanged) def state(self) -> GameState: match self.m_game.state: