mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 10:23:16 +08:00
feat(ui): add AFTER_GAME state and restart flow in GameUI
- Introduced `AFTER_GAME` state to handle post-game logic. - Updated `GameUI` to show restart prompt when the game ends. - Modified `StartPage` and `MainWindow` to support restart behavior. - Adjusted `endGame` method to transition to `AFTER_GAME`.
This commit is contained in:
@@ -58,11 +58,15 @@ namespace UNO::UI {
|
||||
if (clientGameState->getClientGameStage() == GAME::ClientGameStage::PENDING_CONNECTION) {
|
||||
window_->set_active_page(PageType::ConnectPage);
|
||||
}
|
||||
if (clientGameState->getClientGameStage() == GAME::ClientGameStage::PRE_GAME) {
|
||||
if (clientGameState->getClientGameStage() == GAME::ClientGameStage::PRE_GAME
|
||||
|| clientGameState->getClientGameStage() == GAME::ClientGameStage::AFTER_GAME) {
|
||||
window_->set_active_page(PageType::StartPage);
|
||||
window_->set_is_restart(clientGameState->getClientGameStage() == GAME::ClientGameStage::AFTER_GAME);
|
||||
}
|
||||
if (clientGameState->getClientGameStage() == GAME::ClientGameStage::ACTIVE
|
||||
|| clientGameState->getClientGameStage() == GAME::ClientGameStage::IDLE) {
|
||||
window_->set_is_ready(false);
|
||||
|
||||
window_->set_active_page(PageType::GamePage);
|
||||
|
||||
auto players = clientGameState->getPlayers();
|
||||
|
||||
Reference in New Issue
Block a user