Add "Put Back" button to cancel accidental discard draws

When you accidentally click the discard pile, you can now put the card
back instead of being forced to swap. The "Put Back" button appears
only when you've drawn from the discard pile.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Aaron D. Lee
2026-01-27 19:02:25 -05:00
parent 0c8d2b4a9c
commit 15135c404e
4 changed files with 62 additions and 0 deletions

View File

@@ -748,6 +748,14 @@ async def websocket_endpoint(websocket: WebSocket):
# Turn ended, check for CPU
await check_and_run_cpu_turn(current_room)
elif msg_type == "cancel_draw":
if not current_room:
continue
async with current_room.game_lock:
if current_room.game.cancel_discard_draw(player_id):
await broadcast_game_state(current_room)
elif msg_type == "flip_card":
if not current_room:
continue