Skip to content

Match layout refresh fix#9637

Open
MostCromulent wants to merge 2 commits intoCard-Forge:masterfrom
MostCromulent:layoutfix
Open

Match layout refresh fix#9637
MostCromulent wants to merge 2 commits intoCard-Forge:masterfrom
MostCromulent:layoutfix

Conversation

@MostCromulent
Copy link
Contributor

Summary

Fix to address bug where essential match UI windows (player fields, player hand) could disappear on layout change (for example when loading a 1v1 layout during a 4-player Commander game) and were not restored when clicking "Refresh layout" in game menu. Fix ensures essential match UI windows for current match are always included in current layout.

Problem

The populate() method in VMatchUI.java had two issues:

  1. The field restoration loop started at index 2, skipping base fields entirely.
  2. Both field and hand checks used getParentCell() == null, which didn't detect stale references to cells from previously loaded layouts.

Solution

  • Loop now starts at index 0 to handle all fields.
  • Uses isShowing() to verify cells are part of the current visible layout, not stale references from old layouts.
  • Applied same fix to hand restoration logic.

Test plan

  • Start 4-player Commander game, load 1v1 layout, press Refresh Layout → all 4 player fields restored

Code authored by Claude (Opus 4.5) under human direction and review.

claude and others added 2 commits January 29, 2026 05:50
When clicking the "Refresh Layout" button in a 4-player Commander game,
essential windows (hand panels, player fields 2+) were not being restored.
This was because revertLayout() and openLayout() were loading the default
layout but not calling populate() to add missing windows for extra players.

Now both methods call populate() after loading the layout, matching the
normal screen switching flow. This ensures all essential windows are
automatically added when refreshing or loading a layout.

https://claude.ai/code/session_017EGLKuQqCnGndys8QLJcy5
The populate() method now properly handles all field views (not just
extra players) and uses isShowing() to detect stale cell references
from old layouts. Hand restoration also fixed with same approach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants