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
+73
View File
@@ -0,0 +1,73 @@
# Catan Universe 2.7.5 — what the reverse engineering showed
Source: `Catan+Universe_2.7.5_APKPure.xapk` (Unity, IL2CPP). Method: the Unity scenes
(`level3` is the match scene) were parsed with UnityPy for the uGUI hierarchy (names,
anchors, sizes, which objects start hidden), and `global-metadata.dat` was searched for
class, method and game-action names. Code bodies were not decompiled; behaviour below
that is not visible in a hierarchy is marked *inferred*.
The game is **landscape-only**; the canvas is laid out against a 1920×1080 reference.
## Match HUD (`InGameUI_mobile`)
| Region | Contents |
| --- | --- |
| Top | `PlayerFrames`: one frame per player (avatar, colour, VP, card count, timer), a "shuffle stats" button at the right |
| Bottom bar | `ResourceContainer`, centred (anchors 25–75 % of the width, 90 px tall): one entry per resource (Lumber, Brick, Wool, Grain, Ore; Cloth, Coins, Paper for C&K; Fish, Feather, Coca for other expansions, hidden otherwise) |
| Bottom right | `BtnTurn` (140 px, roll / end turn), `BtnTrade` immediately to its left (counter-offer and "blocked" badge variants), `BtnAddDevCard`, a chat/log `BubblePanel` |
| Left edge | `Drag&DropBuild`: a column of piece icons. **The player drags a piece from it onto the board** (`Drag&DropBuildRemove` is the drop target that cancels) |
| Mid right | `ConfirmButtonGroup`: a ✓ (`CatanConfirmBuildButton`) over a ✗ (`CatanCancelBuildButton`). A drop only *previews*; the ✓ commits |
| Board | `CandidateFactory` makes highlight markers for every legal spot (corner, edge, face); `QuickBuildTrigger{Corner,Edge,Face}` are hit zones for a one-tap/hold build; a candidate ticker shows the one-line instruction |
| Centre | Played-card panel, progress-card chooser, discard panel (`CardPanel` slides up over the bottom bar with a header) |
Gestures (`CatanGestureHandler`, `BaseGesture`, `TapHoldHandler`): one finger pans the
board, two-finger pinch zooms (`GetPinchZoomMagnitude`, `AutomaticZoom`), tap selects a
candidate, hold opens quick-build. Camera is a fixed-pitch table view.
## Trade board (`TradeBoard_mobile`)
A full-width panel that slides up over the bottom of the screen (`Animator`, collapsible):
```
┌────────────────────────────────────────────────────────────┬──────┐
│ [Player] [Bank] headline / description ☐ Block trade │ P1 P2│ header
├────────────────────────────────────────────────────────────┤ P3 P4│ (135 px)
│ OPPONENT row — cards you get (tinted by the opponent's │ │
│ colour) │ Hide │
│ ⇣⇣⇣ arrows (or the bank ratio chips 4:1 3:1 2:1) │ Deny │
│ PLAYER row — cards you give (tinted by your colour) │Accept│
└────────────────────────────────────────────────────────────┴──────┘
```
* **Header.** A *Player / Bank* toggle (extra toggles for the Inka 3:2 / 2:1 rules). A
**Block trade** checkbox refuses all incoming offers. One round button per rival
(`Player1…5`, with a selected border) picks whom the offer is addressed to; none
selected means everyone.
* **Content.** Two rows of resource cards separated by arrows. The top row is what you
*want*, the bottom row what you *give*. Tapping a card in a row adds one; tapping a
selected card removes one (*inferred from `AddFieldToTradePayment`/`ApplyCancelTradeResource`*).
In Bank mode a ratio row (`CardRatios`) shows the best rate per resource (harbours).
* **Right column (180 px).** Hide/collapse, **Deny** (✗), **Accept** (✓). When you
are the one receiving an offer, ✓ accepts and the chip-icon variant `Icon_CounterOffer`
turns the ✓ into a *counter-offer* send. A circular turn timer wraps the ✓.
* **Incoming offers** (`IncomingTradeContainer`) show in the same panel; the offerer's
colour tints the opponent row. Counter-offers land back in the proposer's panel with
an `AcceptCounterOfferButtonImage`.
## Seafarers game actions (from the metadata)
`CatanSeafarer_*_GameAction` names show what the mode adds to the base game:
* **Ships:** `BuildShip`, `MoveShip` (only the ship at the open end of a route, not on
the turn it was built), `BuildFreeRoad`; roads and ships share `AvailableCandidatesRoadAndShip`.
* **Pirate** alongside the robber: `RobberPirat_Move`, `RobberPirat_SelectPlayer`;
ships cannot be built or moved past a pirate-blocked edge.
* **Gold fields:** `ChooseGoldfieldResource` (a hex that pays any resource of choice).
* **Fog islands:** `Check_FogField`, `DistributeFogField` (hidden hex revealed when a
road/ship reaches it, the player takes the resource), `Shuffle_Islands`, `Shuffle_TileValueList`.
* **Treasure islands / Oasis / Great Canal** are Catan Universe scenario extras and are
**not** part of the physical Seafarers rules; they are out of scope here.
* **Setup:** `StartPhase_BuildSettlement`, `StartPhase_BuildRoadShip`, `PlaceValueChip`
(number tokens placed per scenario), `Shuffle_Harbors`.
* **Island bonus:** special victory points for the first settlement on a new island
(`AllIslandIds`, `CatanIslandState`).