Katan: Catan Universe style landscape HUD and trade board

Drag-to-build with confirm/cancel, pinch/pan board, round turn and trade
buttons, and a trade board panel (bank, player, reply). Findings from the
Catan Universe 2.7.5 reverse engineering are in docs/RE-catan-universe.md.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WrH771kLJmTHnEfcmV2YDx
This commit is contained in:
Claude
2026-10-24 16:49:18 +00:00
parent 2e66567643
commit fae031d2b5
9 changed files with 1237 additions and 41 deletions
+23
View File
@@ -22,6 +22,8 @@ truth, so the UI can only ever offer a move the rules would accept.
| **Board drawing** | `CatanBoardView.kt` | The `Canvas`: tiles, tokens, ports, robber, roads, pieces, highlights | Change how a piece is drawn (art, shapes, animation) |
| **Panels** | `CatanPanels.kt` | Resource tiles, hand, player cards, dice, action bar, log | Restyle or rearrange widgets |
| **Dialogs** | `CatanDialogs.kt` | Discard, robber victim, play card, trade, trade reply, game over | Change a dialog's flow or look |
| **HUD** | `CatanHud.kt` | The landscape controls: build column, ✓ / ✗, round turn / trade buttons, pinch-pan board | Move or restyle a landscape control |
| **Trade board** | `CatanTradeBoard.kt` | The base-game trade panel (offer, bank, reply) | Change how trades are composed or answered |
| **Screen** | `CatanScreen.kt` | Wiring to `MatchController`, portrait/landscape layout, which dialog shows | Change the layout or add a new element |
| **Previews** | `CatanPreviews.kt` | Android Studio previews of real positions | Iterate on the look without a match |
@@ -169,3 +171,24 @@ Not done yet, in rough priority order:
4. A timer or cancel button on offers (the engine has neither).
5. A board that shows the *last* move (a faint highlight of what just changed).
6. Landscape polish on large tablets; the right-hand panel scrolls but is plain.
## Landscape HUD and trade board (from Catan Universe)
Landscape screens use the control scheme of Catan Universe's match view, redrawn in 2D
(what was learned, and from where: [RE-catan-universe.md](RE-catan-universe.md)). Portrait keeps the stacked layout.
* **Drag to build.** The left column holds Road / Settlement / City (and Wall / Knight in
Cities & Knights). Drag a piece onto the island: lit spots snap under the finger
(`CatanInteraction.snap`), release over one to **stage** it, then press **✓** to place or **✕**
to cancel (`CatanInteraction.stageable`, `spotOf`). A tap on a piece still arms the board for
tapping a spot. Setup placements, free roads and chores are not staged: they commit on tap.
* **Pinch and pan** the island (`ZoomPanBox`). The board is drawn through a graphics layer, so
taps and drops arrive in board coordinates; hit-testing is unchanged.
* **Round buttons**, bottom right: the big one is roll / end turn / done (whatever the engine
currently allows); ⇄ is trade; the small pair is buy / play card (Improve / Cards in C&K).
* **Trade board** (`CatanTradeBoard`, base game): a panel over the bottom of the island with a
Bank / Player toggle, a round button per rival to address an offer to one player, a *get* row on
top, a *give* row below, and ▾ hide / ✕ clear / ✓ send on the right. Bank mode shows each resource's
ratio under the *give* card. An offer made to you opens the same panel read-only: ✓ accepts,
✕ declines, *Counter…* makes the rows editable.
Cities & Knights goods trades and the counter-offer chooser still use dialogs.