feat: Implement a new lobby system with configurable match duration, game over screen, and core game state management.

This commit is contained in:
2025-12-20 01:10:49 +08:00
parent 75eb398649
commit b0d45d4569
12 changed files with 1241 additions and 338 deletions
+9
View File
@@ -0,0 +1,9 @@
[ ADT's Daily Report - 2025-12-18 ]
✅ Global Match Timer System - Added configurable match duration that can be set by host in lobby (1, 2, 3, 5, or 10 minutes). The timer displays at the top center of the screen in mm:ss format and syncs across all clients via RPC. Modified lobby_manager.gd, lobby.tscn, lobby.gd, and goals_cycle_manager.gd.
✅ Game Over Screen - When global timer reaches 0, the match ends and displays a full-screen "TIME'S UP!" overlay with final leaderboard showing 🥇🥈🥉 rankings for all players. Player controls are disabled when match ends.
✅ Back to Main Menu - Added "BACK TO MAIN MENU" button on the game over screen that properly cleans up game state (GameStateManager.end_game(), LobbyManager.reset()) and transitions back to lobby.tscn.
✅ Goals Cycle Integration - Extended goals_cycle_manager.gd with global match timer (start_match, match_ended signal). The 30-second goal cycles continue until the global match timer expires, at which point no new cycles start.
+36
View File
@@ -0,0 +1,36 @@
[ ADT's Daily Report - 2025-12-19 ]
## Bug Fixes
**GDScript Parse Errors Fixed** - Resolved type inference errors in `boot_screen.gd` and `admin_panel.gd` by using explicit type annotations instead of inferred typing for variables where the type couldn't be determined (e.g., `await` returns, `Dictionary.get()` comparisons).
## Lobby UI Redesign
**Match Duration Sync** - Added client-side read-only display for match duration. Host sees OptionButton to change, clients see Label text that updates via RPC when host changes duration.
**Character Selection System** - Implemented in `lobby_manager.gd`:
- 4 characters available: Bob, Gatot, Masbro, Oldpop
- `cycle_character(direction)` with ◀ ▶ buttons
- RPC sync via `sync_character()` to broadcast selections to all players
- Character expression textures used as preview images
**Area Selection System** - Host-only area selector:
- 4 placeholder areas: Desert, Forest, City, Factory
- `cycle_area(direction)` with ◀ ▶ buttons (disabled for clients)
- RPC sync via `sync_area()` to show current area to all players
**New Lobby Layout** (`lobby.tscn` redesign):
- Top bar: Profile, Logout, Match ID + Copy, Duration setting
- Host banner (yellow "HOST" label)
- 4 player slots with: character preview image, ◀ ▶ nav buttons, ready status
- Area selector at bottom-left
- Bottom bar: Leave, Ready, Match buttons
**Player Slot Character Navigation** - Fixed client character selector arrows missing by adding CharacterNav (◀ ▶) to all 4 player slots. Local player sees navigation buttons, other players see just character name label.
## Files Modified
- `scripts/ui/boot_screen.gd` - Type annotation fix
- `scripts/ui/admin_panel.gd` - Type annotation fixes
- `scripts/managers/lobby_manager.gd` - Character/area selection data, signals, RPCs
- `scenes/lobby.tscn` - Complete UI redesign with player slots
- `scenes/lobby.gd` - New UI logic for character/area selection