diff --git a/README.md b/README.md index ac98a23..bd0a108 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This branch is an analysis-only bootstrap for a Mainline-first modernization of The preserved 8,401-line Mainline source must be analyzed sequentially, in evidence-backed batches, before runtime work begins. All behavior-critical shortened symbols must be resolved and all batches must be complete before any public Lua API, runtime module, modern TOC, packaging, or release work is added. -Batches 01–10 (lines 1–5,000) are documented. The remaining batches are scheduled but not analyzed. +Batches 01–11 (lines 1–5,500) are documented. The remaining batches are scheduled but not analyzed. ## Goal diff --git a/docs/analysis/batch-schedule.md b/docs/analysis/batch-schedule.md index dcce1fb..61e2fb9 100644 --- a/docs/analysis/batch-schedule.md +++ b/docs/analysis/batch-schedule.md @@ -14,7 +14,7 @@ The immutable analysis source is `Legacy/Bejeweled_Mainline.lua` from commit `6f | 08 | 3501–4000 | 500 | `lines-3501-4000.md` | complete | | 09 | 4001–4500 | 500 | `lines-4001-4500.md` | complete | | 10 | 4501–5000 | 500 | `lines-4501-5000.md` | complete | -| 11 | 5001–5500 | 500 | `lines-5001-5500.md` | pending | +| 11 | 5001–5500 | 500 | `lines-5001-5500.md` | complete | | 12 | 5501–6000 | 500 | `lines-5501-6000.md` | pending | | 13 | 6001–6500 | 500 | `lines-6001-6500.md` | pending | | 14 | 6501–7000 | 500 | `lines-6501-7000.md` | pending | diff --git a/docs/analysis/identifier-ledger.md b/docs/analysis/identifier-ledger.md index 93fafdb..8c41b20 100644 --- a/docs/analysis/identifier-ledger.md +++ b/docs/analysis/identifier-ledger.md @@ -14,7 +14,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `F` / chunk | 181 | Generated as 25 atlas rectangles, copied into `J`, and `F[1]` resets gem texture coordinates (199–208, 1969). | `gemAtlasRects` | working | High for gem consumer; atlas asset/other frames pending. | 01–04 | UI/GemPool, UI/Animations | Identify texture and off-by-one rationale. | | `N` / chunk | 182 | Written as nine UV rectangles in a 3×3 loop (218–222). | `atlas3x3Rects` | working | High for shape: indices and 42.66/128 math. | 01–01 | UI/Animations | Identify texture/effect frames. | | `J` / chunk | 183 | Receives copies of all `F` rectangles via `unpack` (204–208). | `mutableAtlas50Rects` | working | Medium: copy semantics are explicit. | 01–01 | UI/Animations | Why is a second copy required? | -| `O` / chunk | 184 | Written at 50 numeric indices using 10×5 normalized UV cells (188–198). | `atlas10x5Rects` | working | High for shape, medium for texture. | 01–01 | UI/Animations | Identify owning texture. | +| `O` / chunk | 184 | Written at 50 numeric indices using 10×5 normalized UV cells (188–198), consumed as the hyper-effect atlas (4618–4624), then shadowed by the sound factory at 5049. | `hyperFxAtlasRects` | resolved | High. | 01–11 | UI/Animator | None. | | `ie` / chunk | 185 | Written at 16 indices using a 4×4 UV grid (211–217). | `atlas4x4Rects` | working | High for shape, medium for texture. | 01–01 | UI/Animations | Identify owning texture. | | `t` / chunk (second binding) | 186 | Declared nil, then shadowed again at 263; no read. | — | dead | High: no assignment/read before shadow. | 01–01 | Unassigned | Minifier artifact? | | `i` / chunk | 186 | Atlas scratch indexes `F`,`J`,`ie` (187–216); animator factory later reuses the captured binding for rotation angle radians (4939–4941). | `atlasOrAngleScratch` | resolved | High: both temporal roles explicit. | 01–10 | UI/Animations | Split roles in rewrite. | @@ -37,7 +37,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `f` / chunk | 240 | Constant `160`; legal popup width is `f×2` and text width `f×1.8` (1658, 1676). | `legalPopupHalfWidth` | resolved | High: direct geometry use. | 01–04 | UI/HUD | Name reflects legacy arithmetic. | | `L` / chunk | 241 | Constant `216`; legal popup height is `L+32` (1659). | `legalPopupContentHeight` | resolved | High: direct geometry use. | 01–04 | UI/HUD | None. | | `Je` / chunk | 242 | Constant `10`; halved into `gt` (290). | unknown dimension | unresolved | Low. | 01–01 | UI | Locate consumers. | -| `E` / chunk | 243 | Receives `math.random`, copied to `m`, then nilled; later read as the nil reset value for `gem.fxType` (307–308, 1972). | `nilFxType` after temporary alias | resolved | High: temporal value flow is explicit. | 01–04 | UI/Animations | Preserve nil reset without retaining alias indirection. | +| `E` / chunk | 243 | Receives `math.random`, copied to `m`, then nilled; later resets `gem.fxType` (307–308, 1972) before being shadowed by the minimap factory at 5194. | `nilFxType` after temporary alias | resolved | High: temporal value flow is explicit. | 01–11 | UI/Animations | Preserve nil reset without retaining alias indirection. | | `S` / chunk | 244 | Constant `-1`; assigned to hidden hint object's `fxType` during level-up reset (527). | `inactiveHintFxType` | working | Medium: reset/hide sequence (526–527). | 01–02 | UI/Animations | Confirm animator interpretation. | | `y` / chunk | 245 | Constant `1`; assigned to non-hyper gems' effect type during board transition (1990–1992). | `gameOverGemFxType` | working | Medium: function incomplete. | 01–04 | UI/Animations | Complete `Ke` dispatcher evidence. | | `Lt` / chunk | 246 | Constant `20`; no batch-01 read. | unknown constant | unresolved | Low. | 01–01 | Unassigned | Locate consumers. | @@ -53,7 +53,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `it` / chunk | 256 | Assigned `#FX_SHINE_ALPHA` (=6). | shine alpha count | working | High: direct length operation (223, 256). | 01–01 | UI/Animations | Confirm later iteration contract. | | `ke` / chunk | 257 | Constant `8`; no batch-01 read. | unknown enum eight | unresolved | Low. | 01–01 | Engine | Locate consumers. | | `Re` / chunk | 258 | Assigned `#FX_SHINE_ALPHA` (=6), duplicating `it`. | shine alpha count alias | working | High for value, low for distinct role (223, 258). | 01–01 | UI/Animations | Why two aliases? | -| `g` / chunk | 259 | Constant `9`; compared with gem effect type to identify hyper-specific cleanup (1990–1995). | `hyperGemFxType` | working | Medium: transition evidence. | 01–04 | UI/Animations | Confirm general dispatcher meaning. | +| `g` / chunk | 259 | Constant `9`; identifies hyper-gem cleanup (1990–1995) and the hyper glow animator branch (4618–4647), then is shadowed by the main-window factory at 5290. | `hyperGemFxType` | resolved | High. | 01–11 | UI/Animator | Preserve numeric effect value. | | `mt` / chunk | 260 | Constant `40`; no batch-01 read. | unknown constant | unresolved | Low. | 01–01 | Unassigned | Locate consumers. | | `te` / chunk | 261 | Constant `10`; assigned to all multiplier floating-text objects (513, 518). | `multiplierTextFxType` | working | High for observed role; enum ownership pending. | 01–02 | UI/Animations | Find effect dispatcher branch. | | `be` / chunk | 262 | Constant `10`; no batch-01 read. | unknown constant | unresolved | Low. | 01–01 | Unassigned | Distinguish from `te`. | @@ -628,11 +628,74 @@ Complete spawn, gravity, countdown, and state-transition bodies support resolved | `A` / shadow function | 4922 | Constructs/wires invisible animator frame and all effect queues/helpers; shadows clear-work effect enum. | `createAnimator` | resolved | High. | 10–10 | UI/Animator | None. | | `e` / `A` local | 4923 | Animator frame configured and returned. | `animator` | resolved | High. | 10–10 | UI/Animator | `movingGems`/`movingJewels` mismatch. | | `t` / `A` rotation loop | 4938 | Degree 0–360 used to precompute sine/cosine tables. | `degrees` | resolved | High. | 10–10 | UI/Animator | None. | -| `V` / shadow function | 4971 | Network-frame factory remains open after 5000; shadows idle animator state captured by earlier closures/factory. | `createNetwork` | working | High for prefix. | 10–10 | Network/Transport | Complete in batch 11. | -| `o` / `V` local | 4974 | Network frame with queue, send method, throttling, and callbacks. | `network` | working | High for prefix. | 10–10 | Network/Transport | Complete in batch 11. | +| `V` / shadow function | 4971 | Constructs and installs the network frame, send queue, one-second throttle, and receive dispatcher; closes at 5047 after shadowing idle animator state captured by earlier closures. | `createNetwork` | resolved | High. | 10–11 | Network/Transport | Factory installs globally rather than returning. | +| `o` / `V` local | 4974 | Network frame with queue, send method, throttling, receive callback, and final `Bejeweled.network` installation. | `network` | resolved | High. | 10–11 | Network/Transport | None. | | `l`,`i`,`o`,`n`,`t` / network `Send` params | 4981 | Unused self, message type, two required payload fields, optional final field. | `self`,`messageType`,`field1`,`field2`,`field3` | resolved | High. | 10–10 | Network/Transport | Determine semantic fields from callers. | -| `t`,`o` / network `OnUpdate` params | 4988 | Network frame and elapsed delta; callback continues after 5000. | `network`,`delta` | working | High for prefix. | 10–10 | Network/Transport | Complete in batch 11. | +| `t`,`o` / network `OnUpdate` params | 4988 | Network frame and elapsed delta; after a one-second accumulation the callback drains eligible queue entries until 20 sends succeed. | `network`,`delta` | resolved | High. | 10–11 | Network/Transport | Preserve successful-send rather than dequeue throttling. | ## Batch 10 resolution policy `Se` and `A` close in this batch, so their data-flow roles and explicit method attachments are resolved. Implicit `frame2` is recorded as accidental global evidence. Network factory `V` and its open update callback remain working until batch 11. + +## Batch 11 declarations and scopes + +| Legacy identifier / scope | Decl. | Evidence | Proposed name | Status | Confidence | First–last | Target | Question | +| --- | ---: | --- | --- | --- | --- | --- | --- | --- | +| `e` / four network-throttle locals | 5005 | The first three duplicate declarations are hidden in the same statement; the surviving fourth is immediately hidden by line 5006 without a read. | — | shadowed | High. | 11–11 | Network/Transport | Minifier artifact. | +| `i` / network-throttle local | 5006 | Declared with parsed message fields but never assigned or read. | — | dead | High. | 11–11 | Network/Transport | None. | +| `o`,`e`,`n` / network-throttle locals | 5006 | Receive queue-head fields split on `~`: addon payload, distribution channel, and whisper target. | `payload`,`channel`,`target` | resolved | High. | 11–11 | Network/Transport | Preserve empty-target handling. | +| first `i` / network `OnEvent` params | 5023 | Hidden by the second same-spelling parameter. | — | shadowed | High. | 11–11 | Network/Transport | None. | +| second `i` / network `OnEvent` params | 5023 | Receives the event name in the callback position but is never read. | — | dead | High. | 11–11 | Network/Transport | None. | +| `o`,`n`,`t`,`e` / network `OnEvent` params | 5023 | Addon prefix, payload, distribution channel, and sender used for validation and dispatch. | `prefix`,`payload`,`channel`,`sender` | resolved | High. | 11–11 | Network/Transport | Sender comparison is not normalized. | +| `o` / network-command local | 5025 | Receives the first `+`-separated field and selects `HSPub`, `HSSync`, or `LogSync`. | `command` | resolved | High. | 11–11 | Network/Transport | None. | +| `i` / network-command local | 5025 | Declared but never assigned/read before callback close. | — | dead | High. | 11–11 | Network/Transport | None. | +| `i` / friend pre-loop local | 5029 | Hidden by the numeric-for variable at 5030 without a read. | — | dead | High. | 11–11 | Network/Transport | None. | +| `o` / friend-check local | 5029 | Holds each `C_FriendList.GetFriendInfo` result for exact comparison with sender. | `friendName` | resolved | High. | 11–11 | Network/Transport | Verify modern return contract before runtime. | +| `i` / friend loop | 5030 | Iterates friend indices from 1 through `GetNumFriends()`. | `friendIndex` | resolved | High. | 11–11 | Network/Transport | None. | +| `O` / shadow function | 5049 | Constructs and installs the sound frame, deferred flag player, click limiter, and mouse-away updater; shadows the hyper atlas captured by earlier closures. | `createSoundManager` | resolved | High. | 11–11 | UI/Sound | Factory installs globally rather than returning. | +| `n` / `O` local | 5050 | Sound frame configured with flags/timers/scripts and installed as `Bejeweled.sound`. | `soundManager` | resolved | High. | 11–11 | UI/Sound | None. | +| `t`,`n`,`o` / sound `Play` params | 5060 | Sound manager, named sound flag, and combo index capped at six. | `soundManager`,`soundName`,`comboIndex` | resolved | High. | 11–11 | UI/Sound | Non-combo callers may omit index. | +| `t`,`n` / sound `OnUpdate` params | 5079 | Sound manager and delta used for hover/click timing and flag playback. | `soundManager`,`delta` | resolved | High. | 11–11 | UI/Sound | Disabled sounds freeze both timers. | +| `e` / sound-root local | 5112 | Starts at `ut`, optionally appends `q_`, and prefixes every bundled sound filename in the pass. | `soundPath` | resolved | High. | 11–11 | UI/Sound | None. | +| `n` / combo pre-loop local | 5173 | Immediately hidden by the numeric-for variable at 5174. | — | dead | High. | 11–11 | UI/Sound | None. | +| `n` / combo loop | 5174 | Scans combo flags 1–6 and derives the selected filename. | `comboIndex` | resolved | High. | 11–11 | UI/Sound | None. | +| `E` / shadow function | 5194 | Constructs and installs minimap icon visuals, toggle/tooltip callbacks, and attached/detached drag persistence; shadows the earlier nil/reset binding. | `createMinimapButton` | resolved | High. | 11–11 | UI/Minimap | Factory installs globally rather than returning. | +| `t` / `E` local | 5195 | Minimap frame configured through all callbacks and installed as `Bejeweled.minimap`. | `minimapButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `e`,`t` / minimap `OnMouseDown` params | 5220 | Minimap frame and mouse-button name; right press starts moving. | `minimapButton`,`mouseButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `t`,`n` / minimap `OnMouseUp` params | 5226 | Minimap frame and mouse-button name; left release toggles the main window. | `minimapButton`,`mouseButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `t` / minimap-toggle local | 5230 | Main window whose visibility, alpha, overlay, sound, and pause state are changed. | `window` | resolved | High. | 11–11 | UI/Minimap, UI/MainWindow | None. | +| `e` / minimap `OnEnter` param | 5250 | Minimap frame used to show its highlight before the spelling is shadowed at 5253. | `minimapButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `e` / minimap-tooltip local | 5253 | Optional keybinding text wrapped in parentheses and appended to tooltip title. | `keybindingText` | resolved | High. | 11–11 | UI/Minimap | None. | +| `e` / minimap `OnLeave` param | 5261 | Minimap frame used to hide its highlight. | `minimapButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `i` / minimap `OnUpdate` param | 5265 | Minimap frame tested for moving and repositioned in attached/detached modes. | `minimapButton` | resolved | High. | 11–11 | UI/Minimap | None. | +| `o`,`n` / minimap-drag locals | 5267 | Cursor X/Y coordinates before UI-scale normalization. | `cursorX`,`cursorY` | resolved | High. | 11–11 | UI/Minimap | None. | +| `a`,`l` / minimap-drag locals | 5268–5269 | Minimap center X/Y derived from its left/bottom and half dimensions. | `minimapCenterX`,`minimapCenterY` | resolved | High. | 11–11 | UI/Minimap | None. | +| `e`,`t` / minimap offset locals | 5270–5271 | UI-scaled cursor offsets from minimap center, then absolute cursor coordinates in the detached branch. | `x`,`y` | resolved | High. | 11–11 | UI/Minimap | Split offset/absolute roles in rewrite. | +| `e` / attached-angle local | 5280 | Shadows X offset inside the attached branch and stores degrees derived by `atan2`. | `angleDegrees` | resolved | High. | 11–11 | UI/Minimap | Preserve argument order/sign convention. | +| `g` / shadow function | 5290 | Begins the main-window constructor and shadows hyper-gem effect enum captured by earlier animator code; remains open after line 5500. | `createMainWindow` | working | High for ownership. | 11–11 | UI/MainWindow | Complete in batch 12. | +| `t` / `g` local | 5291 | Main window receiving backdrop, drag/show/hide/resize controls and child frames; factory remains open. | `window` | working | High. | 11–11 | UI/MainWindow | Complete constructor in batch 12. | +| `a` / main-window local | 5302 | Captured frame level used to place the resize handle three levels above it. | `frameLevel` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `o` / backdrop local | 5303 | Descriptor from `C()` populated with window textures/dimensions and passed to `SetBackdrop`. | `backdropInfo` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `e` / drag callbacks | 5313, 5318 | Distinct window-frame parameters used to start and stop moving/sizing. | `window` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `t` / hide/show callback params | 5321, 5326 | Distinct window callback parameters that are never read. | — | dead | High. | 11–11 | UI/MainWindow | None. | +| `o` / close-button local | 5342 | Close button configured to hide the main window only when no popup is visible. | `closeButton` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `t` / close callback param | 5347 | Callback button parameter is never read. | — | dead | High. | 11–11 | UI/MainWindow | None. | +| `e` / `bCrowbar` control local | 5353 | Optional textured frame toggling `bCrowbar.window`. | `crowbarButton` | resolved | High. | 11–11 | UI/MainWindow | Optional integration remains global. | +| `e` / `bCrowbar` callback param | 5363 | Callback frame parameter is never read. | — | dead | High. | 11–11 | UI/MainWindow | None. | +| `t` / menu callback local | 5378 | Alias of `Bejeweled.menuWindow` tested and toggled. | `menuWindow` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `o` / window-icon local | 5389 | Texture configured as the 64-pixel top-left icon and stored in `t.icon`. | `windowIcon` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `o` / logo-metadata local | 5395 | `largeText["Bejeweled"]` dimensions and UV coordinates used to build the logo. | `logoAtlas` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `i` / logo-container local | 5396 | Frame anchored across the window header; used as texture parent in line-5400 initializer, then shadowed. | `logoContainer` | resolved | High. | 11–11 | UI/MainWindow | Lua 5.1 initializer scope is required. | +| `i` / logo-texture local | 5400 | Texture created from prior `i`, configured from `o`, and stored as `t.logo`. | `logoTexture` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `o` / resize-handle local | 5407 | Mouse-enabled bottom-right frame that resets or begins sizing. | `resizeHandle` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `n`,`t` / resize `OnMouseDown` params | 5414 | Handle parameter is unused; button name selects reset versus sizing. | —; `mouseButton` | dead; resolved | High. | 11–11 | UI/MainWindow | None. | +| `t` / resize `OnMouseUp` param | 5425 | Callback handle parameter is never read. | — | dead | High. | 11–11 | UI/MainWindow | None. | +| `t` / size-change param | 5431 | Main window supplies width, menu state, and logo/icon children and receives derived height. | `window` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `o`,`a`,`i`,`l`,`r` / size-change locals | 5432–5456 | Width/board scale, logo scale, icon scale, logo atlas metadata, and remaining logo width. | `scale`,`logoScale`,`iconScale`,`logoAtlas`,`availableLogoWidth` | resolved | High. | 11–11 | UI/MainWindow | Preserve quadratic threshold formulas. | +| `n` / main-window auxiliary local | 5473 | Initially the global show/hide button, then reassigned to the full-window mouse-over screen at 5485. | `auxiliaryFrame` | resolved | High. | 11–11 | UI/MainWindow | Split temporal roles in rewrite. | +| `t` / overlay `OnMouseDown` param | 5489 | Mouse-over screen hidden after canceling game-over fade. | `mouseOverScreen` | resolved | High. | 11–11 | UI/MainWindow | None. | +| `t` / overlay `OnEnter` param | 5498 | Mouse-over screen callback remains open after its hiding guard at line 5500. | `mouseOverScreen` | working | High for frame role. | 11–11 | UI/MainWindow | Complete in batch 12. | + +## Batch 11 resolution policy + +Factories `V`, `O`, and `E` close and install their frames in this batch, so their bindings and callback roles are resolved. Network delimiter and throttle behavior, sound flag coalescing, minimap coordinate derivations, and completed resize arithmetic are behavior-critical evidence. Open factory `g` and its open overlay callback remain working until batch 12. diff --git a/docs/analysis/lines-5001-5500.md b/docs/analysis/lines-5001-5500.md new file mode 100644 index 0000000..0e6f9bf --- /dev/null +++ b/docs/analysis/lines-5001-5500.md @@ -0,0 +1,53 @@ +# Batch 11: lines 5001–5500 + +Source: `Legacy/Bejeweled_Mainline.lua` at commit `6faec1c` +Coverage: lines 5001–5500 inclusive +Blank: 5048, 5193, 5289 +Status: complete; network factory `V`, sound factory `O`, and minimap factory `E` close, while main-window factory `g` and its mouse-over `OnEnter` continue into batch 12 + +## Line-indexed coverage audit + +| Lines | Evidence represented | +| ---: | --- | +| 5001–5022 | Finishes the network `OnUpdate`. Each one-second service tick resets elapsed time and `throttleCount`, removes queued `~`-delimited entries from the head, sends eligible guild/whisper messages through `C_ChatInfo.SendAddonMessage`, and counts at most 20 successful sends. Invalid or currently ineligible entries are still discarded without consuming the quota, so a tick can drain more than 20 queue records. | +| 5023–5047 | Handles addon messages only for prefix `xe` while scores are migrated. It splits the first `+` into command/body, restricts whispered `HSPub` messages to exact friend-name matches, accepts non-whisper `HSPub` and all `HSSync` through `Ee`, and routes other-player `LogSync` through `dt`; then installs the frame as `Bejeweled.network` and closes `V`. | +| 5048 | Blank. | +| 5049–5078 | New `O` shadows the captured hyper-effect atlas and constructs `BejeweledSound`. Its `Play` method gates all requests on sound settings and window visibility, caps combo indices at six, rate-limits `GemClick` to one accepted request per 0.2 seconds, and sets named boolean flags for deferred playback. | +| 5079–5110 | Sound `OnUpdate` returns immediately while sounds are disabled; otherwise it advances hover/click timers. Every 0.5 seconds after the legal notice, leaving an unlocked/non-resizing window starts fade-out, exposes the mouse-over screen, hides the sound frame, and mouse-pauses gameplay; `waitMouseOver` reverses overlay state after reentry. | +| 5111–5171 | A pending sound pass selects normal root `ut` or its `q_` quiet variant, then independently consumes flags for invalid move, explosion, prompts, selection, power/hyper creation and destruction, click, board wipe, and electro explosion. Level-up uniquely uses the built-in `Sound\\Spells\\LevelUp.wav` path rather than the selected root. | +| 5172–5192 | Combo playback scans flags 1–6, consumes only the first active flag per update, maps level 1 to `gotset2.mp3` and higher levels to `combo(n+1)2.mp3`, and clears the aggregate `Combo` flag only after a scan reaches six with no earlier break. Installs `Bejeweled.sound` and closes `O`. | +| 5193 | Blank. | +| 5194–5219 | New `E` shadows the captured nil/reset binding and constructs the 33-pixel minimap frame, icon, tracking border, and hidden additive highlight. It starts at radius 105 and angle zero around the minimap. | +| 5220–5249 | Minimap press offsets the icon and starts right-button dragging. Release restores the offset/stops movement; left release hides the main window when no popup blocks it, or shows it at mouse-off alpha and establishes overlay, hidden sound frame, and mouse-pause state when the cursor is outside. | +| 5250–5264 | Hover shows highlight and a tooltip containing the optional configured keybinding; leave hides both. The local keybinding string shadows the consumed callback frame parameter. | +| 5265–5288 | During drag, cursor and minimap-center coordinates are normalized by UI scale. A distance greater than the minimap width detaches the icon, persists absolute X/Y, and anchors to `UIParent`; otherwise it derives/stores an angle with `atan2`, clears detached state, and reanchors on the 105-pixel circle. Installs `Bejeweled.minimap` and closes `E`. | +| 5289 | Blank. | +| 5290–5301 | New `g` shadows the captured hyper-effect enum and begins the main-window factory. It creates the initially hidden `q` by `me` top-level movable window and a mouse-bounds child expanded 20 pixels on every side. | +| 5302–5320 | Captures frame level, builds/applies the image-root-backed backdrop, enables left-button dragging unless the profile locks the window, and stops movement/sizing on drag end. | +| 5321–5341 | Hide clears global shown/activity state and resets active time. Show restores global state and game alpha, primes sound hover/wait state from cursor position, hides the overlay, shows the sound frame, and unpauses through `T(false)` when the summary is fully opaque. Callback frame parameters are unused. | +| 5342–5370 | Creates a close button that refuses to hide the game behind a visible popup. When optional `bCrowbar` exists, adds a textured control that toggles its window; its callback parameter is unused. | +| 5371–5406 | Creates the Menu button and toggles `menuWindow`, preserving its sub-screen through `keepScreen` when appropriate. Adds the 64-pixel window icon and constructs the Bejeweled logo from `largeText` dimensions and atlas coordinates; the texture local shadows its initialized container only after the RHS call. | +| 5407–5430 | Creates the bottom-right resize handle above the captured frame level. Right press restores canonical width/height; other presses begin right-edge sizing and set `resizing`. Release stops sizing. Resize bounds are half to 1.5 times the canonical dimensions. | +| 5431–5472 | `OnSizeChanged` derives board scale from width, switches the menu between `Menu`/50 pixels and `M`/26 pixels below 0.887, quadratically reduces icon scale below 0.855 with a 0.75 floor, and constrains logo width to remaining horizontal space. It scales board/summary, derives height as `(w+4)*scale+110`, refreshes the level bar according to game-over state, resizes logo/icon, and raises `resizeUpdate`. | +| 5473–5488 | Creates a one-pixel global show/hide toggle frame and attaches it to the window, then reuses the same local for the full-window mouse-over overlay and enables mouse input. | +| 5489–5500 | Overlay mouse-down cancels game-over hiding, sets fade duration to `-1`, restores hover/sound state, and hides the overlay. Its `OnEnter` begins with an early return while the window is hiding; the callback and factory continue in batch 12. | + +## Findings + +- Network throttling counts successful transport sends, not dequeued records. Unsupported channels, unavailable guild sends, and empty whisper targets are permanently dropped without using the 20-message quota. +- The network wire shape remains `messageType+field1~channel~target` in the queue and `command+body` on receipt; parsing stops at the first relevant delimiter assignments and must remain byte-compatible. +- Sound requests are flag-coalesced rather than queued. Multiple distinct flags may play in one update, while only one combo tier is consumed per pass; disabling sounds freezes the click and hover timers. +- Minimap detachment uses the minimap's full width as its radial threshold but the attached position uses a fixed 105-pixel radius. Detached X/Y and attached angle are distinct persisted layouts. +- Main-window resize is width-driven: height, board/summary scale, logo space, menu compactness, icon scale, and level-bar refresh all derive from the new width. The logo factor is ultimately overwritten by remaining-width arithmetic. + +## API and architecture mapping + +- Addon-message prefix registration/sending, guild state, friend enumeration, and the exact sender-name comparison are legacy networking contracts requiring authoritative Retail verification before implementation. +- `Network/Transport.lua`: completed queue serialization, one-second throttling, channel eligibility, receive dispatch, and global installation. +- `UI/Sound.lua`: deferred flag playback, quiet-asset selection, click throttling, and mouse-away pause/fade coordination. +- `UI/Minimap.lua`: icon construction, tooltip/toggle behavior, attached-angle geometry, detached coordinate persistence. +- `UI/MainWindow.lua`: open factory `g`, backdrop/drag/show/hide controls, resize derivations, optional `bCrowbar` integration, and mouse-over overlay. + +## Forward dependencies + +Batch 12 must resume at line 5501 inside the mouse-over overlay `OnEnter`, close that callback and main-window factory `g` only when the source does, and determine the later ownership of the window children and remaining constructor locals without crossing line 6000. diff --git a/tools/verify-bootstrap.ps1 b/tools/verify-bootstrap.ps1 index bfc72a7..18bbab7 100644 --- a/tools/verify-bootstrap.ps1 +++ b/tools/verify-bootstrap.ps1 @@ -139,9 +139,10 @@ Assert-ReportCoverage 'docs/analysis/lines-3001-3500.md' 3001 3500 Assert-ReportCoverage 'docs/analysis/lines-3501-4000.md' 3501 4000 Assert-ReportCoverage 'docs/analysis/lines-4001-4500.md' 4001 4500 Assert-ReportCoverage 'docs/analysis/lines-4501-5000.md' 4501 5000 +Assert-ReportCoverage 'docs/analysis/lines-5001-5500.md' 5001 5500 $lineCount = (Get-Content -LiteralPath 'Legacy/Bejeweled_Mainline.lua').Count Assert-True ($lineCount -eq 8401) "Legacy source has $lineCount lines, expected 8401" Write-Output "Verified: forbidden files absent; legacy and $($assetPaths.Count) asset hashes match $SourceCommit." -Write-Output "Verified: strict UTF-8 text, exact 8,401-line schedule, and complete batch-01/02/03/04/05/06/07/08/09/10 line coverage." +Write-Output "Verified: strict UTF-8 text, exact 8,401-line schedule, and complete batch-01/02/03/04/05/06/07/08/09/10/11 line coverage."