Compare commits

..

218 Commits

Author SHA1 Message Date
sindoring 6b359d6142 Preserve the tested vendored Kira line endings
Five vendored files had cached checkout line endings differing from the index. Their bytes differ only by CRLF versus LF; Rust and manifest contents are unchanged. Commit the exact working bytes used by the successful complete gates and MoonWell player clippy run. Verified all five normalized blobs and exact staged-tree equality with the green stamp.
2026-10-17 22:09:35 +04:00
sindoring cea8198179 Check locale video defaults alongside instrumented session overrides
The load regression covers both locale-driven graphics defaults and the session's windowed override, without changing the player's behavior. Verified the workspace-graph test binary with WOW_BG=0 and WOW_BG=1: both pass. Shader and C-host VM parity regressions passed in the preceding complete test run; formatting and whitespace checks pass.
2026-10-17 18:51:59 +04:00
sindoring 4cf26a4b4a Make integration regressions portable on unattended Windows runs
Pin the locale-knob test's reference starting display mode and normalize shader line endings in the source assertion. Record the Windows cos sweep from the original C Lua 5.1 host: its complete answer exactly matches the Rust VM; classify cos as host-libm dependent alongside other transcendental cases. Verified isolated C-host reproduction, passing vm_parity, formatting and whitespace; full workspace/player gates follow on Windows.
2026-10-17 18:44:05 +04:00
sindoring 8de4abf979 Merge upstream quest completion and timer fixes through b2473e60
Automatic integration preserves the ruRU overlay and MoonWell configuration. Generated maps refreshed; final workspace and player checks are pending on this merged tree.
2026-10-17 18:11:58 +04:00
Sam Sung b2473e6095 Quest completion and timed-quest failure follow 1.12.1 (#1805)
Quest completion and timed-quest failure now follow 1.12.1.

- **isComplete runs the client's turn-in test (`0x4df580`).** The complete bit counts only when the template's flags ask for it, and a quest with nothing to check is never complete. Counters, held items, both standing bounds and money are read live. A pass fires the "Quest Completion" tutorial (`0x4df792`).
- **A timed quest that runs out latches failed.** The latch is set by the rebuild, by GetQuestTimers and by `SMSG_QUESTUPDATE_FAILEDTIMER` (`0x4df4f0`, `0x4df550`). GetQuestTimers prints the failure line and then fires QUEST_LOG_UPDATE inside the call (`0x4e1529`, `0x4e1554`).
- **Timers count by the local clock until the first sync,** and a zero-difference sync reads a second more (`0x4def00`).
- **Quest-giver failures wait for the quest record** and skip a latched quest (`0x5dc898`). A plain update failure no longer re-asks the givers.

Each change fails its test without it.

Fixes #1793
Fixes #1794

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:01:14 +07:00
sindoring 43e538eb0e Preserve Cyrillic fixtures in the roster casing regression
Verified the UTF-8 source contains Yo and Ye as distinct code points.
The runtime matching code is unchanged; the regression runs in the land gates.
2026-10-17 17:47:32 +04:00
sindoring e28bcfd8fd Integrate upstream through 746ad351 with the ruRU community pack
Keep MoonWell branding and deployment support on the stock glue screens
and Rust Lua VM. Preserve locale overlays, Cyrillic names and fonts,
localized spell costs and race/class labels through the new APIs.

Verified on Windows: formatting and the Russian locale/name policy unit
check in both VM kinds. Workspace clippy passed; complete real-data,
no-install, player and engine gates are pending before landing.
2026-10-17 17:33:14 +04:00
sindoring efc73d1165 Record the upstream ancestry already integrated by PR #7
Verified the source tree is byte-identical to origin/main (959054c3).
This checkpoint preserves the upstream parent discarded by the squash.
2026-10-17 17:09:56 +04:00
Sam Sung 746ad35176 Chat frames fade, hold their view and space messages as 1.12.1's (#1803)
A ScrollingMessageFrame now fades, keeps its view and spaces its messages as the client's does.

- Only the shown messages fade (`0x7884a5`-`0x788582`). A relayout off the bottom re-arms what it walks, including the first older message, before the fit test (`0x788af0` at `0x7888be`). That covers a scroll, a resize, a font change, a show and UpdateColorByID.
- A scrolled-up view stays on its messages as they arrive. It moves down a line only when a full ring overwrites the topmost shown message (`0x78819e`-`0x7881bb`).
- The gap between messages is the snapped unscaled spacing times the scale (`0x788954`-`0x788975`). Rows within one message snap their scaled gap (`0x5c2143`-`0x5c215c`). Each message must fit whole.
- ScrollToTop and ScrollToBottom do nothing on an empty frame (`0x788690`, `0x7886d0`).

Each change fails its test without it.

Fixes #1796
Fixes #1797
Fixes #1798

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:21:03 +07:00
Sam Sung b817db8df9 The fake world counts a session before its auth reply (#1802)
`leave_drops_the_world_session_and_keeps_the_logon` failed now and then at its first `assert_eq!(world.open(), 1)`.

The fake world server counted a session as open only after it had sent `SMSG_AUTH_RESPONSE`. A client that read the reply and reported `WorldAuthenticated` could therefore reach the assertion before the count rose.

The count now rises where the link is held, before any reply goes out, so `open()` never trails what the client has seen. Only the test fixture changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:09:14 +07:00
Sam Sung 9eed3d5b7d The quest log reads live and signals as 1.12.1's does (#1801)
The quest log getters now read live state at the call, and QUEST_LOG_UPDATE fires where the client fires it. Before, every log quest's reward items were asked up front, and a per-frame snapshot rebuilt the log.

- World entry registers the log watcher and rebuilds (`0x4de430`). The rebuild holds while quest records are pending, and the last landing rebuilds it (`0x4de510`, `0x4de8b0`).
- The getters ask on a miss (`0x4e0461`, `0x4e05e0`, `0x4e0b9e`). One update fires per missed record that lands, a recorded deviation from the client's per-call callbacks.
- An item a listed quest needs fires one update (`0x4df7b0`). The time response and a faction rank change fire one each (`0x4def1b`, `0x4d58f3`).
- Cached names and templates seed each new VM.

On an idle frame with 20 quests: 46.5 µs before, 1.0 µs after. Each change fails its test without it.

Fixes #1209

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:52:57 +07:00
Sam Sung 93098a0646 Chat frames lay out, page and scroll as 1.12.1's; panes aim as they open (#1799)
A ScrollingMessageFrame now lays out, pages and scrolls as the client's relayout does.

- A message that does not fit whole, past the anchored one, ends the layout (`0x7889b3`-`0x7889c5`). A half-fitting top line is hidden, not clipped, and the shown count that paging reads agrees.
- PageUp and PageDown take one line step per shown message, then one step back, and stop on a refusal (`0x7885b0`, `0x7885e0`). One shown message nets no move.
- ScrollUp is refused once the oldest message shows, and AtTop reads that flag (`0x78861c`, `0x7931b5`). It is nil on an empty frame (`0x787775`).

A character pane's camera takes its aimed pose with its spawn, so a pane is framed on the frame it opens.

Each change fails its test without it.

Fixes #1786
Fixes #1787

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:21:58 +07:00
Sam Sung c97fd03a57 Lua tables, ipairs and globals behave as the client's 5.0 (#1792)
benilla-lua's tables and globals now follow the client's Lua 5.0, not 5.1.

Tables:
- They size, fill and rehash as 5.0's ltable.c does: the hash part doubles (`0x6fab90`), and a log size of 0 is the shared dummy (`0x6fa601`).
- A hash part past 2^24 nodes raises `table overflow`.
- Constructors store every 32 items.
- A weak table's clearing removes the key, so `next` from it raises (`0x6f79d0`).
- A weak-keyed table keeps its string keys (`0x6f79f0`).

Globals and libraries:
- `ipairs` returns itself, and a second argument steps once.
- `setglobal` assigns the top of the stack.
- The state opens in the client's order, with no `_G`.

Each new test fails without its fix.

Fixes #1487
Fixes #1789
Fixes #1790
Fixes #1169

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:49:05 +07:00
Sam Sung d8a55240e0 Lua's collector paces and sizes its stack as the client's 5.0 (#1791)
The collector now paces as the client's Lua 5.0 does.

The threshold:
- The state opens at 4× its count (`0x6f6ec8`), and InitLua then sets 256 KB (`0x7039f2`).
- After a collection it is the count plus the larger of the old headroom and a quarter of the count (`0x6fae00`). The headroom is capped at the free space in the client's six block pools, which a new book models (`0x6fae90`).
- The memory watch collects from a threshold of 0 (`0x703bd6`), and varargs never collect.

The stack and call records start at 45 and 8 slots and grow by 5.0's rule (`0x6f5f60`). They are checked once per collection, during mark, and halved under a quarter's use (`0x6f7949`). A tail call checks the stack where the call is made (`0x6f922c`).

A collection of a 10 MB heap takes about 1 ms; each change fails its test without it.

Fixes #1783
Fixes #1784

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-10-17 17:20:11 +07:00
Sam Sung 80f751ffe5 Lua memory counts as the client's 5.0; the old shim's overrides are gone (#1788)
Lua memory now counts as the client's does:
- Every object is charged at its 32-bit Lua 5.0 size: a string is 17 bytes plus its length (`0x6f9da1`), a table header 32 (`0x6fa500`), a node 40, and a closure 36 plus 4 per upvalue (`0x6f9ebf`).
- Prototypes count 5.0's instructions and constants (`0x6fcb2b`).
- The string table and the concat buffer are counted as 5.0 sizes them.

The stock UI reads 10,618 KB, against 13,294 KB before.

The host's old C-host shim overrode benilla-lua's natives. It is gone:
- `collectgarbage` now moves the real collector, taking `__ftol`'s low word (`0x6f4400`);
- `gcinfo` reports that collector;
- `^` is the client's `math_pow` (`0x7fb4bd`);
- `loadstring` returns one value (`0x7032ba`).

An audit re-derived every size from the bytes. Each fix fails its test without it.

Fixes #1779
Fixes #1780

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:01:55 +07:00
Sam Sung d93c231d8e Linux audio plays: cpal 0.17.3 fixes ALSA's stalled callback (#1785)
On some Linux setups the game was silent. The device opened, but its data callback ran once and stopped, with no error. The music position never moved.

This is cpal 0.17.1's ALSA bug (RustAudio/cpal#1099, "Data callback called only once on ALSA"), fixed in 0.17.3 by setting playback's `avail_min` to one period. benilla's stream starts only at the start threshold, which is exactly that case. cpal goes to 0.17.3.

alsa 0.11 and bevy_audio's unbuilt cpal 0.15 cannot share a lock (`links = "alsa"`). A lock-only stand-in for alsa 0.9 settles that, documented in `third_party/alsa-0.9`.

The realtime-fallback log line now says what happens on each platform. Following the default device gets its `Deviation:` line: 1.12.1 initialises sound once (`0x7a4330`).

Built on macOS, with Linux and Windows linted.

Fixes #820

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 15:30:35 +07:00
Sam Sung 167ae46802 The script memory limit warns, then quits, as 1.12.1 does (#1782)
The AddOns screen's script memory setting did nothing.

In 1.12.1, `scriptMemory` (KB, default 49152, `0x402e42`) is one limit for the whole Lua state. It is checked each frame in the world by `0x495590`:
- Over the limit, the client does a full collection and counts again (`0x4955d5`).
- Still over, it fires `MEMORY_EXHAUSTED` with the limit in MB (`0x49563d`), so the stock popup shows, and starts a 15 s deadline.
- Still over at the deadline, it quits (`0x495602`).
- Back under, it fires `MEMORY_RECOVERED` (`0x495656`).
- A limit of 0 or less turns the watch off.

benilla now does the same. Its count still uses 64-bit object sizes (#1779), recorded as a deviation.

Tests: the state machine, plus two full stock-UI logins. A 1 MB limit shows the exact popup and freeing memory hides it. The default shows nothing (the stock UI is 13 MB).

Fixes #1081

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:50:32 +07:00
Sam Sung cd46d2ee05 benilla-lua's lexer and compiler behave as the client's Lua 5.0 (#1781)
benilla-lua's lexer and compiler now behave as the client's 5.0:
- A control byte is "invalid control char" (`0x6ffabb`).
- Every chunk lexes as source, binary ones too (`0x6f6a15`).
- Lines end at `\n` alone (`0x6ffb94`); a dot is never a NUL (`0x6ff98a`).
- A `while` condition over 100 instructions is too complex (`0x6fd03b`), counted as 5.0's code generator counts it.
- Upvalues get no name in errors (`0x6fc5e0`).
- `string.dump` refuses closures with upvalues, and dumps the stack top (`0x6f438a`, `0x6f4373`).

The client installs no Lua hook (`lua_sethook` has no caller), so the load's runaway guard has no client mechanism to follow. It is now an abort no `pcall` can catch, recorded as a deviation.

An audit re-derived every commit from the bytes. Each fix fails its test without it.

Fixes #1755
Fixes #1756
Fixes #1757
Fixes #1758
Fixes #1759
Fixes #1767
Fixes #1434
Fixes #1445
Fixes #1777
Fixes #1778

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:38:19 +07:00
Mathih13 772fbacbdc benilla-app: hot reload, an addon profiler and a Lua inspector (dev) (#1256)
Dev builds get three tools, all behind the `dev` feature:
- **Hot reload:** an edited addon `.lua` is swapped into the closures already running, keeping state and event registrations. Edited XML handlers and benilla's own `assets/ui` layer reload too.
- **An addon profiler:** Lua time and heap per addon.
- **A Lua inspector:** tables, frame scripts and upvalues, with scalars editable in place.

benilla-mlua's `unsafe raw_vm` becomes a safe lent `with_vm`.

Ours on the branch:
- the top level is compared off the compile path, in a scratch heap;
- watched files are polled in slices, and each addon's XML is walked once per session;
- no lend while a callback of the state runs;
- profiler owners are cached per source epoch;
- key-ups reach the UI while an egui field has focus.

The player build carries none of it. Tests: the full gate chain on the merged tree.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-17 14:22:47 +07:00
Sam Sung 9ef68a30a7 Workspace tests pass on a Windows checkout's paths and line ends (#1776)
Three tests failed on a Windows checkout:
- one split a source path on `/`;
- one split its own `include_str!` on `"\n}\n"`, which a CRLF checkout lacks;
- one captured a traceback's addon folder with a greedy `.*`.

Each now normalises the separator or line end, or bounds the capture. A sweep found the same path forms in four more source-walking tests (`fire_scan`, `world_api_wall`, `reference_strings` and `front_end`), now normalised too.

`.gitattributes` pins Rust sources to LF and leaves `third_party/kira`'s CRLF files as they are.

Built and tested on macOS. The Windows cases are reasoned from the path and line-ending forms, not run.

Fixes #798

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:54:34 +07:00
Sam Sung 1764e9b063 Every chosen difference from 1.12.1 carries its Deviation: line (#1775)
Seven places where benilla chose to differ from 1.12.1 said so without a `Deviation:` line, so `docs/DEVIATIONS.md` missed them. Each now has its line, with the client address and the reason:
- targeting stays armed after a range failure (`0x6e6089`);
- a kit's first shake reads its node before it is filled (`0x620e0e`);
- screenshots are PNG and can report a failure (`0x4426f0`);
- UnitPVPName of a guid-0 token is nil (`0x517343`);
- an aura's visual holds while any slot keeps the spell (`0x5ff2d2`);
- text input is Unicode, not the ANSI code page (`0x42d185`);
- benilla runs no code a server sends: no patch, no survey and no Warden module (`0x474610`, `0x5bad53`).

The login queue now follows the client: a leading blank line (`0x837230`) and a 32-bit estimate that wraps (`0x46aed3`), with tests. The environment-map comment cites the shader the client picks (`0x71de50`).

Fixes #821
Fixes #1599

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:41:00 +07:00
Sam Sung d5e43dd3e1 Lua's table, bit and error paths behave as the client's 5.0 (#1774)
The table library and `unpack` now run as the client's 5.0 natives (`0x822d40`). benilla's closure layer over them is gone. `unpack` refuses past 2,048 slots (`0x6f2f43`) and reads its table alone. `getn` converts a numeric-string `n` (`0x6f4f80`). `next` says "for" (`0x871aac`).

The bit library answers unsigned except `arshift` and `mod` (`0x7faa6d`). Its folds take every argument, and `math.pow`, `atan2` and `mod` check argument 1 first.

A Rust callback's error now carries the caller's `file:line`, as `luaL_error` does (`0x6f4940`); only the sound verbs raise bare. Error text keeps its bytes, from `assert` to the error handler.

An audit re-derived every commit from the bytes. Each fix fails its test without it.

Fixes #1435
Fixes #1448
Fixes #1449
Fixes #1480
Fixes #1482
Fixes #1483
Fixes #1484
Fixes #1485
Fixes #1760
Fixes #1761
Fixes #1762
Fixes #1763
Fixes #1764
Fixes #1765
Fixes #1766
Fixes #1771

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:26:34 +07:00
Sam Sung 826194e2ac benilla-lua's strings and numbers read and print as the client's (#1773)
benilla-lua's string and number library now answers as the client's:
- `string.byte` returns one byte (`0x7fc210`).
- `gsub` takes only a string or a function (`0x7fd163`), and `%0` raises (`0x7fce20`).
- `lower` and `upper` case-map UTF-8 (`0x7fbeb0`).
- `tonumber` with a base is MSVC's 32-bit `strtoul` (`0x40db09`), on every platform.
- Chunk names cut at a NUL and at `\n` (`0x835144`).
- `string.format` is the client's native one (`0x7fd3d0`): `__ftol` conversions, `%q`'s table, one-digit `n$`, and the client's errors.
- Number text is the MSVC CRT's, ported down to `$I10_OUTPUT`: `1.#INF`, `-1.#IND`, `1e+020`.
- A NaN made from numbers is the x87 indefinite, and the math library returns the runtime's own answers at infinities.

A fuzz against the client's own `sprintf`, run in emulation, matches 1.5M cases. Every fix fails its test without it. `tostring` and `%g` got faster.

Fixes #1367
Fixes #1368
Fixes #1373
Fixes #1375
Fixes #1376
Fixes #1450
Fixes #1481
Fixes #1486
Fixes #1770

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:51:19 +07:00
Sam Sung b3bfae15d8 Cache readers ask at the client's trigger or only read; no timed re-ask (#1772)
In the client, a QueryCache lookup (`0x55ba30`) either passes a callback, which queries on a miss, or passes none, which only reads (`0x55baac`). A refusal frees the key, so the next callback lookup asks again (`0x556f35`). benilla re-asked every miss on a timer, through `get_or_ask`.

Now every reader says how it reads, as `Ask::Read` or `Ask::Event` at the client's trigger. The trigger is a packet, a window show, an item's create (`0x5d8300`) or a getter the stock UI polls. The timer, its `Deviation:` and the duplicate lookups are gone. Key 0 is never asked (`0x55ba42`). A recipe cooldown no longer fires `TRADE_SKILL_UPDATE` each second; the client's senders are only the list rebuild and the filters (`0x4fd164`).

Each reader family has a test: one ask at its trigger, none between, a refused key asked again next. An audit re-derived the core and 29 classifications from the bytes.

Fixes #1714

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:35:19 +07:00
Sam Sung a04df2d17d benilla-lua's VM and compiler behave as the client's Lua 5.0 (#1768)
benilla-lua now matches the client's Lua 5.0 wherever an addon can see the difference:
- Number keys hash as `hashnum` does (`0x6fa260`), so `pairs` walks them in the client's order.
- Calls nest at most 4096 deep (`0x6f61c0`).
- `^` calls the global `__pow` (`0x6f9b5e`).
- The parser's limits and messages are the client's (`0x6ff440`); the client has no assignment limit.
- A numeric for's variable is its counter (`0x6fe380`, `0x6f9262`).
- A generic for uses `forlist`'s layout (`0x6fe540`): the first name is the control, and closures share the variables.
- Only calls name a callee (`0x6fc499`), and a stray token reports `<eof> expected` (`0x871cf4`).

Each fix has a test that fails without it. Two audits re-derived every address from the bytes. The bench is faster or level.

Fixes #1369
Fixes #1370
Fixes #1371
Fixes #1372
Fixes #1374
Fixes #1377
Fixes #1752
Fixes #1753
Fixes #1754

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:07:05 +07:00
Sam Sung a64b6b8a44 A kit's Stand animation plays as in 1.12, with its two driver rules (#1739)
A spell visual kit naming animation 0 (Stand) was read as no animation, so 41 kits lost their play. In 1.12.1 the field is skipped only when negative (`0x60f366 jl`): a state kit naming 0 recomputes the base (`0x60f383`-`0x60f399`) and never pins (`0x5fdeb5 jle`); a cast or impact kit plays it through `0x5fe2f0` (`0x60f3c5`); the holds and the missile release need above 0 (`0x612a0a`, `0x6e8295`).

Playing it needed two driver rules benilla lacked: PlayTrack drops a request for the id a track already asks for (`0x5fdcab`), so a recompute no longer restarts an unchanged gait; and a Stand request over a swing, ready stance or cast is dropped (`0x5feb00`-`0x5feb56`).

Tests: the parse, the recompute without a pin, the holds and release, the dedup, each demotion arm, and Stand ending at its window. Each fails without its part.

Fixes #1719

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:20:08 +07:00
Mathih13 8100fe9820 Run the script host on benilla-lua; remove the vendored C Lua and mlua (#1255)
The script host now runs on benilla-lua alone. The vendored C Lua 5.1.5 (`third_party/lua-src`) and mlua are removed, about 17k lines. `vm_parity` checks benilla-lua against the answers the C build recorded on Linux and macOS, and `front_end` checks every corpus chunk's compiled shape against the C build's digest. `GRAMMAR.md` records each grammar change from 5.1, by client address.

A handler's `this`, `event` and `arg1`… are bound in one VM call. An event fire saves and restores `event`, while the handler runner saves only `this` (`0x704d50`).

Ours on the branch: VM fixes from review (hook dispatch counts, registers and frames around a collection, protected-call handlers, library errors) and `vm_parity`'s two-VM leftovers removed.

Tests: the full gate chain on the merged tree, `vm_parity` and `front_end` among them. Live: smoke and a stock-glue login. Load time is level with C Lua, and memory is within 7%.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-17 08:51:37 +07:00
Sam Sung f5992d0041 A character its font lacks draws nothing, not a box (#1736)
Cyrillic in a chat bubble drew as boxes: Friz Quadrata, the bubble's font, has no Cyrillic, and benilla drew the face's `.notdef` glyph for each missing character. In 1.12.1 the glyph load asks the face's Unicode charmap first (`FT_Get_Char_Index`, `0x7ce960` at `0x5d1159`) and returns with nothing loaded on index 0 (`0x5d1162`); the line builder then draws no quad and adds no advance (`0x5cced6` → `0x5cd280`), and kerning spans the gap (`0x5cd27a`). The charmap is the first record FreeType calls Unicode (`0x5d015d`, `0x81eb70`).

Each face now carries that charmap, and a code point it lacks is an empty cell on every surface. The chat frame keeps Cyrillic, which Arial Narrow carries.

Tests: a missing code point in Friz takes no room and draws nothing; the charmap pick skips (3,10) and takes the first Unicode record. Each fails without the change.

Fixes #832

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 07:11:20 +07:00
Sam Sung 251364dbbf A fading opaque M2 batch fades evenly, not by its texture's alpha (#1735)
A fading opaque M2 batch blended by `texel alpha × fade`, so where its texture carries alpha (helms, shoulders, the Wind Rider's skin, the Blackfathom pots) it thinned or vanished while fading. In 1.12.1 a blend-0 batch takes combine preset 0 (`0x811f8c`), whose alpha op is SELECTARG2 on the current (`0x80a274`; ALPHAARG is never set), and the diffuse alpha is the element alpha (`0x70c73a`, c28.w): the fade alone, blended SRC_ALPHA/INV_SRC_ALPHA (`0x811fe0`).

Each batch now carries its stage-0 combine (a 0x101 model's from its array), and the fade twin applies that preset's alpha op to the fade. Unfaded batches, cutouts and other blends are unchanged.

Tests: the shader's alpha op for presets 0 and 1, the batch's stage-0 combine, its uniform. The shader test fails with the old line.

Fixes #1732

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 07:00:10 +07:00
Sam Sung 5f96e65d94 Two-texture M2 batches draw their env-mapped second stage (#1734)
An M2 batch with two textures drew only its first stage, so Cupid's bow, the two Stratholme maces and the obsidian mining node lost their reflection. In 1.12.1 the element binds one stage per texture (`0x70b740`-`0x70b823`); a version 0x101 model takes each stage's combine from its header array (`0x70b7c2`, `[md+0x148][k]`), else from the blend table `0x811f8c`; a coordinate lookup above 2 generates the view-space reflection (`0x70b8bd`, the same map as stage 0's env path). These five are the only 0x101 models, each stage 1 preset 1, modulate on the default Direct3D device (`0x80a25c`).

benilla-m2 reads the combiners; the second stage is parsed, loaded and multiplied over the lit first stage before fog, with all six presets on D3D's ops.

Tests: the combine source, a synthetic two-texture parse, the obsidian node's stages off the install, the shader's coordinate and presets. Each fails without the change.

Fixes #1722

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 06:30:23 +07:00
Sam Sung 7da1f7e7bc README: any 1.12.1 server runs benilla; Warden is the server's policy (#1733)
The README asked for a server with Warden off, which stopped being true when a Warden request began to be read past (#1717): benilla now plays on a server that sends Warden without enforcing it, and one that enforces it disconnects the session after its own timeout. The requirement now says that.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 06:25:57 +07:00
Sam Sung 0d7c4f06d0 Billing docs name plan bit 3 the Internet Gaming Room (IGR) plan (#1731)
The billing code called plan flag 0x08 an internet-cafe plan. The client's own name for it is IGR (`IGR_BILLING_NAG_DIALOG`), Internet Gaming Room, as benilla-re now says; the docs and one test name follow. No behaviour changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 06:16:18 +07:00
Sam Sung 142ed718d3 The Benilla scroll bar template scrolls its parent itself (#1730)
`BenillaScrollBarTemplate`'s own OnValueChanged was a faux-list handler that both instances replaced with the real scroll, so a new bar that forgot the override wrote `offset`/`updateFunc` on its parent instead of scrolling. The reference's `UIPanelScrollBarTemplate` carries `this:GetParent():SetVerticalScroll(arg1)` itself (`UIPanelTemplates.xml:156-158`).

The template now calls `BenillaScrollBar_OnValueChanged(this, arg1)`; the two instance overrides, the dead faux handler and its header text are gone.

Test: a bare bar from the template scrolls its ScrollFrame parent with no `offset` or `updateFunc` write; it fails with the old template.

Fixes #359

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:40:07 +07:00
Sam Sung f24320c339 Chat filters use the client's word and space classes, not Unicode's (#1729)
The chat and name filters compiled `\<`, `\>` and `\s` with Unicode classes, so a ChatProfanity word right after Cyrillic or CJK letters went unmasked. In 1.12.1 the filters run PCRE in UTF-8 mode without Unicode properties (`0x71fba0`, options `0x2801`); `\<` and `\>` are `\b` (`0x812330`), and `\b` and `\s` read the ctype table at `0x873e80` for characters below 0x100 only (`0x724fc0`, `0x7252b8`). Its word set is ASCII alphanumerics, `_` and 0xC0-0xFF except `× Þ ÷`; its space set is tab, LF, FF, CR, space and NBSP; everything from 0x100 up is neither.

Boundaries now test that word class by look-around, through `fancy-regex` for the rows that have one (`regex` has none); `\s` becomes the client's space class. Caseless matching was already the client's.

Tests: letters above Latin-1 beside a word, every Latin-1 character against the table, the space class. Each fails with the old translation.

Fixes #1056

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:14:31 +07:00
Sam Sung 1c6d4a717e A still unit plays its aura state kit's animation, as Lazy Peons sleep (#1721)
Lazy Peons stood upright under their sleep aura. In 1.12.1 an aura's state kit (kind 2) sets flag 0x1000 (`0x60eecd`) on an effect at the head of the unit's `+0xb4` list (`0x620360`), and every play reaches `0x5fde80` (`0x5feab5`): a still unit (`[+0x9e8] & 0x20000f` clear) plays the first flagged kit's animation above 0 instead of what was asked, on body and mount alike (`0x5fdeee`, `0x5fdf08`). Spell 17743's kit names 71, which OrcMale plays as Sleep.

benilla now keeps those pins per unit, newest slot at the head (`0x604e7b`), and the driver plays the head pin for a still unit's poses, one-shots, jumps and landings, rider and mount both; the clip plays out its window after the aura goes. A still stunned unit now plays Stun, as in 1.12.1.

Tests cover each path; each fails without its part.

Fixes #837

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:49:20 +07:00
Sam Sung 65a9016d36 A server's billing minutes give the 1.12 play-time warning (#1718)
A server that sent BillingTimeRemaining got no warning: benilla dropped the auth response's billing minutes and plan flags. In 1.12.1 the handler (`0x5b41b0`, gate `0x5b41f9`) keeps the group from AUTH_OK or the first AUTH_WAIT_QUEUE; `InitializeGame` arms a deadline at each world entry for 1-4320 minutes on a non-recurring plan (`0x48f636`-`0x48f679`); the game UI's per-frame poller (`0x495679`-`0x495826`) fires `BILLING_NAG_DIALOG` once at 30 minutes or fewer and prints `BILLING_NAG_WARNING` each 5 minutes, then each minute from 5 (`IGR_BILLING_NAG_DIALOG` at 600 for an internet-cafe plan).

The protocol keeps the group across the queue; `ui_billing` transcribes the arm and the poller. `GetBillingTimeRested` was set on the glue VM; it is now seeded into every in-game VM.

Tests: the four vmangos body shapes byte-exact, the queue's group outlasting a bare AUTH_OK, the cadence, the stock popup and chat line, and the arm at entry only.

Fixes #813

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:08:29 +07:00
Sam Sung 52cc825e60 A server's Warden request is read past and the login goes on (#1717)
A server that sent `SMSG_WARDEN_DATA` ended the login at character select with a terminal failure. Servers that send it without enforcing it were unplayable, and vmangos serves the roster and the world entry regardless (no handler gates on Warden; `World.cpp:325-338` starts it after AUTH_OK) and only kicks a silent client after `Warden.ClientResponseDelay` (`Warden.cpp:686-691`).

benilla now reads the message past, answers nothing and goes on; the server's policy decides what follows, and a kick is the ordinary lost link. This is a `Deviation:` at the read: the reference hands the message to its loaded module (`0x6ca2f0`, `0x6ca5c0`) and sends its answer (`0x6ca6a0`). `WardenRequired` and the terminal-failure path it alone used are gone.

Tests: a login past a Warden request reaches the world with nothing sent back; a kick after it is a lost link; the handshake reads one past. Each fails with the old refusal.

Fixes #854

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:33:17 +07:00
Sam Sung 112601c2a9 The loading screen fits its picture inside the window both ways (#1716)
On a window narrower than 4:3 the loading screen ran off both sides: its area was always 133.3vh × 100vh. In 1.12.1 the layer `0x406a60` fits the picture through the viewport (`0x58af60`) from `a = 0.75 × aspect` (`[0x832a4c]`): width 1/a, centred, above 4:3; full width and height a, centred, below it; the whole window at a == 1, which `widescreen` off gives. The bar draws in that viewport's [0,1]; the tip is placed in window pixels (`0x5c70b0`, sizes from `0x5c2b50`), its baseline raised by the letterbox band (`0x4066c6`).

The area is now that rect, refitted each frame, and the tip is laid out in window terms. The live window's aspect stands in for `gxResolution` (a `Deviation:`, as for portraits).

Tests: the rect at 1280×1024, 1920×1080, 4:3 and `widescreen` off, a resize, and the tip in each case. The rect tests fail with the old fit.

Fixes #355

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:22:51 +07:00
Sam Sung 67345f9914 The world map lights and names the continent under the cursor (#1715)
At the world view of the world map, pointing at a continent showed no name and no outline: `UpdateMapHighlight` answered nothing at world level. In 1.12.1 the verb (`0x4a7fa0`) finds the continent whose sheet rect holds the point (`0x4a7620`) and returns its Map.dbc name (`0x4a825b`), its WorldMapArea file, the texture share (`0x4a83b9`: 1 by H/W when wider, else W/H by 1) and the quad from its WorldMapContinent row (`0x4a8407`: W·s/62.625, H·s/41.75, the corner by the builder's sheet law).

`worldmap::world_hover` now builds those eight values, and the catalog carries each continent's WorldMapContinent row. The click's citation moves from the unreached `0x4a7100` to its inline loop `0x4a755a`.

Tests: the eight values for Kalimdor, the Eastern Kingdoms, the sea and a wide continent; and the stock WorldMapFrame over Kalimdor on the install, checking label, texture and quad. Both fail without the change.

Fixes #866

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:46:53 +07:00
Sam Sung a8ad08a391 A refused cache answer is freed, never saved, and asked again (#1713)
A refused query answer (top-bit entry, empty name) was stored as a record, saved to the cache file and never asked again. In 1.12.1 the refusal leg (`0x556e63`, items `0x55bdf7`, objects `0x558927`, names `0x55f6f0`, guilds `0x561390`, quests `0x563150`) runs the callbacks with status 0 and frees the node; the next lookup with a callback (`0x556aa0`) asks again.

Now a refusal frees the record, is never persisted, and redisplays nothing. Unit, object and slot/crest changes look up at once (`0x60b15b`, `0x60463f`, `0x5f7c40`, `0x5ed764`, `0x5e078f`), and a dropped ask is re-sent. Unit-name reads follow `GetUnitName` (`0x609210`): creatures are read from the unit, never asked. Readers that poll every frame wait 30 s after a refusal (a `Deviation:` until they are split). An empty quest title is a refusal.

Tests cover each path; each fails with its change undone.

Fixes #1674
Fixes #393

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:31:20 +07:00
Sam Sung 9e1b3e9ae9 cameraYawSmoothSpeed follows at the stored rate, not the slider's 90-270 (#1712)
`cameraYawSmoothSpeed` was clamped to 90-270 when applied, the Auto-Follow Speed slider's range, so `/console cameraYawSmoothSpeed 360` followed at 270. In 1.12.1 its validator `0x50c000` refuses only outside [0.1, 360] (`0x50b330`, `Value out of range` at `0x50b36c`) and the follow reader takes the stored rate as is (`[0xbe1070]` at `0x512d75`).

The camera now uses the stored value; the registry's existing check, which already matched `0x50b330` and also runs on the config load, does the refusing. `FOLLOW_SPEED_RANGE` is gone.

Test: 270, 360, 0.2 and 30 are stored and applied as given; 360.5, 400, 9000, 0, 0.05 and -30 are vetoed and keep 30. It fails with the clamp put back.

Fixes #323

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:15:58 +07:00
Sam Sung 71321043ff A dead player or ghost cannot use an object; its cursor grays (#1709)
A dead player or ghost could use any GameObject: the cursor stayed lit and a right-click opened a mailbox or walked to a chest. In 1.12.1 `usable` (`0x5f3130`) tests `IsDeadOrGhost` (`0x605f30`, at `0x5f315f`) ahead of its lock and range arms and refuses with error 0x7e, `ERR_PLAYER_DEAD` (`0x5f33c6`); the cursor asks the same slot (`0x5f3093`, `0x5f58a8`, `0x5f6858`) and grays.

`cursor_mode::go_player_refusal` now holds the player arms, dead and the existing mounted gate (`0x5f31a8`), and both the cursor and the click use it: dead grays the cursor and the click raises `ERR_PLAYER_DEAD` with nothing sent. Mounted now also grays a lock-less object's cursor, as the same slot does in 1.12.1.

Test: dead, ghost, mounted and live players at a chest and a mailbox, checking the cursor, the use and the error.

Fixes #830

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:57:41 +07:00
Sam Sung ec97169554 SPELLCAST_STOP fires from the cast result, for every kind of cast (#1704)
`SPELLCAST_STOP` fired only at `SMSG_SPELL_GO` and only for a timed cast, so instants, channels and item uses never sent it to addons.

In 1.12.1 it fires only from the cast result: the handler's pop `0x6e741a` → `0x6e4940` (`0x6e4a4b`) while the pending record's caster word `0xceac50` is the player's, filled by the attempt (`0x6e4fb1`) and cleared when the event fires (`0x6e4a5a`); and `0x6e74cb` for a non-failure result with nothing in flight. The go handler fires none. vmangos sends START, RESULT, GO, so a timed cast's bar still ends at completion.

The attempt now fills the caster word, the result fires STOP as those two sites do, local cancels fire only while the word holds, and the go-time raise is gone. Tests replay each cast kind in vmangos order; a live run logged STOP for an instant, a timed cast, a channel and an item use.

Fixes #1604

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:26:52 +07:00
Sam Sung fd642f79c0 Print screen on the glue screens takes a screenshot (#1673)
Print screen on a glue screen (login, realm list, character select or create) raised a Lua error on a nil `Screenshot` and saved nothing: the stock GlueXML calls it from each screen's `OnKeyDown`, and benilla bound it only in the in-game VM.

1.12.1 binds `Screenshot` in the glue table too (`0x46d3d0`). It arms the same capture (`0x442a10`) and answers with the glue's own events, `GLUE_SCREENSHOT_SUCCEEDED` or `GLUE_SCREENSHOT_FAILED` (`0x46c520`, glue events 14 and 15).

The glue VM now installs the same verb on the same capture ask, and the writer answers with whichever VM is up. Tests cover the glue call arming one capture and the glue events answering it, and the in-game names staying in-game; they fail without the binding.

Fixes #1649

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 00:34:52 +07:00
Sam Sung cda3a91f7b Instances built as one WMO take their zone from Map.dbc (#1670)
In the 17 instances built as one WMO (Wailing Caverns, Blackrock Depths, Molten Core, Dire Maul, the Deeprun Tram and others) benilla had no area: entering by portal kept the outside zone, no `ZONE_CHANGED_NEW_AREA` fired, and logging in inside left the zone texts empty.

On a map whose WDT carries MPHD bit 0 (`0x694904`), 1.12.1's area query `0x6703a0` answers the map's `Map.dbc` field 19 for every entity, ahead of any WMO or terrain read; a 0 there fails the query.

`MapCatalog` now reads field 19, the WDT exposes the bit, and `update_current_area` takes that leg first on such a map. A worldport also drops the old map's held area, which otherwise survived the transfer. Tests cover the leg, the flag's map, a zero field and the worldport; a live portal into Wailing Caverns fired `ZONE_CHANGED_NEW_AREA` with "Wailing Caverns".

Fixes #1636

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 00:14:47 +07:00
Sam Sung 87f3b24f68 A refused shot no longer chains Auto Shot (#1638)
A hunter shot the server refused (out of range, line of sight) still sent `CMSG_CAST_SPELL` for Auto Shot: `cast_result` chained `modalNextSpell` on any result whose spell was in flight.

In 1.12.1 a failure's report pops the in-flight slot (`0x6e2201` → `0x6e2218` → `0x6e4ad0(0, 0)`), so the handler's compare at `0x6e7408` misses and the chain at `0x6e74aa` is skipped. It still chains when the report leaves before that pop (reason 0x17; 0x56 with no named form; an uncached 0x5c or 0x78 item, `0x6e1eab`) or when the save held the same spell.

`cast_result` now reads the slot pair up front and chains a failure only in those cases. The test that asserted a failed sting chains is flipped, and each remaining case has its own assertion; each fails with its rule undone.

Fixes #1594

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 23:44:52 +07:00
Sam Sung 6f65310783 A boot with no readable WoW install is fatal, with an error dialog (#1630)
With no WoW install found, or a `Data` folder whose archives will not open, benilla booted into a window of textless buttons, since fonts, art and the stock interface all come from the install.

It now ends before any window exists. A native error dialog (`rfd`: AppKit, Win32, `zenity` on Linux) names every folder searched, or the folder and the archive error, and says where to put the install; then it exits 1. An unattended run prints the same text to stderr and exits without a dialog.

1.12.1 ends at a fatal dialog for a present but corrupt base archive (`0x403b6f`) and only logs a missing one (`0x403b00`); ending at no install at all is recorded as a `Deviation:`.

Tests cover both messages and the failing exit; both cases were run live unattended. Built on macOS, Linux and Windows.

Fixes #836

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:14:14 +07:00
Sam Sung f438c19f9a Quest item toasts come from their packet, not from bag-count changes (#1606)
Splitting a quest item's stack could flash its objective line ("Wolf Pelt: 4/5"). The toast rode a per-frame diff of the bag count, and a split dips it for a frame: vmangos sends the shrunk source and the new stack's create at once, and the slot naming the new stack later, in the batched update (`Player.cpp:11100`, `10316`–`10327`).

1.12.1 toasts an item objective only from `SMSG_QUESTUPDATE_ADD_ITEM` (`0x5e5ad0`, case 0x19a). It walks the log to the first quest needing the item, and `0x5dd060` shows `ERR_QUEST_ADD_ITEM_SII` with min(held + added, need), then `QUEST_WATCH_UPDATE`. An uncached quest record defers the pair to its arrival (`0x5dd180`).

Item lines now toast from that packet alone; kill and complete toasts are unchanged. Tests replay a split's update sequence (no toast) and a pickup (one toast); both fail without the change.

Fixes #916

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:53:18 +07:00
Sam Sung 7063549659 Character select notices a server that drops the link (#1563)
At character select the IO thread waited only on the app's requests, so a server that dropped the link (vmangos kicks a session idle there after `CharacterScreenMaxIdleTime`) went unnoticed until Enter World started a load.

1.12.1 keeps servicing the connection on that screen, and a drop runs `CGlueMgr::NetDisconnectHandler` (`0x46c540`): `DISCONNECTED_FROM_SERVER` and back to login.

The park now looks at the socket twice a second without blocking. A closed link ends the session as a failed roster ask does; a packet sent unasked is read and handled as `char_enum` handles its strays, in one shared step.

A fake-server test drops the link while the client is parked with no request pending and expects the session lost; it times out without the change.

Fixes #1020

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:04:18 +07:00
Sam Sung 91803130c6 Item tooltips rebuild in place when a cache they asked answers (#1515)
A shown item tooltip whose line waited on a cache kept missing that line until something re-ran `OnEnter`. Examples are a lock's key, a "made by" name and a set member. Bags re-run it every frame; trade slots, `ItemRefTooltip` and addon tooltips never do.

1.12.1 registers `CGTooltip::OnCacheAnswer` (`0x52e530`) on every record, name, petition and item-name miss, with the tooltip as cookie. On each answer it rebuilds from the inputs the last build kept (`0x52b6cc`–`0x52b70a`), reading the live object, and sizes the plate (`0x52e5ac`). A clear zeroes the kept entry (`0x5300dd`), so a cleared tooltip stays down.

Every item `Set*` now goes through one build that keeps its inputs and records its misses. Each answer rebuilds whatever the tooltip keeps by then; compare asks stack and builder asks deduplicate, as in the reference.

Tests cover each cache and a cleared tooltip.

Fixes #1452

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:21:02 +07:00
Sam Sung d8720510be A worktree with its own probe account keeps its own state folder (#1489)
A dev build maps a linked worktree's `benilla-config/` to the main checkout's, so a developer's worktrees share one settings folder. That included a worktree that declares its own account in `.probe-identity`: an attended run from it, or a scripted one without `WOW_UNATTENDED`, read and wrote the main checkout's CVars, bindings, macros and saved variables while logged in as another account. A branch with a wrong settings migration or scripted key presses changed the player's own client, with nothing to show it.

`local_state::shared_root` now keeps such a worktree's state in its own `benilla-config/`. A worktree without `.probe-identity`, and the main checkout, resolve as before. CONTRIBUTING and `.gitignore` say so.

Test: `the_state_root_is_the_folder_or_its_primary_checkout` adds a worktree with a `.probe-identity`, which keeps its own root, and a main checkout with one, which is unchanged; it fails without the change. `the_state_folder_lands_where_the_build_says` follows the rule.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:26:14 +07:00
Sam Sung 7158cd1e14 XML font= with no positive FontHeight warns and sets no font (#1488)
An XML `font=` naming a file with no `<FontHeight>` still got that font at a default height.

`CSimpleFontString::LoadXML` (`0x770f40`) reads `FontHeight` and refuses a height that is not above 0 (`0x771146`–`0x771154`). It warns `FontString %s: Missing font height in %s element` (`0x878e10`) and returns at `0x771191`, setting no font. SimpleHTML's element fonts go through `CSimpleFont::LoadXML`, which has the same check (`0x783d6d`, `0x87a4f0`).

Both loaders now refuse a missing, zero or negative height with the reference's warning and set no font or outline, so `SetText` on such a string raises "Font not set". None of the 219 corpus addons trips it.

Tests: absent, 0 and negative heights, the ButtonText message, and a SimpleHTML element; all fail without the fix.

Fixes #1469

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:19:02 +07:00
Sam Sung c50db9bfc0 A player-clippy gate lints the shipped player build (#1471)
No gate built the shipped player graph outside tests. The player-tests gate compiles with `cfg(test)`, and clippy ran only on the dev feature set, so the player build's own warnings landed unseen: four unused re-exports that only dev probes used.

A new `player-clippy` gate runs `cargo clippy -p benilla -p benilla-app --no-default-features -- -D warnings` in `scripts/gates.sh`, in CI, and in `scripts/check.sh` when it reaches those crates. `docs/METHOD.md` names it.

The four re-exports are deleted: `ground_derived`, `GroundClamped`, `BodyPartsDesc` and `ATTACH_SLOT_NAMES`. Their dev users import them from the defining modules, with no `allow` left.

Test: an unused import added to `net.rs` fails the new gate.

Fixes #1465

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:03:00 +07:00
Sam Sung 5d577c277c A FontString with no font raises on SetText, measures 0, draws nothing (#1470)
A FontString with no font took Friz Quadrata at size 12, so it took text, measured and drew where 1.12.1 has none.

In 1.12.1, `SetText` is the only FontString method that checks the font (`0x79d760`): with none it raises `%s:SetText(): Font not set` and sets nothing. The width and height measure only with a font (`0x7728b6`, `0x7729d4`), and the string builds and draws only with one (`0x7724f8`, `0x772e5b`). A string gets a font only from `inherits` or `font=`, never from its parent.

benilla now models "no font" as its own state: `SetText` raises, the measures answer 0, and nothing draws. XML `text=` is stored without the check, as `0x77103a` does. `<ButtonText>` now reads its own `inherits=` and `font=`.

Tests: a bare string raises, measures 0 and draws nothing. Across 219 addons and 4,168 stock FontStrings, nothing new raises.

Fixes #1461

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:53:01 +07:00
Sam Sung c87e26ad3f Addon-harness tests link the corpus in a way that builds on Windows (#1468)
Two addon-harness tests called `std::os::unix::fs::symlink` with no gate, so benilla-app's test target did not compile on Windows. That stopped clippy `--all-targets` and every benilla-app test there.

A small test helper, `addon_harness::test_support::link_dir`, links a folder with `symlink` on unix and `symlink_dir` on Windows, copying when the link is refused. Both tests use it. No other unix-only call sits outside a `cfg` gate.

Test: `cargo check --workspace --tests --target x86_64-pc-windows-gnu` is clean, and fails at the old call site. Built on macOS; Windows compile-checked, not run.

Fixes #1463

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:35:44 +07:00
Sam Sung 43dfb27a7a GlobalStrings reads no longer hold the UI model borrow (#1467)
Several script verbs read a GlobalStrings text with `lua.globals().get` while holding the UI model's borrow. An addon's `_G` `__index` that called the UI there panicked the client: the ready check, `GetFactionInfo`'s headers, `SetTalent` and `GetTradeSkillInvSlots`.

1.12.1 reads these through `0x703bf0`, a `lua_gettable` on the globals (`0x704373`), so `__index` runs. Its ready-check worker disarms (`0x4bb377`), reads `RAID_MEMBERS_AFK` (`0x4bb381`), and reads `READY_CHECK_NO_AFK` too when no name is pending (`0x4bb48e`).

Each read now runs with no model borrow, and the model is borrowed again after. The ready check reads both strings in the reference's order.

Tests: an `__index` that calls `CreateFrame`, for each verb and each ready-check path. Each panics without the fix.

Fixes #1460

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:15:02 +07:00
Sam Sung c0fa656181 The native glue screens are gone; instruments press the stock screens (#1466)
The stock 1.12 glue screens are now the only glue screens, so benilla's native login, realm list, character select and create screens are deleted (−17k lines). So are the native switch, its census tests, the art-extent module and its extract command.

What still drove the native screens now presses the stock ones through their own Lua verbs (`capture/glue_press.rs`):
- the rig;
- `WOW_PROBE_CHARCREATE`;
- the `glue-login`, `glue-charcreate` and `glue-realmlist` captures.

The three world-entry tests run on the glue VM. The schedule's ambiguity ceiling drops from 3939 to 3348.

Live: smoke, a glue round trip, a stock pick, a rig teleport, a create and delete, all three captures, and the player build's boot.

Fixes #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:56:52 +07:00
badmagick329 129b3bb852 GetTradeSkillNumMade answers 1, 1 on a header or past the rows (#1459)
`GetTradeSkillNumMade` answered 0, 0 for a header row or an index past the rows.

1.12.1's `GetTradeSkillNumMade` (`0x4fdc50`) sends a bad index, a header (spell -1, `0x4fdcaa`) and a missing spell record to the fallback at `0x4fdd13`, which pushes 1 twice. A recipe with no spell record never becomes a row in benilla, so the past-the-rows case covers it.

The miss now answers 1, 1. Tests: the header, no-window and past-the-rows cases pin 1, 1.

Fixes #1262

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:25:22 +07:00
Sam Sung baf729cee6 Nameplates read NAMEPLATE_FONT when built, as 1.12.1 does (#1464)
Nameplates took a fixed Friz Quadrata path whatever `NAMEPLATE_FONT` held, so an addon or a localized GlobalStrings could not restyle them.

1.12.1's plate constructor reads the global for each FontString it builds: the name at `0x7cb3f9` and the level at `0x7cb49b`. The read is `lua_gettable` on the globals, so `__index` runs (`0x704373`). A number reads as its text; anything else, or a missing global, gives "". `SetFont` refuses "" (`0x44d05c`) and leaves the string with no font.

Plates and chat bubbles now read the global through one lookup, when each is built. The read happens before the UI model is borrowed: an addon's `_G` `__index` that touched the model panicked the bubble's read.

Tests: a plate built after the global is set takes it, an older plate keeps its own font, the non-string cases, and an `__index` that calls `CreateFrame`.

Fixes #921

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:17:27 +07:00
Sam Sung d404e4e9e4 The stock glue screens are the default; native ones are dev-only (#1462)
The stock 1.12 GlueXML screens are now the default in every build: login, realm list, character select and create. benilla's native screens run only in a dev build with `WOW_GLUE_NATIVE=1`, or under the rig and capture runs, which still drive them, until the native screens are deleted. `WOW_GLUE_STOCK` is gone.

On the way:
- An unattended reconnect re-dials the kept realm and lists the roster. Under the stock screens it stalled at the realm list.
- `WOW_CHARSELECT_PICK` selects on the stock screen.
- `smoke.sh` counts the stock run's VMs and fonts.

The stock screens fix the native screens' defects listed below.

Tests cover the switch, the pick and the reconnect. Live: smoke, a kick and re-entry, the player build's boot.

Part of #856.

Fixes #849
Fixes #850
Fixes #834
Fixes #812
Fixes #360
Fixes #463
Fixes #79
Fixes #977

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:03:33 +07:00
Sam Sung a9c2672b3f A fifth loot roll waits for a frame and opens when one closes (#1458)
A fifth open loot roll was announced at once. The stock frames hold four, so its frame never opened and it could not be voted.

1.12.1 starts a roll through `0x61b430`: below four open it counts up and fires `START_LOOT_ROLL` with the wire countdown. Otherwise it defers the roll. Every close (own vote, WON, ALL_PASSED) fires `CANCEL_LOOT_ROLL` and then promotes the oldest deferred roll (`0x61b760`). An uncached item takes its turn when its record arrives (`0x61b460`).

benilla now does the same. Each roll waits, defers, starts or is open; at most four are open, and every close promotes oldest first. The client's server-close paths decrement the count even for a deferred roll that never counted (`0x61b6f8`, `0x61bc17`), so a fifth frame can open there. benilla keeps the count exact, as a `Deviation:`.

Tests: five announce four; each close path promotes; the wire countdown; a deferred close.

Fixes #1061

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:28:24 +07:00
Mathih13 d6655d8c10 benilla-lua: benilla's own 1.12 Lua VM, opt-in behind benilla-vm (#1254)
benilla-lua is a Lua 5.1.5 interpreter in Rust that speaks the 1.12.1 client's grammar. It is opt-in behind the `benilla-vm` feature, with `benilla-mlua`, the slice of mlua that benilla-ui uses, over it. The C build stays the default. Its front end ports 5.1.5's `lparser.c` and `lcode.c`, so registers, limits and messages match the C build's.

Our finish on top:
- the collector counts growth as C does, off the write path;
- frames under a leaky generic `for` start nil, as `luaD_precall`;
- the budget hook counts what C dispatches, and costs nothing when unset;
- `__index` chains stop at 100;
- mlua 0.11's conversions;
- `vm_parity` answers recorded per platform.

Tests: `vm_parity` on both VMs; the front-end corpus (8,543 chunks) against `string.dump`; 7,613 app and UI tests on benilla-lua. Built on macOS; Linux by CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-16 16:16:09 +07:00
Sam Sung 2d22328bac A schedule census keeps every self-reading system after the self tag (#1457)
Under #918, a system that read our own player ran before the player was tagged `SelfPlayer`. It returned early and used up its change ticks, so it lost every change that frame for good. Nothing in the schedule stopped that shape.

A schedule census now reads each system's access set. Any system that reads `SelfPlayer` or filters on it must be reachable from `tag_self_player`, or carry a row in `UNORDERED_AFTER_THE_SELF_TAG` with its reason. Of 153 such systems, 142 are ordered and 11 are argued: each returns early with no self and holds no change-tick state. The census also fails on a stale row.

Test: with `quest_markers`' `.after(WorldStage::Net)` removed, it fails naming `query_statuses`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:53:13 +07:00
Sam Sung 247ae3e631 Nothing of the native glue screens runs under the stock screens (#1456)
With `WOW_GLUE_STOCK=1`, character select, realm list, create and the glue strings still ran native systems. They spawned hidden trees and could write the hidden `GlueDialog`. A refused scripted login showed nothing on the stock screens.

Every native glue system is now gated on `native_glue`. The cross-switch instruments (round trip, login shot, realm smoke) move into `glue_session`. Under stock, `WOW_CHAR` enters by the stock Enter World. The account guard's refusal opens the stock `OKAY` dialog, the path `CGlueMgr::Login` takes for an empty account (`0x46b090`). The schedule's ambiguity ceilings drop to 3939 and 372.

Test: a census fails on any system that touches the native screens' components or resources without the gate; it lists 44 on main. Live: native smoke, a stock login to create and back, a stock logout round trip, the stock realm smoke, and a guard refusal.

Part of #856.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:43:55 +07:00
Sam Sung d1fa9bdedf Quest givers streamed in before our own tag are still asked their status (#1455)
After login, quest givers showed no mark and could not be talked to until a quest update or a GM toggle.

1.12.1 asks a giver's status at every create (`0x5fba72`, `0x607380`) and when a released object comes back (`0x5fbe2f`). The right-click takes the quest service only with a cached status (`0x5df490`), so the missing mark and the failed interaction are one defect.

`query_statuses` ran before our own entity was tagged `SelfPlayer`, returned early and used up every change, so no giver was ever asked. A relog brought givers back under stale guid keys. Now:
- the ask key lives on each creature (`AskKey`);
- a new self resets it;
- the markers run after `WorldStage::Net`.

Test: givers spawned a frame before the tag are asked on entry and on relog. Live: 0 queries before; 11 asked and answered on each login after, and on a teleport and back.

Fixes #918

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:33:02 +07:00
Sam Sung bc52e8a7f4 Item tooltips show the lock's key or skill line and a gift's giver (#1454)
Item tooltips lacked the lock's sub-line and a wrapped gift's giver.

The reference: the lock check (`0x52bd57`) takes the Lock row's slots in place. The first slot picks the arm: a key names its item in white (`0x52bf30`), and a skill names the LockType and the required value, coloured by the walk at `0x5da5e0`. A blank LockType name prints blank; only a missing row reads `UNKNOWN` (`0x52bede`). A wrapped item (flag `0x8`) prints `ITEM_WRAPPED_BY` with `GIFTCREATOR`, from the object or, for the trade partner's slots, from the block (`0x534559`, `0x534574`). Real lockboxes use locks whose first slot is empty, so they show no sub-line, as in 1.12.

The rows keep all eight slots, and both trade sides carry the wrapped word and the giver. Tests cover each arm, a blank name, and gifts in bags and trade.

Fixes #1440
Fixes #1441

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:26:56 +07:00
Sam Sung 9ff8f6aff4 The login engine moves into glue_session; native login shows its notices (#1451)
Under `WOW_GLUE_STOCK=1` the login engine still wrote the hidden native `GlueDialog`: `drive_policy`, `to_select_on_roster`, `tick_login_caret`, `answer_dialog` and `exit_login` all ran ungated.

The engine moves to `glue_session/login.rs` (intent, attempts, the env fast path, the account guard, resubmit, quit) and tells a screen what it decided as a `LoginNotice`. The native login screen's `show_login_notices` turns each notice into its dialog, in the slot `drive_policy` held. `LoginPlugin` is now native-only, and the stock manager's frame moves into `UiScriptPlugin` with its ordering kept. `login/queue.rs` becomes `glue_session/queue.rs`.

Test: a schedule census fails on any login or glue-session system that writes `GlueDialog` without the native gate; it names the five above on main. Policy tests now assert notices. Live: native smoke, stock login, stock logout round trip, and a wrong password on both paths.

Part of #856.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:04:59 +07:00
Sam Sung ff3dbc9416 Worn items answer their cooldown; a spent charged item drops it (#1447)
`GetInventoryItemCooldown` answered `(0, 0, 1)` for every slot, so worn trinkets had no cooldown spiral. A charged item at 0 charges kept its cooldown.

In 1.12.1, `0x4c8a60` answers the item cooldown query (`0x6e2ed0`) for the active player's slot. It needs a use spell in the template's first block (`0x4c8b47`) and a charge left on a charged template (`0x4c8b55`). Anything else answers `(0, 0, 0)`. `SetBagItem` and `SetInventoryItem` take the plain leg for a spent charged item (`0x5347e3`, `0x53318a`), as does `GetContainerItemCooldown` (`0x4f9a48`).

Now the verb answers from the worn slot's cooldown under those gates. The slot feeds read `ITEM_FIELD_SPELL_CHARGES[0]`, and a held item with no use spell answers enable 0, as the query leaves it.

Tests: the verb's gates and errors, the spent-charge rule over five cases, and the container triple.

Fixes #1439
Fixes #1442

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:20:24 +07:00
Sam Sung 902e170a18 The roster, the pick and the session edges move into glue_session (#1446)
The character roster, the pick, `lastCharacterIndex` and the session edges (logout, connect, refused login, disconnect) lived in the native character-select screen's module, mixed with its UI. They now live in `glue_session`, ungated, so the stock screens own them. The native screen keeps only its UI and the refused-login dialog.

The logout smoke under the stock screens re-entered by sending the pick straight to the server, skipping `CGlueMgr::EnterWorld` (`0x46b500`): no state 8, no `lastCharacterIndex` save. It now selects the row and presses Enter World, as a player does.

Second step toward the stock screens as the default.

Tests: the refused-login dialog opens only off the stock screens; the smoke's stock re-entry goes through Enter World.

Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:10:33 +07:00
Sam Sung 8a545a6682 Tooltips colour Locked by the lock check and show Cooldown remaining (#1444)
An item tooltip's Locked line was always red, and no tooltip drew "Cooldown remaining".

- In 1.12.1, the lock check `0x5da5e0` colours Locked (`0x52bdde`): red when nothing opens it, the skill ramp `0x529fa0` for a known open-lock spell, green for a held key or an empty lock. benilla now feeds Lock.dbc and the player's openers and runs the same check.
- The spell builder draws the line when its recovery is at least a minute (`0x52f537`). The item builder draws it with no floor (`0x52e0fd`) for `SetBagItem`, `SetInventoryItem` and the `SetAction` item leg, which are the three setters that pass a cooldown. Worn items now carry theirs, and the line counts down while hovered.

Tests: each colour and ramp edge, the unit and rounding, the spell floor, and the line order.

Fixes #1024
Fixes #1017

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 12:40:37 +07:00
Sam Sung 951f9fc465 Glue session state serves both screen paths; scripted runs pick a realm (#1443)
Under the stock glue screens a scripted run ignored `WOW_REALM` and parked at the realm list, because the realm policy lived in the native screen's module and ran only under `native_glue`.

The realm tables and the run-mode realm choice now live in `glue_session`, which serves both paths. The stock manager's connect dials the realm already chosen, then `WOW_REALM`, then `realmName` (`0x5ab6f0`), then the unattended pick. A run-mode pick sets `realmName` (`0x5ab7b0`) and the chosen cell (`0x46f1d1`), as a selection does. A player's run is unchanged and still gets the list or the wizard. `ClientState` moves out of `char_select` into `client_state`.

This is the first step toward the stock screens as the default.

Tests: the connect ladder; a scripted run with no `realmName` reaches character select over the fake realmd.

Fixes #1433
Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 12:22:39 +07:00
Sam Sung 5d19a7be22 Stock glue: raw realm preferences, queue countdown, empty-roster smokes (#1438)
Three defects in the stock glue path.

- `SetPreferredInfo` turned pvp and rp into booleans. 1.12.1 reads them as integers (`0x6f1c10` returns a number unchanged) and compares them raw with each realm's 0 or 1 (`0x46ea20`), so a 2 matches nothing.
- The queue's "Estimated time" climbed while queued. `0x46ae50` stores an estimate per packet, only when the position moved forward against the oldest sample (`0xb41df0`), and the dialog counts down from it (`0x46bcb8`). Now it does the same.
- The realm walk and the glue round-trip took an empty roster for "not at character select". Both now key on the roster arriving, time out, and run under the stock screens.

Tests: raw integer compares, the countdown and its keep rule, empty-roster arrival and the timeouts.

Fixes #1315
Fixes #1312
Fixes #458

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:16:25 +07:00
Sam Sung c7b4898bd9 Buff anchors and the minimap mask follow 1.12.1's load order (#1432)
Two pieces of stock UI state were set at the wrong point of the load.

- The buff rows were repositioned right after the manifest loaded, before any addon. In 1.12.1 `CGGameUI::Initialize` loads FrameXML, then the addons (`0x4900a3`), then the saved variables and `VARIABLES_LOADED` (`0x4900b2`), whose stock `UIOptionsFrame.lua` arm runs `BuffButtons_UpdatePositions`. The early pass is gone, so addons load against `BuffFrame.xml`'s anchors.
- An addon's minimap mask survived a relog. 1.12.1 reloads `Textures\MinimapMask` (`0x4ed810`) only from `InitializeGame` (`0x48f590`) at world entry, and `ReloadUI` (`0x48fbf0`) keeps it. World entry now restores the default; a reload keeps the addon's.

Tests: an addon sees the XML anchor at file scope and in `ADDON_LOADED`; a relog restores the mask; a reload keeps it.

Fixes #314
Fixes #695

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:46:27 +07:00
Sam Sung 4a76d48fd9 Two UI tests read the files and frames they claim to check (#1431)
Two UI tests passed without checking what they claim.

- `every_global_a_migrated_window_calls_is_answered` read each window's entry and its same-name `.lua` only. A chain file can load Lua under another name (`ActionBarFrame.xml` loads `ActionButton.lua`) and include templates. Its locals scan also took `F` in `local a = F(x)` for a local. It now reads every `<Script file=>` and `<Include file=>`, as the loader does. The hand-run `shadowed_reference_functions` follows the same files.
- `no_bottom_band_frame_overlaps_a_raised_bar` checked bag frames no file defines, and its pair floor passed on the chat frame alone. It now opens the stock `ContainerFrame1`-`5`, and every tenant must meet every raisable bar.

Bite: a global missing from `ActionButton.lua` or an included template fails the first test; bags that do not reseat on a raise fail the second.

Fixes #311
Fixes #312

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:36:19 +07:00
Sam Sung 2027a7057e EditBox caret, Ctrl editing letters and word rule follow 1.12.1 (#1430)
The in-game EditBox caret was a 1-pixel white bar, the PC keymap lacked 1.12.1's Ctrl editing letters, and a word was an alphanumeric run.

In 1.12.1 the caret is 4 script units wide (`0x77ba2d`, the `SetWidth` scale) in the box's text colour (`0x77e2a0`). `0x77b160` binds Ctrl+B/F/D/W/U/K/P/N beside A/C/X/V (tables `0x77b6cc`, `0x77b69c`), and tests Shift before Ctrl on Delete, so Ctrl+Shift+Delete cuts. A word is a run of non-spaces (`_iswspace`, `0x77c3f0`, `0x77c7a0`), so Ctrl+Right ends at the next word's start.

Now the caret, the chords and the word rule follow the reference. Ctrl is its own key on the Mac, so it takes the same letters and word deletes there. The Cmd and Option chords are unchanged.

Tests: caret width and colour, each chord's edit, the word rule.

Fixes #183
Fixes #749

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:03:50 +07:00
Sam Sung 03e4ba5e0c Record the unstreamed-creature guid read as a deviation (#1428)
A creature not in view is named by the entry in its guid. 1.12.1's combat-log namer reads guid bits 32-47 for it (`0x6265c4`–`0x6265e0`). The servers in use put the entry at bits 24-47, so the client's read would name every such creature wrongly. benilla reads bits 24-47; this records that as a deviation, so `docs/DEVIATIONS.md` lists it. Comment only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:51:49 +07:00
Sam Sung 106e7280d9 A texture's wrap is fixed when its file loads, not read from its UVs (#1427)
Taxi route lines drew tiled copies beside each line. benilla chose repeat or clamp from a texture's current UVs. Lua-set textures with UVs past [0,1] tiled.

In 1.12.1 the wrap is fixed when the file loads (`0x770200`, both axes, sampler table `0x80a254`: clamp or wrap). An XML `<Texture>` passes 1 only when its own `<TexCoords>` leave [0,1] (`0x76fe20`, each template level with its own flag). Lua `SetTexture` passes 0 (`0x79bda5`). `SetTexCoord` never changes it. A backdrop's background follows `tile`, its sides wrap, its corners clamp. A same-file call keeps the loaded texture (`0x770225`).

Now each texture carries its load-time flag and the sampler follows it. Route lines draw as one line. The stance bar's middle strip clamps, as its XML loads it.

Tests: the Lua, XML, template, same-file and backdrop flags, and the sampler pick.

Fixes #870

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:42:00 +07:00
Sam Sung caccf1be64 Stock glue: live scene after the world, reloadUI rebuilds, header width (#1426)
Three defects on the stock glue screens.

- After a trip into the world the login or character scene came back black or frozen. The glue booth resizes its image in place, which gives Bevy a new GPU texture, but the UI pass's cached material kept the old one. Materials over a modified image are now re-prepared.
- `reloadUI` and a resolution change did nothing at the login screens. In 1.12.1 they set a flag (`0x4035f0`, `0x46abe0`, which reads `gxResolution`) that rebuilds the glue when idle and signals the current screen again (`0x46b930`, `0x46b840`). Now they do the same; a window drag does not.
- The agreement header measured its title as 0, because the glyph cache was built after the first glue screen. It is built first now.

Tests: the material re-prepare, the rebuild and its trigger, the startup order.

Fixes #1147
Fixes #1313
Part of #1002

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:26:11 +07:00
Sam Sung 740bd27a0a The wheel walks the wheel list once, and the world takes what is left (#1422)
The wheel did nothing over action buttons, unit frames or the minimap. benilla gave the notch to the topmost wheel frame or its parents, and zoomed only off the UI. A sideways scroll also reset the idle timer.

In 1.12.1, `0x7664f0` walks the wheel list under the cursor, strata then level then age, and the first visible frame with `OnMouseWheel` consumes it (`0x76c180`). The world frame's slot runs the zoom binding (`0x483d20`), and an unbound chord passes the notch on. Only `WM_MOUSEWHEEL` stamps idle (`0x76651f`).

Now the wheel walks once, and the world takes what is left. Scroll frames are no longer born wheel-enabled (`0x786a40`). On macOS a Shift+wheel, which the system turns sideways, counts as vertical again.

Tests: no-handler frames reach the zoom, handlers consume, off-cursor parents get nothing, a sideways scroll leaves idle alone.

Fixes #176
Fixes #224

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 08:47:07 +07:00
Sam Sung 83bbf55db3 Objects are read by their descriptor's entry, and three fork-found fixes (#1421)
Three defects a fork found.

- A worn item the server answers as unknown left the player unattached. 1.12.1 holds the player while a query is out (`0x5ed771`, `0x5ec8f0`) and releases it on a refusal without applying the item (`0x55bdf5`). Now the slot stays bare.
- Templates and names were read by the guid's entry bits. 1.12.1 asks the GameObject cache by the descriptor's `OBJECT_FIELD_ENTRY` (`0x5f7d77`) and keys a creature's record by it too (`0x604629`, `0x60b151`). Every reader of a streamed object now goes through its descriptor; guid bits are left only for a guid not in view.
- A negative aura duration read as 49 days. The span is signed: below zero is lapsed (`0x4e4472`), except `i32::MIN`, which reads as 2^31 ms, as the client's wrapped compare does.

Tests: readers keyed by a field entry unlike the guid bits; the refusal; the signed span.

Fixes #1402
Fixes #1404
Fixes #1405

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 08:12:37 +07:00
Sam Sung eb6bb9d950 Unit events fire from field watches and packets, not a per-frame diff (#1415)
Unit events fired from a per-frame diff of each token's values: a new target re-fired its events, a roster packet fired member events, a `targettarget` token appeared, and cost-modifier changes fired no UNIT_MANA.

In 1.12.1 they come from field watchers (`0x51bbb0`, `0x5e2510`, `0x5dd8a0`) and the flag callbacks `0x5ee990` and `0x5ff580`, signalled per values block through `0x515e50`, and from party records compared on member stats (`0x5f0b80`).

Now every unit event fires from a field-watch notice or its packet. That covers health, power, flags, auras, rest, PvP, play time, regen, pet attack, the pet bar and the guild tag. Name answers signal only on a cache miss. The per-frame fires are gone.

Tests: each arm's notice and order, and no-fire tests that fail on the old feeds.

Fixes #1389
Fixes #1390
Fixes #1393
Fixes #1394
Fixes #713

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 07:38:50 +07:00
Sam Sung 330b297606 The loose-file index lists only the folders a lookup reaches (#1413)
**What was wrong.** The loose-file index walked every folder below the install on the first open. The walk followed links and blocked the frame. A large tree under the install, such as a Wine prefix whose `z:` links `/`, left the window empty while memory climbed (6.6M keys, about 4 GB).

**Reference.** The walk at `0x646ea0`/`0x646910` follows links and keeps no record of visited folders.

**What changed.**
- A lookup lists only the folders along its name, each once, and caches answers until the index empties.
- Keys and skip rules are unchanged.
- A folder reached through a link now answers, as the reference's does.
- Listing on first reach is recorded as a deviation.

**Tests.** Lookups match a full walk over 1.9M probed keys. The prefix install lists 8 folders, down from 207, and reaches the menu in 0.77 s.

Fixes #1398

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 07:22:06 +07:00
hashed-person 5c19844682 README: any 1.12.1 client locale reads its own text (#1387)
The README still asked for an English client. Since #1360, benilla reads the client's locale from `Wow.ini` and shows each game-data string in that language, so any 1.12.1 client works. The line now says so, and notes that development runs on English clients.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-16 06:38:26 +07:00
migwynkriid 7923d67abb A new nameplate draws its first WORLD batch in the frame it's built (#1341)
**What was wrong.** A nameplate created during a frame drew one frame late.

**Reference.** The plate update (`0x764340`) draws at `0x764347`. Building a plate (`0x765896`) drains its batch records at `0x7658e2`. The world render runs inside the WORLD callback (`0x482d70`). So a new plate's first WORLD batch draws in the frame it was made.

**Change.** The first WORLD batch boundary is kept for a new plate. A plate released and retaken in the same sync keeps its batch records (`0x772fd0`).

**Tests.**
- `a_slot_retired_and_retaken_in_one_sync_draws_at_once`.
- The contributor's first-draw tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-16 06:36:26 +07:00
Sam Sung 4e84da4322 Names, words, fonts and defaults follow the client's locale (#1407)
Places that read the client's locale in 1.12.1 now follow it:

- **Creature type words.** `CreatureType.dbc` at the locale column (`0x51a2dc`). The tooltip gates type 10 itself (`0x52a2c6`), so `UnitCreatureType` answers it and that deviation is gone.
- **Race and class names.** `ChrRaces`/`ChrClasses` at the locale column (`0x518301`, `0x518451`), feeding `UnitRace`, `UnitClass`, `$R`/`$C`, who, friends, guild, raid, the battlefield score and the glue screens.
- **Name check.** Charsets come from the Wow.ini Region or the locale (`0x6c91b8`, `0x86ca0c`), with the Hangul syllable list (`0x86ca30`) and the per-charset caps.
- **Display.** koKR chat bubbles are left-justified (`0x4b16e7`). The loading tip font is picked by locale (`0x82f018`).
- **CVar defaults.** AutoInteract on koKR, gxWindow and gxMaximize on zhCN (`0x603368`, `0x63a738`). A saved value still wins.

Tests run at non-zero locales throughout.

Fixes #1361
Fixes #1362
Fixes #1363
Fixes #1364
Fixes #1365

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 06:22:51 +07:00
Sam Sung 4332bcb9dc Every target select runs SelectTarget's charmed and spell-cursor front (#1400)
`SelectTarget` (`0x493540`) checks two things before it selects:
- a charmed player returns (`0x49359c`);
- with the spell targeting cursor up, a unit is bound to the cast and nothing is selected (`0x4935ca`–`0x4935d5`).

Every benilla selector skipped this. Now one select front models it, and every caller runs through it: the script verbs, TAB (which still advances), `AttackTarget` and the Interact attack, nameplate and body clicks (both greet first, `0x4927fd`), loot select, `/target`, and the attacker acquire. With the cursor up, `AttackTarget` and the pet Attack send the cast first.

`CastBookSpell` (`0x4b3474`) stops targeting when the cursor is the same spell.

Tests: each verb with the cursor up and down, a stock TAB with a heal's cursor up, the charmed cases, and the wire order.

Fixes #1380
Fixes #1378

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:47:18 +07:00
Sam Sung 7b5cfef242 Field-watch events fire per values block, never on create or reload (#1396)
In 1.12.1 the stat, XP, rest, honor and faction events come from field watches. The notify pass (`0x465330`) runs each watch once per values block, in field order, only when its bytes changed (`0x4655bb`). A first create and `/reload` run none. benilla diffed snapshots per frame, fired on first sight and lumped fields together.

`field_watch` now writes one notice per block per watch from the object handlers. The events fire from those notices:
- the unit-field bridge (`0x51bbb0`/`0x51bd50`), one per field, to every token of the guid (`0x515c50`);
- the player watches (`0x5dd8a0`);
- the skill watches (`0x5ed990`: UNIT_ATTACK, UNIT_DEFENSE, UNIT_RANGED_ATTACK_POWER);
- the weapon slots (`0x5dee30`).

The feeds only push. POSSTAT/NEGSTAT and `has_offhand` fire nothing, and the AP multipliers fire.

Tests:
- field order and per-block counts;
- silence on create;
- bridge ids pinned to `events.tsv`;
- push-before-fire order.

Fixes #207
Fixes #286
Fixes #1379
Fixes #1381
Fixes #1382
Fixes #1383
Fixes #1384

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 04:52:20 +07:00
Sam Sung 407aeed544 Item counts walk mask 0; trade state ends and signals as 1.12.1's (#1395)
Item counts and trade state, as 1.12.1 holds them.

- Counts walk mask 0 (`0x622420`): worn gear, bags, backpack and keyring, skipping broken and flagged items. A charged item counts its uses left (`0x4e6d20`). A reagent is red only when no copy is carried (`0x52f49f`). The equipped border asks the walker at mask 1.
- The trade keeps both item offers after a close until the next open (`0x4bf549`). Money zeroes on the ending statuses (`0x5d4884`), and the player getter is gated (`0x4c0706`). Traded-away items clear before `TRADE_CLOSED`.
- `TRADE_UPDATE` fires only from a getter's landed item record (`0x4c034f`).
- A stale own-side status is dropped (`0x5d49ba`). Every edit sends whatever the window state and bumps the counter, money verbs included.

Tests: each change, including the stock money re-entry.

Fixes #1356
Fixes #1357
Fixes #1358
Fixes #1359

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 04:13:43 +07:00
Chris 8c35874790 The client dials the first IPv4 address alone, as 1.12.1 does (#1385)
**Problem.** `localhost` resolves to `::1` first. benilla dialled every resolved address in order, so a realmd bound only to IPv4 left a Windows login waiting about 2 s on `::1`.

**Reference.** 1.12.1 resolves the realmlist host to one IPv4 address and dials it alone (`WowConnection::ConnectToHost` `0x5b6e40`): `inet_addr` (WSOCK32 ordinal 10), else the first entry of `gethostbyname` (ordinal 52). It never dials IPv6.

**Change.** The dial takes the resolver's first IPv4 address and nothing else. A host with no IPv4 address fails as unresolved.

**Tests.** `localhost` dials `127.0.0.1`. The first IPv4 address of several is dialled. A host that resolves only to IPv6 gives no target.

Smoke: green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-16 03:43:28 +07:00
Sam Sung 99458b32a8 Protected calls pass tainted code only inside an input event (#1388)
The protected-action gate (`0x494a50`) now runs its input arms. Tags 2, 4 and 10 pass tainted code only under an input flag:
- the edit box's Enter (`[0xcf4dc4]`);
- a button's click or double-click (`[0xcf4da0]`);
- a running binding.
Without one they refuse silently. This covers casts through `TryCastSpell`, the pet actions, `SpellStop*`, `SpellTargetUnit`, item targeting, `TargetNearest*` and `AttackTarget`, and `ReloadUI`.

Branches the reference runs before the gate still run when the cast is refused: aura and form cancels, and the bind-on-use and soulstone legs. Queued calls replay the input events they ran under, around their own events too. So a TAB-driven `PLAYER_TARGET_CHANGED` handler casts as in 1.12.1.

`SetEuropeanNumbers` now also swaps separators in tooltip lines, both message frame classes (at show for scrolling ones), SimpleHTML, chat bubbles and nameplates.

Tests: a 30-verb census, and the stock buttons, bindings, `/cast`, spellbook and macros.

Fixes #1354
Fixes #1355

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:25:42 +07:00
Sam Sung 93e5042194 Reference at c854c4e; player-field events carry their watch's arguments (#1386)
Re-vendors `reference/` at benilla-re `c854c4e`, which now resolves computed event ids at their fire sites. 97 events gain a producer: the 93 `CHAT_MSG_*` events and the player-field watcher's `"player"` events.

The fires change to match:

- `PLAYER_XP_UPDATE`, `PLAYER_PVP_KILLS_CHANGED` and `PLAYER_PVP_RANK_CHANGED` carry `"player"`, once per changed watch (`0x5de4b0`). A level-up fires twice.
- `UPDATE_EXHAUSTION` fires bare from the rest byte (`0x5de4e0`) and `"player"` from the pool. `UPDATE_FACTION` fires bare from the list, twice on initialize, and `"player"` from the watched index. Everything fires in field order.
- `PLAYER_DAMAGE_DONE_MODS` is produced (`0x5ddbc0`, `0x5ddbe7`, `0x5ddc0e`), and `UNIT_DAMAGE` keeps only its own fields.
- The rank watch covers all of `PLAYER_BYTES_3`, so its deviation goes.
- The shape gate reads the chat fire's shared ten-value list.

Tests: the shape gate, plus feed tests for each watch and its order.

Fixes #237
Fixes #244
Fixes #296

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:29:22 +07:00
Sam Sung 7b608671a6 Item objects notify the action bar and trade as 1.12.1's handlers do (#1366)
Nothing listened to the player's item objects after they changed. Action and trade slots diffed snapshots, so an addon missed restacks, enchants and destroys.

- **The seam.** `item_watch` emits one notice per reference handler run, in wire order. The handlers are destroy `0x5d8660`, stack `0x5d9400`, charges, entry, enchant `0x5d9a90`, record `0x5d8440`, seats `0x4f8db0`/`0x4f90d0`/`0x4f8ec0` and visible items `0x5dee30`.
- **Action bar.** Each notice recounts every item slot holding the entry and fires `ACTIONBAR_SLOT_CHANGED`, with no change test (`0x4e5c70`, 16 callers). Arrival recounts quietly, then fires slot 0 (`0x5dea50`). The per-frame poll is gone.
- **Trade.** Our slot re-sends or clears its item and fires `TRADE_PLAYER_ITEM_CHANGED` (`0x4bfb10`, `0x4bfb60`). Slot 7's enchant spell signals its side and names the enchantment (`0x4bf2b0`). `ClickTradeButton` refuses bound, quest and bag items (`0x4bfeb5`).

Tests cover every watcher, consumer order and refusal.

Fixes #1064
Fixes #1062
Fixes #1063
Fixes #1041

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:54:27 +07:00
Sam Sung 831e4d3afc The client reads its locale from Wow.ini, as 1.12.1 does (#1360)
benilla read every DBC string from the enUS column and answered enUS everywhere. 1.12.1 reads its locale from `Wow.ini` in the archives (`0x40249d`). It joins `Language` and `Country` into a tag at `0xc2a2a4` (`0x402513`). It looks the tag up in the eight locale names to get the index at `0xc0e080` (`0x402562`); enGB keeps index 0.

- The chain reads `Wow.ini` with the client's ini rules: no trimming, and the first value wins.
- Every localized DBC read takes column `first + index`.
- `GetLocale` and the TOC `Title-xxXX` pick follow the index (`0x48d8b0`, `0x46ce40`).
- The logon challenge (`0x5b2115`) and the name-cache header carry the tag, so this install sends enGB.

Tests:
- A synthetic WDBC per locale.
- 43 loader probes at an empty locale.
- A byte-exact golden for the challenge.
- GetLocale in glue and in game.

Smoke: green.

Fixes #1338

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:32:06 +07:00
Sam Sung b220d6a41c Debug globals, talent icons, European numbers, the protected-action gate (#1353)
Five Lua API gaps, settled at the bytes.

- `FrameXML_Debug` sets its flag only from a number (`0x488440`); it always returns the flag.
- The eight debug globals exist and return nothing (`0x83de68` rows).
- `GetTalentTabInfo` returns the tab's SpellIcon path (`0x4f30d0`).
- `SetEuropeanNumbers` stores its flag (`[0xcf4d24]`). The flag survives a reload. FontString and Button `SetText` swap `.` and `,` inside a number under the exact byte tests of `0x771c50`.
- The protected-action gate (`0x494a50`) fires `MACRO_ACTION_FORBIDDEN` or `ADDON_ACTION_FORBIDDEN`. It covers the 23 tag-0 movement calls, PitchUp/Down included, by context: a `RunScript` chunk, an insecure addon's files, inline scripts and binding bodies, or the client's own. Stack scan; the unmodelled taint cases are listed in `taint.rs`.

Tests: a test for each fact, including the gate through `LoadAddOn` of a real chain addon.

Fixes #60
Fixes #410
Fixes #162
Fixes #566
Fixes #486

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 00:37:06 +07:00
Sam Sung b727e30f31 Character model frames draw their own SetUnit subject (#1352)
Every character model frame, named or anonymous, now draws the unit its own `SetUnit` names, in a booth of its own. The seven stock-name booths are gone: the character window, pet doll, inspect, stable, dressing rooms and tabard designer are ordinary instances, driven by their FrameXML calls.

- `SetUnit` stores the GUID and builds a copy when shown and the unit is held (`0x505b50`).
- `RefreshUnit` rebuilds from the stored GUID (`0x505e40`); hide drops the copy (`0x505ce0`).
- `SetRotation` and the paint timer turn it, with the model's fallback ids (`0x505bb0`, `0x505c50`, `0x711bf0`).
- The constructor's directional light lights a fresh pane (`0x505680`).
- The stable shows the live pet's creature-template display (`0x4cb99e`).

Each change has a test that fails without it.

Fixes #1346
Fixes #1347

Co-authored-by: migwynkriid13 <335116281+migwynkriid13@users.noreply.github.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: migwynkriid13 <335116281+migwynkriid13@users.noreply.github.com>
2026-10-15 23:55:17 +07:00
Sam Sung e6f9d93db2 The Warden deviation says why benilla cannot answer it (#1351)
The Warden `Deviation:` lines now give the reason, not only the fact. Warden's answers come from a module, native Win32 x86 code the server sends and the client maps, links and runs in its own process (`0x7a79d0`). The client parses none of the payload itself (`0x6ca5c0`). benilla runs no such code on any platform, so it has nothing that could answer, and a server that requires Warden would kick it 30 s in (`Warden.cpp`).

Fixes #1349

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:43:55 +07:00
Sam Sung 20775b15f9 Tooltip lines, EditBox byte caps and slot textures as 1.12.1 has them (#1350)
Tooltip lines, EditBox byte caps and button slot textures, as 1.12.1 has them:

- A tooltip line with no text on either side is not added, and only a non-empty side is written (`0x530270`).
- A tooltip holds as many lines as it has `TextLeft<n>`/`TextRight<n>` pairs at load (`0x529650`), so a bare `GameTooltip` holds none. `AddFontStrings` adds one (`0x529940`).
- A clear blanks the left text and keeps the right (`0x530050`).
- An EditBox's `<FontString bytes="N">` and `SetMaxBytes(N)` cap it at N−1 bytes (`0x77a225`, `0x798f30`); `GetMaxBytes` answers N. Over the cap, the box drops a character or a whole link. The chat and who boxes stop at 255 bytes.
- A button texture path that does not load makes no slot region and keeps the old art (`0x7790ce`).

Each change has a test that fails without it.

Fixes #165
Fixes #177

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 22:59:34 +07:00
Sam Sung 14ae72269d Cooldown reads, GCD after an event, lost control as 1.12.1 has them (#1348)
Cooldown reads, the GCD after an event, and lost control, as 1.12.1 has them:

- A cooldown held until an event (Stealth, Shadowform) reads start now, duration 1 ms, enable 0 (`0x6e1503`, `0x6e1517`). Enable stays 0 once a held leg sets it, and the Lua getters answer the call's own time for a held start.
- An item's own category overrides its spell's (`0x6e1457`).
- `SMSG_COOLDOWN_EVENT` restarts the GCD from the event, which shares the recovery start (`0x6e15d8`, `0x6e185a`).
- While control is lost, spells, macros, spell-less items and forms grey unless the spell's immunity scan exempts it (`0x6e3dc3`–`0x6e3e4c`).
- Every self create gives control back (`0x5dea50` → `0x5fa600(1)`), firing `PLAYER_CONTROL_GAINED` when it was lost.

Each change has a test that fails without it.

Fixes #1296
Fixes #1297
Fixes #1298
Fixes #754

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 21:47:41 +07:00
Sam Sung 623c149fde docs/DEVIATIONS.md: where benilla differs from 1.12.1, generated (#1345)
`docs/DEVIATIONS.md` lists every place benilla deliberately differs from 1.12.1, generated by `scripts/genmap.sh` at every land beside `docs/MAP.md`:

- The settings that ship off the reference default, with each one's reason, from the `Deviates` rows.
- Each `Deviation:` comment's first sentence, linked to where it lives, grouped by crate and module.

A test fails if a `Deviates` row takes a shape the generator would misread. README, METHOD and CONTRIBUTING link the doc.

Fixes #1289

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 20:51:34 +07:00
Sam Sung 4ab54ad3a2 Loose install files answer the opens 1.12.1 flags (#1342)
Loose files in the install now answer the opens 1.12.1 flags, ahead of the archives (`0x647e60`, benilla-re `storm/mount`).

- The index walks the install folder, then `Data\`, keyed case-insensitively; the first entry wins.
- It answers interface files and textures, fonts (bare name first), cursors, sound, model frames and the minimap arrows.
- A `.MPQ` file answers its name from inside it.
- A name written with `/` misses, as in 1.12.1.
- A found file that fails to read does not fall back.
- The index empties where the reference empties it (`0x646fc0`): after saved variables, `AddOns.txt` and the glue sweep.
- A `Blizzard*` addon folder holding its `.toc` is skipped unread (`0x51fb50`), so the archive's copy loads. Nothing in the install is moved.

Each change has a test that fails without it.

Fixes #1144
Fixes #1145

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:33:44 +07:00
Sam Sung e3eade8e0e Lua errors and chat gates where 1.12.1 has them (#1339)
Lua errors and chat gates where 1.12.1 has them:

- `GetCVar`, `SetCVar` and `GetCVarDefault` raise `Couldn't find CVar named '%s'` (`0x488be7`). Every script-visible CVar of the reference is now registered, at its default, so only a name 1.12.1 lacks raises.
- `SendChatMessage` raises on an unknown chat type (13 tokens, `0x49f7a0`), and on a whisper or channel line with no target (`0x49f310`, `0x49f4ca`).
- A non-string type is SAY.
- With no player, the call returns quietly.
- Party, raid and raid warning lines are refused outside their group (`0x49f33e`–`0x49f4c7`). A group leader's raid and battleground lines go out as the leader types (`0x49f3bf`, `0x49f48b`).
- A dead or ghost player's say, yell and emote are refused with `ERR_CHAT_WHILE_DEAD` (`0x49f592`).

Each change has a test that fails without it.

Fixes #1284
Fixes #373
Fixes #380
Fixes #1335
Fixes #1333

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 20:10:50 +07:00
OmniTroid 9c6c03decc A held item's emitters ride its idle-posed bones, in the world and the booths (#1334)
The Corrupted Ashbringer's glow bones carry constant Stand rotation keys that set the
plane of its XY-quad emitters (flag 0x1000); at rest pose the quads lay 90° off. The
client arms every M2 with animation 0 at load, so a held item with emitters on its own
bones now gets a skinless RigPose and an idle player, and its emitters ride their bone
anchors. The character window and dressing room carry the item's skeleton and idle
(EffectRig) and pose the effect host the same way.

Built and tested on macOS.
2026-10-15 19:57:58 +07:00
Sam Sung 78e8c27a82 Event gates read every fire site; five NPC events fire bare (#1336)
The event gates now read every place benilla fires a Lua event. One scanner finds firing functions by signature, with `queue_event`, `fire_global` and the glue closures included, and resolves names bound to locals. Tests fail on any other path into the queue. The shape gate refuses a list or name it cannot read. The `BENILLA_` exemption and the weaker exe-string gate are gone.

What the gates exposed, each against the reference:
- `GOSSIP_SHOW`, `MERCHANT_SHOW`, `MERCHANT_UPDATE`, `TRAINER_SHOW` and `TRAINER_UPDATE` fire with no arguments (`SignalEvent 0x703e50`).
- `PARTY_MEMBER_ENABLE`/`DISABLE` pass the slot as a number (`%d`, `0x4e869d`).
- `FRIENDLIST_SHOW`, which 1.12.1 lacks, is no longer fired; `FRIENDLIST_UPDATE` is.
- The three bind-confirm events count as produced. Two gap rows are reworded.

Fixes #86
Fixes #202
Fixes #313

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 19:46:25 +07:00
Sam Sung 5b12d4f24b The in-flight cast slot is pushed and popped where 1.12.1 does (#1330)
The in-flight cast slot is pushed and popped where 1.12.1 does:

- Every cast attempt pushes it (0x6e5026), and only an auto-repeat spell is popped after the send (0x6e5935 → 0x6e5989), so a ranged shot holds the slot until its result and a press meanwhile is refused with 0x61.
- An item use holds it only with `ITEM_FLAG_PLAYERCAST` (0x6e500b–0x6e501f).
- The slot is popped by the spell's `SMSG_CAST_RESULT`, success or failure (0x6e7408 → 0x6e741a), never by the GO.
- `SpellStopCasting` with the targeting cursor up aborts it and returns 1 (0x6e6e80).
- A same-spell re-press bails with no red line (0x6e4d43).

Each change has a test that fails without it.

Fixes #1291
Fixes #1295
Fixes #1303

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 18:40:24 +07:00
Sam Sung b816ff2f60 Update packets: self release, mover blocks, spline facing, placement (#1324)
Five fixes to how `SMSG_UPDATE_OBJECT` is applied, each against the client's code:

- An out-of-range block never releases the active player (0x465f39–0x465f45).
- A movement block for the unit we move, the player or a possessed unit, is dropped (0x4670a5–0x4670bb).
- A create spline reads its three final-facing fields independently, in the order point, GUID, angle (0x47f0bf, 0x47f0e8, 0x47f0f9), so a server that sets two no longer breaks the packet.
- A game object is placed by its create block's position over its position fields (0x5f7046), and a re-create re-poses units only (0x46638c).
- The leave-world sweep's comment names the destroy path alone.

Byte-exact fixtures for the spline; each change has a test that fails without it.

Fixes #1307
Fixes #1308
Fixes #1309
Fixes #1310
Fixes #1311

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 18:28:45 +07:00
Sam Sung b21b49c084 The 44 Lua functions 1.12.1 registers that benilla lacked (#1322)
44 Lua functions 1.12.1 registers were undefined, so an addon calling one raised.

- Units: `UnitCanAssist` (0x516bb0, computed as the first unit toward the second) and `UnitIsTrivial` (0x519d70). The assist rule now runs player-to-unit where the client does (0x6066f0), which corrects UnitBuff's and the TAB scan's answers for reputation factions.
- Quests, trainers, crafts: `GetActiveLevel`, `GetAvailableLevel`, `OpenTrainer` and seven skill-line functions.
- GM survey, LFG, lottery, minigame, skill points and the file verbs, from the install's tables: the survey (id 6) and LFGDungeons are loaded, and `GMSurveySubmit` (0x32a), `LFGQuery` (0x1ff), the lottery verbs (0x334, 0x336) and `BuySkillTier` (0x21f) send what the client sends.

Every send has a byte-exact golden; usage strings are the client's.

Fixes #333
Fixes #335
Fixes #338

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 18:15:26 +07:00
Sam Sung cf1aa41e3d NPC greetings from the latch; death and shapeshift close the window (#1320)
Two follow-ups on the interaction latch:

- The NPC's hello and goodbye come from the latch: a window registering for a different non-player unit plays the hello (0x49318f), a release to nothing plays the goodbye (0x493210), and a swap or a walk-away (0x493305) plays none. Every window greets alike; a game object or a player says nothing.
- Death and shapeshift close the window: the player's death releases with the goodbye (0x5e9a51), the latched unit's death releases without it (0x605950), and a shift into a form where IsShapeShifted holds and the row lacks flag 0x8 releases (0x5de07f).

Tests pin the hello and goodbye per window, the swap and walk-away, and each release, and fail on a goodbye where none plays.

Fixes #1287
Fixes #1288

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 17:46:23 +07:00
Sam Sung 358731f95a FontStrings wrap by 1.12.1's line kernel (#1306)
FontString text is laid out by 1.12.1's line kernel (0x5c7470) instead of a whitespace-only wrap.

- Breaks: the classifier 0x5c7780, after `-`, `:` and `/`, before whitespace, and between CJK and Hangul characters, with its 25 openers and 57 closers. Whitespace above U+0100 is Windows' C1_SPACE set, as the client asks it.
- A row ends at the last break, else at the glyph that did not fit; the skip after it crosses blank lines and stops at a colour code; a glyph wider than the row ends the layout.
- `nonspacewrap` (off by default, the XML attribute and `SetNonSpaceWrap`) carries a force-cut row into the next (0x5c76ea).
- `maxLines` cuts with "..." at maxLines × the line pitch, also for an auto-height string (0x771ec0, 0x7729b0).

An emulation of the client's draw loop, fit walk and EditBox row table matches on 400k fuzzed strings.

Fixes #217
Fixes #218
Fixes #219

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 17:34:32 +07:00
Sam Sung f5dd4c79a0 The gates memo treats the issue and PR templates as docs (#1293)
The gates memo kept its verdict for a change under `docs/` or in a top-level `*.md` only, so a change to an issue or PR template ran the whole chain again. No gate reads the templates; the workflows under `.github/workflows` stay code.

Scripts only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:45:29 +07:00
Sam Sung e5321beda0 NPC windows share 1.12.1's interaction latch, trade and books included (#1290)
NPC windows share 1.12.1's one interaction latch (0xb4e2d0). Every opener closes the current holder through the dispatcher 0x493310, in its order, before it opens (0x4930d0); each close core releases on its own cell, so a direct close while latched fires its `*_CLOSED` twice (quest once: it zeroes its cell first, 0x501201).

All 13 windows are on it: gossip, quest, merchant, taxi, trainer, bank, stable, registrar, tabard designer, mailbox, auction, trade and item text. Opening a vendor during a trade closes the trade and sends one `CMSG_CANCEL_TRADE` (0x4bf527); walking away closes a trade at the interaction leash (0x493230). A second gossip menu from the same NPC closes nothing (0x4e1fb8). A chained quest turn-in leaves the panel up (0x5dc6d7).

Tests pin the event order and count for every pair of windows, and the packets sent.

Fixes #1054
Fixes #1099

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:40:07 +07:00
Sam Sung c49c201176 CVars refuse what 1.12.1's callbacks refuse; Lua arguments and numerals (#1286)
CVars and Lua arguments, each against the client's code:

- A CVar row carries the reference's refusing callback, run before the value is stored (`CVar::Set`, 0x63df7d): the video rows, six camera rows, `farclip` (NaN passes, as 0x688d40's unordered compare lets it), `frillDensity`, `gxTripleBuffer` (0 or 1, 0x63afe0) and `gxRefresh` (the 11 rates at 0x8645e0).
- `RegisterCVar` creates at most 30 CVars per process (0x488b25); `GetCVar` and `GetCVarDefault` raise their usage lines.
- `Minimap:SetMaskTexture`, `CloseLoot(1)` (ERR_LOOT_NO_UI, 0x48f27b) and the onSelf of `UseContainerItem`/`UseInventoryItem` follow the client.
- Lua's numeral reader has no hex and takes `d` as an exponent, as the client's strtod (0x4112d1).

Each has a test that fails without it.

Fixes #558
Fixes #559
Fixes #567
Fixes #696
Fixes #988
Fixes #989
Fixes #1025
Fixes #302
Fixes #366
Fixes #1275

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:20:23 +07:00
Sam Sung 8f6162e5f1 UI core: hard line breaks, loose files first, tiling, chat link buttons (#1285)
Four UI-core fixes, each against the client's code:

- Text breaks on `\r` and `\n` before any flag is read (0x5c286e); `|n` is refused only under flag 0x200, which no stock style sets.
- A texture or sound open with flag 1 or 2 asks the install's loose-file index first (0x647f89), then the archives, so an addon's loose file shadows the archive copy.
- A tiled backdrop divides the frame's own rect by the tile size (0x77f0c0), in FrameXML and glue alike.
- A chat frame releases every live link button before placing any (0x788c00), and a resize in screen units, insets times scale (0x788342), relays the lines and rebuilds them.

Each has a test that fails without it.

Fixes #877
Fixes #880
Fixes #898
Fixes #962

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:06:19 +07:00
Sam Sung b7bc7a7e3f Contributor docs: the quick test loop, the reference pin, open gaps (#1283)
A fresh-clone walk-through as a new contributor found four gaps in the docs:

- No quick test loop: `scripts/check.sh` has nothing to check on a clean clone, and `cargo test -p <crate>` was not mentioned. "The loop" now says both.
- The doc-link lint is a full `cargo doc` of the workspace; METHOD and the script's header now say so.
- What to cite while a benilla-re gap is still open: the client address, with the benilla-re issue or pull request linked.
- When `reference/PIN` moves: only with a change that needs a newer benilla-re row, to a commit on its main. Stated in CONTRIBUTING and `reference/README.md`.

Docs only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:07:29 +07:00
Sam Sung 994f9f9610 reference/ vendors benilla-re's tables at a pinned commit (#1282)
`reference/` held benilla's own copies of the reference's tables, some derived by its own scripts from older inputs: the fire-site table kept one event id where a site fires two, and credited glue-screen sites to in-game events.

Now `reference/` is benilla-re's tables at the commit `reference/PIN` names, byte for byte: bindings, events, glue events, messages, event arguments, verb events, the glue surface, the Lua globals, chat types and groups, and CVars. `scripts/sync-reference.py` copies them, and its `--check` runs in the gates and in CI. Four generators and nine old files go, and every reader moves to the new columns.

New tests hold the chat type, chat group and CVar tables to the copies; the CVar rows already filed are listed as known.

Fixes #245
Fixes #960
Part of #244

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:09:45 +07:00
Sam Sung 77b05e34be Docs: find the reference fact in benilla-re, and take its gaps there (#1280)
Contributors and their agents had no word on how to use the reference beyond a link.

- `AGENTS.md` sends an agent to benilla-re before it builds: clone it beside the repo and grep it, or look an address up on its site.
- `docs/CONTRIBUTING.md` gets "The reference": how to look a fact up (the site, `symbols/`, `tables/`, `systems/`), how to weigh a row's confidence, and that a gap or an error goes to benilla-re as an issue or a finding.
- `docs/METHOD.md`, the pull request template and the issue chooser say the same in a line each.

Docs only; `scripts/check.sh` is green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:05:01 +07:00
Sam Sung 94eb6a8bea TargetByName, TargetUnit and ClearTarget show their pick in the chunk (#1244)
In 1.12.1, `TargetByName` (`0x489d60`), `TargetUnit` (`0x4899d0`) and `ClearTarget` (`0x489ff0`) commit through `SetSelection` (`0x493540`) before they return, so the next line of the chunk reads the new target. benilla queued them, so `UnitName("target")` on the next line read the old unit.

The bindings now update the `"target"` view and the resolver's guid at once. They rank over a per-frame candidate feed that shares the app scan's candidate test and rank. A pick `SetSelection` refuses (not selectable, `0x4935ee`) leaves the view alone. The unit feed re-pushes the committed selection the next frame. A full tie goes to the lower guid, written as a deviation.

Tests: the chunk reads the pick; namesake ties, refused picks and the re-push, in benilla-ui and through the app's real feed.

Supersedes #1225, whose branch GitHub would not let us push to.

Co-authored-by: kalistoking <148718830+kalistoking@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:17:29 +07:00
Mathih13 b15fb9abc6 A MessageFrame's link is text; only chat lines take link buttons (#1149)
- A MessageFrame's link is text; only chat lines take link buttons
- set_spans' doc says only a ScrollingMessageFrame's spans take buttons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-14 14:57:15 +07:00
Sam Sung 5338675fc8 EditBoxes keep the client's text window; paste types per character (#1143)
Every shown EditBox now keeps the client's text window, focused or not. An unfocused box used to cut long text to "prefix..."; it now shows where its caret last left it, re-windowing at 0.25 or 0.75 of the width when the caret leaves (0x77d705–0x77d858, 0x77d320). A password box never re-windows (0x77d769) masks one `*` per byte, and copies as an empty string (0x77e1f8). A window starting inside a coloured run keeps its `|c` code (0x77d8ba).

OnCursorChanged reports the font's line height as `h` (0x77b970), and measures `x` from the window's start (0x77dcd8) by the text's justify (0x77db63).

Paste types the clipboard one character at a time through the typed-character insert (0x77e250 → 0x77c200), so `|` doubles, a tab is four spaces, and OnChar fires per character.

Tests cover each through the Lua surface, plus an app test drawing an unfocused window.

Fixes #728
Fixes #739
Fixes #740
Fixes #744

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 22:46:58 +07:00
Sam Sung 537defc7a0 Link benilla-re, the reverse engineering benilla is built against (#1141)
benilla's reference facts come from reading the 1.12.1 client at its bytes. That work is now public as [benilla-re](https://github.com/samwhosung/benilla-re): one row per function, global and field, a doc per system, and the data tables, each cited by client address.

This links it from the README, from METHOD's "The reference first" and from CONTRIBUTING's step on stating the reference fact, so a contributor knows where a client address leads. Docs only; no code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:33:17 +07:00
Sam Sung dd3983a470 Lua API edges: tradeskill filters, rolls, autocast, bindings and mail (#1102)
Seven Lua API and event edges departed from 1.12.1:
- SetTradeSkillSubClassFilter and SetTradeSkillInvSlotFilter now raise their errors (0x4ffc70, 0x4ffe60).
- RollOnLoot sends any roll type (0x61bdf0).
- TogglePetAutocast drops a held pet action instead of toggling (0x4be290).
- GetInboxHeaderInfo's hasItem is 1, not the count (0x4aef38).
- UPDATE_BINDINGS fires only from SetBinding and the copy into set 3 (0x4b8056, 0x4b649d).

Mail now follows the result handler 0x4ad050. Take, return and delete edit the rows in place, with no re-list, and each arm fires its own MAIL_INBOX_UPDATE. MAIL_FAILED fires for every result, after the request lock lifts (0x4ad164). Every list result fires MAIL_INBOX_UPDATE. Taking a template mail's item keeps the letter (0x4ad7fd).

Tests cover each.

Fixes #1048
Fixes #1049
Fixes #1055
Fixes #1072
Fixes #1071
Fixes #1053
Fixes #1052
Fixes #239

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:39:37 +07:00
Sam Sung a96977e759 Gradients tint per vertex; a layer's textures sort by handle (#1101)
On the stock credits screen the fades drew as solid black boxes over the text, and the black bars covered the borders.

A texture's gradient now tints its four vertices over the texel (0x77f910, TL BL TR BR). A gradient alone draws nothing, and any vertex-colour write collapses it (0x77f750).

A layer batch sorts its quads by texture handle at End (0x7731a0), with an exact port of the client's qsort. Its tie order was checked against the client's own code. The client's handles are heap addresses, so different textures rank by a creation stamp that follows allocation order. That is a narrowed Deviation.

Extract costs what it did before. The options window's ground dim moves to BORDER to keep its look.

Tests cover the gradient, the sort and the stock credits frame.

Fixes #874
Fixes #1095
Fixes #1092

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:30:07 +07:00
Sam Sung c77386c42e Leaving the world closes every window in the client's sweep order (#1100)
Leaving the world (a /reload, logout or worldport) kept loot, trade, mail, the auction house and the other NPC windows open, and a reload kept the target. A loot release for another object, or with result 0, closed the open window.

In 1.12.1, the sweep 0x490a80 closes each window in its legs, in the dying interface: loot with its release, trade cancel, mail, auction, gossip, trainer, taxi, merchant, tabard, stable and the rest. A /reload first drops the target loudly and ends a follow; a logout runs the sweep first and clears the target silently. The release response closes only for the latched guid with a nonzero result (0x5ec090).

benilla now runs those legs in that order on each root, gates the release, and lets each leg drop its own item locks.

Tests cover each leg, each root's order and the release gate.

Fixes #1066
Fixes #1044
Fixes #209

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:00:07 +07:00
Sam Sung 5a93d1a432 Gate failures print the failing test before the log tail (#1098)
A failing test gate printed only its log's last 30 lines. Those are the doc-test runs after the failure, so the failing test's name and its panic were missing from both the gate output and the land log.

scripts/gates.sh and scripts/check.sh now print the panic lines, each test's FAILED line and any compiler errors from the log first, then the tail as before.

Checked on a sample failing log; both scripts pass `bash -n`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 08:53:30 +07:00
Sam Sung d106c124c4 Glue booth keeps its model: create re-dresses, a hidden scene pauses (#1097)
The glue booth threw its model away where 1.12.1 keeps it. So the create preview restarted its animation on every customization or class change, and the login scene restarted after Credits.

In 1.12.1, the create setters (0x478790 and its siblings) and the re-dress 0x470800 update the same CharacterModel. Only a race or sex change builds a new one (0x470b70). A hidden ModelFFX is unlinked from its strata bucket, so its OnUpdate (0x76d7f0) and its clock stop until it shows again, and the clock steps in whole milliseconds (0x76d846).

Now the booth re-dresses its body in place and keeps a hidden or left scene parked, resuming it on return. Each scene has its own clock (one SceneClock on its root), its own materials, so two scenes on one file stay independent.

Tests cover the keep, the park, the clocks and the cleanup.

Fixes #1083
Fixes #1068

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 08:49:22 +07:00
Sam Sung 8537ce7cc9 Forced reactions answer both reaction directions and refresh unit frames (#1096)
SMSG_SET_FORCED_REACTIONS (0x2A5) was never read, so a forced-reaction aura such as the Gordok Ogre Suit left the ogres hostile.

The client stores the table whole (handler 0x4d59a0) and looks a target faction up in it (0x4d6490). Unit-to-player reactions consult it at 0x6065e6, behind the leading rungs and capped at 6. Player-to-unit reactions consult it at 0x6063e0. On arrival the handler fires UNIT_FACTION for every bound unit. ShutdownGame clears the table, never a worldport.

benilla now decodes the table onto Reputations, answers both reaction directions from it, fires UNIT_FACTION on each arrival, and clears it at the session's end.

Tests cover the decode, both directions against an at-war faction, the caps, the replace and clear, and the target frame recolouring.

Fixes #78
Supersedes #1080

Co-authored-by: kalistoking <148718830+kalistoking@users.noreply.github.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 08:22:53 +07:00
Sam Sung 11f6fe97c0 Stock glue: credits music, cursor hide, status number, Model pane lights (#1091)
Four stock glue screen defects:
- Credits raised a Lua error: PlayCreditsMusic was unbuilt. It now fades the theme and plays the seven city intro tracks in turn (0x45b000, table 0x836028).
- HideCursor/ShowCursor (0x46db70) only set a flag. The pointer now hides over the credits and the movie on every platform.
- A world status past the 83-row table read RESPONSE_FAILURE's text; GetStatus formats it "(N)" (0x5aa960).
- A plain Model pane (the realm wizard) was lit only by the widget's light. It now takes its M2's own lights, as 0x718960 emits them, under the widget light and fog.

Also writes the Deviation line for the config save: benilla saves a quiet second after a change, where SaveConfig (0x63d980) writes only at world entry, logout and shutdown, so a crash keeps the settings.

Tests cover each.

Fixes #1070
Fixes #1069
Fixes #1058
Fixes #1082

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 07:27:36 +07:00
Sam Sung 48a62ee835 A scroll child draws inside its ScrollFrame's highlight callback (#1090)
A scroll child drew by its own strata and level. So on the stock create screen the info text drew over the icon frames raised beside it.

In 1.12.1, SetScrollChild (0x786ce0) flags the child's subtree. The flat pass skips flagged frames (0x7659df). The ScrollFrame's HIGHLIGHT callback (0x787220) draws the subtree clipped to its hit rect, frame by frame in link order (0x76b3f0), and draws nothing for an empty clip. Picking keeps each frame's own level, clipped to the first unflagged ancestor (0x76b020).

benilla now draws and picks the same way. A frame shown or hidden inside the subtree keeps the others' order. The options window's scroll trough sits at its ScrollFrame's level, so the page still draws over it. Deviation: a scroll child reparented out draws once, not twice.

Tests cover the order, nesting, clip, pick and the stock create panels.

Fixes #1084

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 06:44:42 +07:00
Sam Sung 39d1753abe Glue verbs run inside their Lua call; Update arms signal before writing (#1088)
The glue manager's verbs queued their work for a later frame. In 1.12.1 each verb calls CGlueMgr's function, which writes screenState and signals its dialog before the call returns, then begins its operation. So a dialog that its own OnShow dismisses was drawn for a frame here.

Now each verb runs its synchronous half inside the binding, against the one host GlueMgr the VM shares. Network work stays asynchronous. The Update arms (0x46b930) fire their signals before their later state writes. A failed world connect's "Retrieving realm list" closes on its reply, and a failed logon closes the link but keeps an unattended resubmit.

GetServerName reads the realmName CVar and the selected realm's flags live (0x46d280).

Tests cover each verb's events inside its call, a verb nested in another's fan-out, each arm's order, and the refused login never showing its first dialog.

Fixes #1065

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:44:14 +07:00
Sam Sung a7f331efdf Item use follows the client: bag store, bar equip, BoE hold, control (#1086)
Five item-use paths differed from 1.12.1's bytes:
- PutItemInBag swapped a worn item instead of storing it (0x4c7d44), and sent a bag into itself (0x4c7cea).
- UseSoulstone skipped the cast cancel before its use (0x48ae6b → 0x6e4940).
- The bar's equip left a held item on the cursor; it now runs 0x5e1840 → SetCursorItem.
- The bind-on-equip confirm emptied the cursor; the item now stays held under the question (0x5e16ce).
- Item use ignored loss of control. The dispatcher's requirement and control gates (0x5d8e0e, 0x5d8eaa), the equip and SetCursorItem gates, the fear/charm exemption (0x6e9d70) and the trade-window refusal (0x1b4) now apply. They read our own character's control only (0x5fa600).

Tests cover each path and gate.

Fixes #1057
Fixes #1075
Fixes #1078
Fixes #1076
Fixes #1077

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:30:39 +07:00
Sam Sung d3ac9f75bf Verbs raise their events in place; feeds push only server changes (#1085)
Verb events fired from app feeds a frame late; 1.12.1 signals inside the call.

Now each verb raises its events in place. Feeds push only what their own server source changed, so a verb's write is never rolled back.

Also, from the bytes:
- The score board waits on pending names (0x4aa216).
- The recruitment cascade runs inside its verb.
- Seven mail verbs share the request lock 0xb6efc8; the mailbox keeps its inbox across a close.
- StartAuction runs its gates, sends the attached guid and empties the slot in the call.
- The tradeskill repeat counts, disarms and resets as 0x4fd7b0 and 0x4fc750 do.
- Quest folds carry across a /reload.

Tests cover each event's timing and the feed rule.

Fixes #1008
Fixes #1009
Fixes #1010
Fixes #1045
Fixes #1046
Fixes #1047
Fixes #1050
Fixes #1051
Fixes #1059

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:54:00 +07:00
Sam Sung 13b7bb50f4 Stock character create: its 24 verbs, state 5 and the booth preview (#1079)
The stock character create screen had none of its 24 verbs.

They now follow table 0x8380f8:
- the reset draws sex, race, then the five customizations, with class 1 (0x470900);
- a race change redraws and takes the old list's first class (0x470cf0);
- the cycle lands on an end rather than wrapping by modulo (0x470f80);
- GetRandomName builds names from NameGen trigrams (0x475480);
- CreateCharacter checks the name (0x4711e2), then shows CHAR_CREATE_IN_PROGRESS and sends CMSG_CHAR_CREATE in screen state 5.
Success fires SELECT_LAST_CHARACTER and returns to the select; a refusal shows OKAY with its text. The preview stands in the glue booth.

Hair styles and each style's colours now come from CharSections (0x47a3e0, 0x47a400), so an Orc female has 8 styles. A NameGen that fails to load empties only the random name.

Tests cover each verb, the wire and the create flow end to end.

Part of #856
Fixes #1073

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:23:04 +07:00
Sam Sung 0b4b3ddc2c Item locks held per item at the client's own lock and unlock sites (#1074)
Item locks came from pending-op bookkeeping, so unlocks reached the wrong items or none.

Now a lock is a bit per item guid, set by LockItem (0x4953e0) and lifted by UnlockItem (0x495420) at the client's own sites:
- pickups, places, swaps, the delete and the wrap;
- UseContainerItem's arms, taken in the call in 0x4fa0e0's order (bank, deposit, sell, equip, open);
- the watchers: a seat's guid changing, an arrival, a restack;
- the inventory and sell refusals, loot closes, the bind-confirm cancel, the revive.
Readers refuse a locked item where the client does (0x4f9e76, 0x5d8d32, 0x4fa1cd, 0x4fa4bf). Ammo equips by class and unlocks.

A /reload carries the locks and the cursor, minus what the sweep's loot, mail and auction legs unlock. A despawned item loses its lock.

Tests cover each site, reader, watcher and the reload.

Fixes #1033
Fixes #242
Fixes #228
Fixes #354
Fixes #227

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:02:43 +07:00
Sam Sung e175209f28 Stock EnterWorld: its guards, the refused login and the glue reseat (#1067)
The stock character select had no EnterWorld.

EnterWorld follows 0x46b500:
- it returns silently with no realm, no record or no world link;
- flag 0x4 opens OKAY CHAR_LOGIN_LOCKED_FOR_TRANSFER and flag 0x4000 fires FORCE_RENAME_CHARACTER, neither sending;
- otherwise it writes and saves lastCharacterIndex, enters state 8 and logs in, the last call of a frame winning.
A refused login (0x5aad70) sets state 9, whose OKAY button re-enumerates on the same link.

The rebuilt glue is now seated before SET_GLUE_SCREEN, so a logout's select asks for its list. A refusal queued in the same drain as the entry now wins, natively too. The login-send doc is a Deviation line stating the reference's load-then-send.

Tests cover each guard and arm, and the entry, refusal and logout flows over the fake world.

Part of #856
Part of #977
Part of #79
Fixes #979

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:50:44 +07:00
Sam Sung 71d65a4883 Stock character delete and rename, with the client's name check (#1060)
The stock character select had no DeleteCharacter or RenameCharacter.

DeleteCharacter opens CHAR_DELETE_IN_PROGRESS and sends the delete (screen state 6). On success it fires SELECT_FIRST_CHARACTER and fetches the list again; a refusal shows OKAY with the status text (0x46c173).

RenameCharacter follows 0x473520 and 0x46b340:
- it needs flag 0x4000;
- the same name, or a failed name check, reopens the dialog with the key;
- otherwise it sends CMSG_CHAR_RENAME (state 7).
The reply (0x46b440) tells apart only result 0x31. Success renames the record, clears the flag, moves the character's local files (all or none, as one folder move) and fires CHARACTER_LIST_UPDATE.

The client's name check (0x5abd50 → 0x6c96c0), with NamesProfanity, ChatProfanity and NamesReserved compiled once, is shared with create.

Tests cover each verb arm, the wire, each name code, and both flows end to end.

Part of #856
Part of #79

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:28:58 +07:00
Sam Sung 0127b8690f Stock AddOns screen on the registry; SMSG_ADDON_INFO read in full (#1043)
The stock glue AddOns screen had no verbs to call, and SMSG_ADDON_INFO was read only for its status.

The glue AddOns verbs now run over the addon registry and an enable store kept in benilla-config, out of the AddOns folder; old enable files move there once. Reading SMSG_ADDON_INFO fires ADDON_LIST_UPDATE. Each record's status, key, revision and url go to the addon sent in the same position (0x51da70). The url is a C string of up to 256 bytes (0x4191b0), and addons past the last record keep its status. A banned addon and those that depend on it read as banned on both screens. IsAddonVersionCheckEnabled tests the CVar's integer (0x51f180). LaunchAddOnURL keeps 0x429ff0's decode. Deviation: it then re-encodes everything outside the URL characters and opens only http(s) with a host.

Tests cover each record shape, the pairing, the decode, the migration and the banned gate.

Part of #856
Fixes #1013

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 23:14:01 +07:00
Sam Sung 79842423f2 Cursor verbs follow the client's arms: bar, bags, doll and trade (#1042)
The cursor verbs follow the client's arms, on top of the primitives from #1038:

- **Action bar.** PickupAction places only what the bar can take (`0x4e615d`) and picks up over anything else. Bar spells and macros lift with their own setters, so `CursorHasSpell` sees them. Dropping the slot's own action, or a spell its macro or item casts (`0x4e5a50`), only clears the cursor.
- **Bags and doll.** Clicks pick up over a held spell, macro or coins, and clear a held bar item (`0x4f9de9`, `0x4f9f41`). A misfit doll drop auto-equips (`0x4c78ef`).
- **Trade.** A slot click swaps the old item back (`0x4c0036`). An offered item stays locked until the server closes the trade, and the close fires the unlocks between its two signals.
- `SplitContainerItem` refuses a count outside the stack.

Fixes #1031
Fixes #1032
Fixes #1034
Fixes #1035
Fixes #1036
Fixes #1037
Fixes #156

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:24:24 +07:00
Sam Sung 2af917044d Stock login fetches the server alert; LaunchURL behind the gate (#1040)
The stock login's Breaking News box (`WOW_GLUE_STOCK=1`):

- At glue init, as `0x46a400` does, the client reads the Lua global `SERVER_ALERT_URL`, which the player's own GlueStrings or a server's patch sets. It fetches the URL once on a background thread: plain HTTP, 5 s timeouts, redirects followed.
- The body builds the reference's buffer (`0x46a580`: 0x7ff cap, appended chunks). A case-insensitive `SERVERALERT:` prefix fires `SHOW_SERVER_ALERT` once from the update (`0x46b939`). Every failure is silent.
- `LaunchURL` opens the browser only for URLs that pass the reference's gate (`0x5abc10`): `http://`, a strict charset and the 10-host whitelist. An over-long host is refused rather than cut.
- No fetch or browser ever runs in a test, capture or unattended run.

Tests run against a local fake server: prefix, 404, redirects, chunked, timeouts, caps, and the frame shown end to end.

Part of #1026

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 21:42:29 +07:00
Sam Sung 5c7eb5fc75 Stock glue screens draw their 3-D scenes through the glue booth (#1039)
Part 4b of the stock GlueXML (`WOW_GLUE_STOCK=1`): the stock screens' ModelFFX scenes now go through the glue booth instead of the model-tile path, which drew them black.

- The scene, look and facing come from the glue VM. `SetCharSelectBackground` runs the frame's own SetModel and swaps its fill callback (`0x472128`, `0x472144`), so the select scene fogs until a character sets its stage.
- An ModelFFX pane draws the booth's scene at its own bucket's ARTWORK layer (`0x46fa90`), framed at the pane's aspect with the diagonal law (`0x7ada40`, `0x5c3cc0`). The native box Deviation now holds for the native screens only.
- Each SetModel restarts the stage. The select glow holds through an empty roster until the screen shows again.
- An empty roster shows the Orc scene fogged, and after the last delete the last stage stays, as `CharacterSelect.lua` leaves them.

Part of #856

Fixes #978

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:13:47 +07:00
Sam Sung eb63c8861b Cursor runs on ClearCursor and the setters' own event tails (#1038)
The cursor now runs on the client's two primitives. `ClearCursor(a,b)` (`0x495190`) cancels an armed gift wrap, then runs the payload's arm (an item's unlock fires `ITEM_LOCK_CHANGED`; coins fire `PLAYER_MONEY`), then the grid hide and `CURSOR_UPDATE`. Each setter runs that clear first, then its own tail (`0x494b60`, `0x4950f0`, `0x494d20`, `0x494f80`, `0x494e20`, `0x495010`). Every pickup, place, split, sale, trade, mail and auction path goes through them. So a `CURSOR_UPDATE` handler reads the emptied cursor, and `PickupSpell`/`PickupMacro`/`PickupPetAction`/`SplitContainerItem` clear what is held instead of refusing.

An item attached to mail or an auction stays locked until it leaves the slot (`0x4adef0`). Attaching to an occupied slot puts the old item back on the cursor.

Event-order tests cover each setter, the coin clear, and the attach lock and swap.

Fixes #1011
Fixes #1012
Fixes #1006
Fixes #1007
Part of #156

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:47:20 +07:00
Sam Sung bb82dd1ac8 Lua getters answer the reference's miss shapes; tooltip setters' flag (#1030)
Lua bindings answer the reference's shapes on misses, bad indices and tooltips:

- Indexed getters push their full miss tuple (`GetCraftInfo`, `GetPetActionInfo`, the trainer requirements and others). Indices go through `ftol` and an unsigned compare, so a negative misses instead of raising. Verified slot readers keep their own raises (`IsInventoryItemLocked`, `0x4c8520`).
- The eight GameTooltip setters return the builder's refresh flag, gated as `0x53267c` gates it, so a hovered cooldown tooltip refreshes. `LOCKED` follows the item object (`0x52bdb3`).
- Quality goes through the InventoryType gate (-1), and a pending template shows the question-mark icon.
- `GetLootSlotInfo` returns four values. `SetSpell`, `CreateMacro`, `JoinChannelByName`, `GetQuestReward` and the shapeshift and trade-skill filters raise or answer as the reference does.
- The shape gate probes each getter's miss legs through an argument ladder.

Fixes #145
Fixes #993
Fixes #994
Fixes #995
Fixes #996
Fixes #997
Fixes #998
Fixes #1016

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:28:35 +07:00
Sam Sung 781bf36ab3 Key input follows the client's walks; stock login takes typing (#1027)
Key input follows the client's walks: key-down (`0x765f10`), char (`0x765df0`), key-up to the recorded consumer (`0x765fd0`) and repeat (`0x766070`).

- EditBoxes are in the walk from creation (`0x779ced`), so the stock login's boxes take typing; only a focused box consumes. A box declines PRINTSCREEN and unaltered arrows on an `ignoreArrows` box, so stack-split steps under a focused chat box. A binding's press records the world frame.
- Repeats follow the pressed-key list, so a held key resumes after alt-tab. Chords reach a box only through the walk. Keys the client can't name walk nowhere.
- The stock login reads the agreements before its first screen. Cinematics returns to login (no movie player; Deviation). The Realmlist box has its middle border.
- Alt+F4 closes the window on Windows and Linux (Deviation: the reference relies on the OS).

Fixes #179
Fixes #1003
Fixes #1004
Fixes #1005
Fixes #1019

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:07:34 +07:00
Mathih13 7547081a58 fix: a same-map teleport shows no loading screen, as 1.12.1 does (#1018)
1.12.1's MSG_MOVE_TELEPORT_ACK handler (0x603f90) reaches none of the
loading screen's raises: 0x406800 is entered only from SMSG_TRANSFER_PENDING
(0x401900), the glue EnterWorld (0x46b6f1) and 0x407de0. benilla raised the
cover on a same-map snap twice over: the "focus not resident" backstop on the
snap frame, and a >=100 yd relocation raise. The relocation raise goes, and
the backstop stays off while a snap's settle hold is up; the body is held over
the destination as before.

Verified live against the local realm (map 0, Gmagent): .tele ironforge from
Northshire (~3960 yd) and back covered 50 and 93 frames (0-916 ms, 0-1680 ms)
before, 0 and 0 after; cross-map .tele valley and back still raise the cover
("worldport"). New tests in loading_screen.rs fail on the old code at the snap
frame. benilla-app and benilla-world lib tests green, install-reading tests
green with BENILLA_REQUIRE_DATA=1 (the addon corpus is absent on this
machine). Built on macOS (arm64).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:46:50 +07:00
Sam Sung d759008172 Logout returns to character select on the same world connection (#1022)
In 1.12.1, logging out or a refused character login returns to character select on the same world connection and re-lists there (`0x5aaeb0` → `0x401ee0`, then `0x46b880` → `CMSG_CHAR_ENUM`). There's no realmd logon and no new `CMSG_AUTH_SESSION`. Enter World closes the realmd link (`0x46b70c` → `0x5b3320`), and only the glue's own re-dials reopen it.

- benilla used to drop the socket and log on again from cached credentials. Now the world session splits and rejoins on one connection, and the header cipher carries its state across.
- The realmd link closes at the pick.
- A leftover packet at character select is skipped rather than fatal.
- The write thread applies a pending writer swap before any command.
- A kept-link teardown ends the character without a "server down".

Fake-server tests pin one logon, one auth and one more enumerate. The logout smoke fails without a same-link relist.

Fixes #984
Fixes #983

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:38:05 +07:00
Sam Sung aba120cdcb Lua verbs fire their events before returning, in the reference's order (#1015)
In 1.12.1 an event a Lua verb raises runs its handlers before the verb returns: `SignalEvent` (`0x703e50`) walks the listeners in place. About 35 benilla binding sites queued theirs for a later drain instead.

- Verbs now raise inside `tick::verb` steps, and the events fire as each step's model borrow drops. A step follows the reference's split wherever it signals before changing state a getter reads: the money pickup, bag pickup and place, merchant grab, repair cursor, item use, action and pet-bar pickup and drop.
- The grid events fire before `CURSOR_UPDATE`, and a clear's unlock before both, as at `0x4952b3`/`0x495455`. `ITEM_LOCK_CHANGED` carries no arguments.
- `pending_events` is host-only now.

Tests pin handler order per family, nesting from a handler, and the order changes.

Fixes #999
Fixes #582

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:14:10 +07:00
Sam Sung 24c7cab983 Stock character select roster; the screen asks for the list (#1014)
Part 4a of the stock GlueXML (`WOW_GLUE_STOCK=1`): character select's roster.

- The select verbs run on the reference's roster (`0x4736c0`): `GetCharacterInfo` (race and class from `Name_Lang`), `SelectCharacter` with its clamp and event, the facing gate, and `GetCharacterListUpdate`. They are backed by the roster load and teardown (`0x4724d0`, `0x472580`) and screen state 3.
- Under the stock screens the character list is fetched only when the screen asks, as `0x46b880` does. The world connect completes on the auth response (`0x5aab80`), not on a roster.
- Every character-park request goes through one ordered channel. A roster reply completes only the current link's query. A late auth after a cancel is dropped, Warden stays terminal, and a failed list shows `CHAR_LIST_FAILED`.

The native screens are unchanged. Fake-server tests cover the ordering, the cancel, the realm change and the native policy.

Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 15:59:54 +07:00
Sam Sung 0f505a2ebf RegisterEvent ignores case; a frame's first resize precedes OnLoad (#1001)
- `RegisterEvent` and `UnregisterEvent` match a name against the client's event table case-insensitively and drop a name that isn't in it (`0x702140`). A new gate checks that every event name the code fires is in the table.
- A visible XML frame resolves its layout at the post-load hook (`0x76a310` → `0x7680e0(1)`). So its first `OnSizeChanged` fires before its `<Frames>`, `OnLoad` and `OnShow`, as in 1.12.1. A hidden frame still waits for its show.
- `pending_events`' doc now says what the queue is: `SignalEvent` (`0x703e50`) runs handlers in place, and the Lua verbs that still queue are a gap.
- #890 was already fixed by #907; two stale comments around it are corrected.

Fixes #959
Fixes #972
Fixes #560
Closes #890

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:08:07 +07:00
Sam Sung 720dcf8188 Lua bindings return 1/nil and the reference's value counts (#1000)
Lua bindings now return what 1.12.1 pushes, in type and count:

- Flags are 1 or nil, never a Lua boolean. This covers `SetInventoryItem`/`SetBagItem` hasCooldown, `GetQuestLogLeaderBoard` finished, `GetContainerItemInfo` locked/readable, `AtTop`/`AtBottom`, `IsOwned` and `SetAlphaGradient`.
- Eleven verbs whose handlers end `xor eax,eax` return nothing. That covers `PickupAction`, `PlaceAction`, `PickupSpell`, `PickupInventoryItem`, `EquipCursorItem`, `SplitContainerItem`, `PickupMacro`, `DeleteMacro`, `ResetChatColors` and others.
- The miss tuples: `GetInboxHeaderInfo` gives 13 values (`0x4aeff0`), `GetInboxText` four nils, and `GetQuestLogLeaderBoard` three.
- `GetTrainerServiceDescription` is nil with no text (`0x4d9d44`). `GetZonePVPInfo`'s faction is `""`, not nil (`0x48d633`).

The boolean gates now probe every global and widget method.

Fixes #442
Fixes #574
Fixes #577
Fixes #578
Fixes #822
Fixes #823
Fixes #872

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:01:32 +07:00
Sam Sung 1b335717c3 Addon loading and .toc parsing follow AddOn_Load and Toc_Parse (#992)
Addon loading follows the client's `AddOn_Load` (`0x51f240`) and `.toc` reader (`0x51c9b0`):

- One driver serves the startup walk, `LoadAddOn` and the survey harness. It marks the addon loaded before its dependencies (`0x51f313`), so a requirement cycle loads both and `IsAddOnLoaded` answers during an addon's own load. It loads `## LoadWith` dependents after `ADDON_LOADED` (`0x51f5b2`).
- Every directive is matched by its own literal. `LoadOnDemand`, `Secure` and XML bool attributes parse with the client's string-to-bool (`0x6f1b30`), so `hidden="1"` works. Values are not trimmed, and only an unindented `##` line is a directive.
- `GetAddOnMetadata` reads the metadata map (`0x51d580`): Title defaults to the folder, the last value wins, and locale suffixes apply. The url comes from the server, never the `.toc`.
- `EnableAddOn` keeps a toggle for an addon that isn't installed.

Tests are mutation-checked against the reference order.

Fixes #192
Fixes #193
Fixes #405
Fixes #986
Fixes #987
Fixes #990

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:28:48 +07:00
Sam Sung 1efd9a7163 Lua bindings coerce numbers, flags and colours as 1.12.1 does (#991)
Lua bindings now read their arguments the way the 1.12.1 client does:

- Numeric strings parse as Storm's `SStrToInt` (`0x64ac60`) and `SStrToFloat` (`0x64aaa0`). That covers channel keys, `GetNumber` and `item:` fields.
- Flag arguments go through `GetBoolOrDefault` (`0x6f1c10`) with each site's default. That is about 40 bindings, `SetChecked()` and `ShowHelm()` among them.
- Colour channels take numeric strings (`lua_tonumber`), and alphas are `isnumber`-gated: no raise, 1.0 by default. A three-argument `SetVertexColor` keeps the current alpha (`0x79ae0a`). So action-bar rings dimmed by a drag stay dimmed, as in 1.12.1.
- `SetTexture("1")` takes the colour form. MessageFrame channels follow `0x795590`.
- `LoggingChat`/`LoggingCombat` return the flag.

Binding-level tests use the reference's values.

Fixes #135
Fixes #144
Fixes #160
Fixes #161

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:41:47 +07:00
Sam Sung b2926edf53 Stock realm list and wizard; realm park cancels cleanly (#985)
Part 3b of the stock GlueXML (`WOW_GLUE_STOCK=1`): the stock `RealmList` and `RealmWizard` run on the reference's ten realm verbs (`0x46f480`).

- The realm park is now a cancellable operation. Each dial carries the cancel generation it was asked under, so no Cancel is lost, and a status Cancel closes the logon (`0x5b3320`).
- Change Realm with the world up drops the session first (`0x46b22b`).
- The roster arm (`0x4724d0`) sets the chosen realm, or asks for the list when the roster is empty.
- An empty realm list is shown, never dialled at the world port.
- The native type sort puts PvP before RP.

Deviation lines cover the re-dial's full logon, comparator ties, a missing Region row and the native close.

Part of #856 and #834

Fixes #833
Fixes #974
Fixes #982

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 12:46:31 +07:00
Sam Sung 0c58d85cf9 Layout file saves the rect; bubbles re-sort on change; resize Deviation (#981)
- **The layout file** now saves what the reference's writer does (`0x490e60`): `X`, `Y`, `W`, `H` and `FrameLevel` from the frame's held rect, rows in creation order, and only frames that are user-placed and movable or resizable. The restore (`0x4905e0`) pins TOPLEFT to the screen, sets the size and level, and resolves each frame as it goes (`0x490710`). Old anchor-form files still load and are rewritten once.
- **Chat bubbles** re-rank only on a camera move or a new line (`0x4b11ff`), and a repeat speaker moves to the tail, as `0x4b1870` links it.
- **The live re-layout on a window resize** gets its `Deviation:` line. 1.12.1 reloads the UI on an aspect change of 0.001 or more (`0x492f26`).

Tests cover parent/child level restore, the held rect, the hidden-frame resolve, the junk lines, the migration and the bubble tie order.

Fixes #954
Fixes #955
Fixes #847

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 12:26:11 +07:00
Sam Sung 8ccaa7b411 An unattended run keeps its state in a fresh folder of its own (#980)
An unattended run (`WOW_UNATTENDED`, `WOW_RIG`) resolved the same `benilla-config/` as a person. In a dev build, every linked worktree maps that to the primary checkout's folder. So a probe read the player's CVars, bindings and layout, and wrote its realm, settings and window positions back over them.

`local_state::home` now gives an unattended run a fresh folder of its own (`$TMPDIR/benilla-run-<pid>/benilla-config`) and prints it at boot. `BENILLA_HOME` still pins one, and a capture still resolves none. CONTRIBUTING's "Running it unattended" says so.

Test: `an_unattended_run_keeps_its_own_state_folder` checks the rig path, the override and the capture, and that the folder is never the resident one.

Fixes #975

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 12:15:31 +07:00
Sam Sung a329f19e06 Reputation lines, NPC greeting gates, and packet bytes in the trace (#976)
Player reports and the trace, in one batch.

- SetFactionInactive/SetFactionActive raise `UPDATE_FACTION`, so the list moves at once.
- NPC greetings: the latch, a dead unit, then the reaction pair with the active mover (`0x60c270`); a dead or ghost player hears none. Only a passing click re-tracks the NPC, and a window hello resets it (`0x60c3d1`).
- "You are now <rank> with <faction>." prints on first contact and rank change (`0x62c670`), in packet order, with the real gender.
- A standing packet prints its "increased by" line for the first entry only, never a hidden one (`0x4d57dd`).
- `WOW_MOVE_TRACE` carries each packet's bytes as hex; chat bodies are opt-in, and dot/bang commands and channel passwords are always redacted.

Tests cover each gate, the line order and the redaction.

Fixes #927
Fixes #882
Fixes #881
Fixes #867
Fixes #965
Fixes #966
Fixes #967

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 11:54:21 +07:00
Sam Sung 7158c58575 Hidden frames defer their layout; GetWidth answers the set size (#973)
A hidden frame resolved and fired `OnSizeChanged` at once, a getter's resize fired at the drain, and `GetWidth`/`GetHeight` answered the rect over scale.

In 1.12.1 hiding sets the deferral flag `0x2` (`0x76ad50`); while set, an invalidate marks the frame pending and passes it to its dependents without a resolve (`0x768178`). Show resolves it first (`0x76ae58`), a getter resolves a pending one and fires `OnSizeChanged` inside the read (`0x7a1980`, `0x76b580`), and an anchor read pulls it for good (`0x7a2fc0`). `GetWidth` answers the set size when non-zero, else the rect span, unscaled (`0x7a1e93`, `0x7a1ee6`).

The deferral is modelled for frames and regions, getters fire inside the read, layout ids mint in handle order (deterministic), and the options window measures its scroll by its edges.

Tests bite on the parent; the verifier is green; stock quads match.

Fixes #948
Fixes #971

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 11:06:04 +07:00
Sam Sung 45b7914c9e The stock login screen logs in; realmd 0x0E is a success (#970)
Under `WOW_GLUE_STOCK=1` the stock login screen now logs in. Separately, realmd's 0x0E answer was refused by the native login too.

In 1.12.1 the glue manager runs the screen states (`0xb41da0`): `DefaultServerLogin` (`0x46afb0`) needs the agreements accepted and opens the status dialog; each tick re-texts it from the logon's state and result (`0x46b140`, tables `0x836b40`, `0x836b78`); the world connect re-texts it every frame (`0x46be8b`). The agreements seed from `readTOS`/`readEULA` (`0x46a400`). Realmd 0x0E is a success (`0x5b2cd4`); a proof's 0x0A changes nothing (`0x5bada2`).

The glue core verbs, the glue manager over the native login, the agreement CVars, `SimpleHTML file=`, case-insensitive loose files and a benilla Realmlist layer file are built; the protocol accepts 0x0E. A recorded `Deviation:` keeps the interface signature checks off.

Tests: fake-realmd refusals and 0x0E; stock-screen login reaching the native submit.

Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 10:28:08 +07:00
Sam Sung 133414f5c1 WOW_GLUE_STOCK=1 loads and draws the stock GlueXML (#969)
With `WOW_GLUE_STOCK=1` (dev builds), benilla now loads the stock GlueXML off the player's own patch chain into the glue state and draws it; with the switch off nothing changes.

In 1.12.1 the glue builder (`0x46a7b0`) opens `Logs\GlueXML.log` (`0x46a8ce`), runs `GlueXML.toc` through the shared toc runner (`0x6edb90` at `0x46a9b3`), fires `FRAMES_LOADED` (`0x46aa34`) and opens on "login" or "movie" (`0x402b3b`), or "charselect" back from the world (`0x402084`). Glue `GetScreenWidth`/`GetScreenHeight` answer the root unscaled (`0x46dd30`, `0x46dd80`).

Under the switch the glue state replaces the boot state, takes input, and fires `SET_GLUE_SCREEN` on those edges; the native screens are hidden but still drive the network. A data-gated test loads the stock files with only seven unbuilt verbs raising, a list that may only shrink.

Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 08:40:34 +07:00
Sam Sung 51a2ce5586 Layout writes invalidate as 1.12.1 does; only a reached node re-resolves (#964)
The solver took any node's recomputed rect whenever it resolved, because about 55 layout writes named a node without invalidating it. So a freed region stayed in its dependents' anchors, `SetTexture` re-resolved a failed texture, and a scroll child kept its authored anchors behind a per-solve override.

In 1.12.1 a node re-resolves only when invalidated or a target stores a new rect (`0x768d20`, slot 0 `0x768cf0`). `SetTexture` only dirties the draw (`0x770200`). A destructor frees its dependents' anchors to it (`0x768e20` → `0x767e70`, no invalidate). A scroll child is re-anchored to one TOPLEFT (`0x787100`).

Every write now invalidates exactly where the reference's does, and the solver's guess, the hold and the art latch are gone. The tooltip invalidates only on its relayout (`0x530640`).

Tests bite on the parent; the verifier is green; the stock UI's quads are byte-identical.

Fixes #947
Fixes #949
Fixes #958

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 07:46:24 +07:00
Sam Sung a9dd325bb7 A glue Lua state with the reference glue surface, events and ModelFFX (#963)
The first piece of running the stock GlueXML: benilla had no glue Lua state, and no reference data for its surface.

In 1.12.1 the glue state holds the base set (`0x7039e0`) and seven registrars (`0x46abb0`): 119 functions, 105 of them glue-only, with 26 glue events (`0xb41e70`, `0x46a88f`). `RegisterEvent` matches names case-insensitively and drops an unknown one (`0x702140`). The glue builds the 13 base frame types plus `ModelFFX` (`0x46a4fe`), a Model with its own show and paint (`0x46fa00`); the in-game types come only at world entry (`0x495940`).

`reference/` gains the glue event and surface tables, generated and checked against the shapes table. `UiScript::new_glue()` builds that state; a gate holds its globals to the table, with the 108 unbuilt names listed. Nothing in the app changes yet.

Part of #856

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 07:38:02 +07:00
Sam Sung 985dabff44 Layout-mode drag, title press takes the slot, links are their own button (#961)
A title-region press refused while another drag held the slot, `SetLayoutMode` stored nothing, and a press on a chat link made the chat frame itself the target, so every link click started a title move of the window.

In 1.12.1 the drag entry takes the slot unread (`0x7652b0`); a mid-drag press goes to the frozen hover (`0x76637f`). With `SetLayoutMode` (`0x488540`) on, a Ctrl or Alt press drags the nearest movable toplevel (`0x765490`) from a 3×3 grip grid (`0x765320`) and is consumed, world included; its release only ends the drag (`0x7664e0`). Each link span is its own Button (`0x7a3240`) routing `OnHyperlinkEnter`/`Leave`/`Click` to the parent (`0x7a3780`–`0x7a37e0`).

These now hold; a release goes to the capture whatever its button (`0x76642b`), and number arguments keep `_ftol`'s low dword.

Tests bite on the parent for each.

Fixes #951
Fixes #952
Fixes #957

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 07:22:54 +07:00
Sam Sung 108c354fc6 Text measures by the reference kernel: kerned steps, ink tail, no pad (#956)
Text measured `ceil(sum of steps) + 1`: no kerning, float advances, the last glyph priced by its step, and no outline or shadow lead.

In 1.12.1 the kernel (`0x5c6940`) seeds a line with the outline lead plus the shadow (`0x5c69c0`, `0x5c69a4`), steps each glyph by `ceil(floor(adv) + 1 + min(kern, 0))` on FreeType's 26.6 advances (`0x5ca2d0`, `0x5d1298`), prices the line's last glyph by its ink (`0x5c6b70`, `0x5cb080`) and carries the previous glyph across a break (`0x5c6aa0`). The draw rows use the same law, shadow-seeded, wrapping at `ceil(width)` (`0x5c7470`, `0x5cddb1`).

The measure, the wrap, the justify and the EditBox now follow it, reading the face's own metrics, kerning and composite build (`0x7d40e6`).

Tests pin widths computed outside the code base from FRIZQT and ARIALN at 12–34 px, with and without outline and shadow.

Fixes #427

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 06:27:55 +07:00
Sam Sung 5af22799d0 A drag pins one TOPLEFT anchor at the frame rect, as in 1.12.1 (#953)
A drag kept the frame's authored anchors: `GetPoint()` answered them afterwards, the frame kept following its old target, and a resize grip on a CENTER- or TOPLEFT-anchored frame moved the wrong edges.

In 1.12.1 every drag enters at `0x7652b0`, whose first act pins the frame (`0x768430`): `ClearAllPoints`, one TOPLEFT on the screen root's TOPLEFT at the current rect, and an explicit size. The pump `0x768710` moves that anchor (case 4) or, for each of the eight grips, computes the clamped size and re-pins shifted by the left and top travel only (`0x76898a`). A frame with no rect starts no drag (`0x7652cd`).

Drags now pin and pump that way, with one drag slot; `StartSizing` defaults to BOTTOMRIGHT (`0x776913`).

Tests: the pin and `GetPoint` after a drag, the eight grips on a CENTER-anchored frame, the clamps, the layout cache round trip, and stock chat-window resize and off-screen drop.

Fixes #173

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 05:57:59 +07:00
Sam Sung aff59fd55b ClearAllPoints keeps the rect; a failed resolve reaches nothing (#950)
`ClearAllPoints` invalidated the node, so an anchorless frame lost its rect at once, with everything anchored to it, and any region whose resolve failed stopped drawing.

In 1.12.1 `ClearAllPoints` (`0x7a2b70` → `0x767620`) only frees the anchors, queuing no resolve, so the rect stands. Only the node's own invalidate re-resolves it; a failure (`0x768d20` at `0x768d55`) clears the valid bit and skips slot 0, so its dependents keep their rects. A Texture keeps drawing its last vertices (`0x7706e0` checks only its texture); a FontString stops (`0x773080`, `0x7730b7`). A new string, font or spacing forces a store (`0x771ea4`).

Each node now carries an entry state, and takes a recomputed result only when invalidated or a target stored a new rect; a failed Texture's last quad is kept, and the full derive and the incremental pass read the same state.

Tests bite on the parent; the verifier is green.

Fixes #942
Fixes #943

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 05:36:21 +07:00
Sam Sung 75edfd7ca5 SetFont gates as 1.12.1 does; SetSpacing on every text table (#946)
`SetFont` raised on a `false` flags argument and wrote the height even when the load failed, and only SimpleHTML had `SetSpacing`/`GetSpacing`, so SpellAlert's message frame raised in its OnLoad.

In 1.12.1 `SetFont` (`0x79f210`, the FontString's `0x79d4f0`) reads flags only when `lua_isstring` (`0x79f287`), writes them on every successful load (`0x79f334`), and writes nothing on a failed load or a height ≤ 0 (`0x79f361`, `0x79f2f4`, `0x771571`). Every text table has the spacing pair (`0x79fb40`/`0x79fbe0`; the FontString's clamps at `0x772240`); the line step adds the gap rounded up to a device pixel (`0x5c2070`, `0x5cdc20`), as do the message frames (`0x78899e`, `0x785f06`) and EditBox rows (`0x77d133`).

All seven SetFont bindings share these gates and ask the host's font probe; spacing is stored, inherited, measured and drawn on all six tables.

Tests bite on the parent for each.

Fixes #873
Fixes #692
Fixes #945

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 05:13:09 +07:00
Sam Sung 87bf5904ff A region keeps its own name; only the name lookup is first-come (#944)
Region names lived in one first-wins name → id map that also served `GetName`, so a second region given a taken name answered `GetName()` with nil and was `<unnamed>` in its error strings.

In 1.12.1 the name lives on the region: `SetName` (`0x76c650`) keeps the region's own copy at `[+0x98]`, freed by its destructor (`0x76c560`) and read back by `GetName`. Only `_G` is first-come (`0x701bd0`, `0x701c8a`).

Each region now carries its name; `GetName` and the error strings read it directly, and the name map is a first-come lookup only, whose entry a free drops only when it holds that region.

Tests: same name twice, `$parentText` under colliding parents, the second region's error string, a free leaving a same-named sibling's name.

Fixes #939

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:17:03 +07:00
Sam Sung 73623e31fa Hover walk: no arg1, held during a move, no fling, published mouseover (#941)
Four pointer defects: OnEnter and OnLeave set `arg1 = true`; a frame being moved or sized still ran the hover walk; the pointer leaving the window fed `f32::MIN` to a move in flight, flinging the frame off-screen; and the mouseover token read the world pick, not the published mouseover.

In 1.12.1 both scripts run through `0x702690`, which sets no arg global. While `[root+0xcfc]` holds a move or size target, the walk pumps it (`0x7655b0`) and returns before any probe (`0x766164`–`0x7661a0`); a hide clears that slot (`0x76492e`). The pump only sees real cursor events. The token resolver reads the published pair `[0xb4e2c8]` (`0x515970`).

OnEnter and OnLeave fire with no arguments, `mouse_move` pumps a move or size and returns, a hide ends it, the pointer leave has its own call, and the aura feed reads the published mouseover.

Tests bite on the parent for each.

Fixes #932
Fixes #933
Fixes #936
Fixes #938

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:08:29 +07:00
Sam Sung 0fc40d3f87 An XML state texture installs a fresh region, as in 1.12.1 (#940)
An XML state texture on an instance over a template went through the Lua path leg, which reuses the populated region, so the template's TexCoords, size, tint, blend and anchors stayed on the new art.

In 1.12.1 `Button::LoadXML` (`0x7788c0`) builds a fresh region for each state tag through the `<Layers>` adder (`0x6f26f0`) and hands it to the slot store (`0x778fd0`, `0x779110`; the checked pair `0x785330`, `0x785440`), which destroys the region it held. A fresh region has TexCoords 0..1 and BLEND (`0x76fc40`, `0x76fc64`), and an XML highlight keeps its own blend (`0x7789a4`).

The XML leg now builds the region as a `<Layers>` texture and installs it, freeing the old one; the Lua leg is unchanged. An XML highlight with no `alphaMode` now draws BLEND.

Tests: all six tags on a CheckButton template, the name kept, the Lua leg's region kept.

Fixes #875

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:59:14 +07:00
Sam Sung 3bfec89085 A template name registers once, case-folded, as in 1.12.1 (#937)
A FrameXML template registered under a name already taken replaced the first, nothing was logged, and names differing only in case were stored twice.

In 1.12.1 the registrar `0x6ee500` folds case (`0x64b3f0`, `0x64a4c0`) and keeps the first entry, logging "Virtual object named %s already exists" (`0x871188`), unless the old entry carries a non-zero script context and the new one zero (`0x6ee594`). The stock files load at context 0; `AddOn_Load` (`0x51f240`) loads an addon under its name unless its signature checked SECURE (`0x51dbfb`).

Templates are now keyed case-folded with their context, an addon's load sets the context, an addon counts as secure only from the player's own data with `## Secure: 1`, and the refusal and the unnamed-node line (`0x871020`) reach FrameXML.log.

Tests: duplicates and case variants refused, the context rule, the log lines.

Fixes #556

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:36:57 +07:00
Sam Sung 6fff0fa7a1 Hover leaves publish the world mouseover loss before the next OnEnter (#935)
Moving from the world onto a window, the world mouseover's loss reached the tooltip a frame after the window's OnEnter, so a gate kept the fade off any tooltip the world had not put up.

In 1.12.1 the hover walk runs the old frame's leave before the new frame's enter (`0x766229`, `0x766239`). The WorldFrame's leave (`0x483b10`) runs OnLeave, then publishes the empty mouseover, whose publisher fades GameTooltip whoever holds it (`0x492890` → `0x530ae0`). A nameplate's leave publishes first (`0x7cb8b0`); the Minimap's hides the tooltip (`0x4eb880`), and its probe drops a held blip on a miss (`0x4eb0c0`).

The VM now holds the published mouseover and runs these leaves in the walk, the hide and every mouse disable, freelook's plates included (`0x60f830`); the ownership gate is gone.

Tests: OnEnter no longer sees "mouseover", an addon tooltip fades on a change, blip and Minimap leaves hide it.

Fixes #901

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:28:42 +07:00
Sam Sung 377542daeb One anchor slot per point; SetPoint skips an unchanged anchor (#934)
Anchors were a list: SetPoint re-applied an unchanged anchor, GetPoint counted in the order points were set and answered five nils past the last, and the cursor tooltip replaced every anchor each frame.

In 1.12.1 a frame holds one anchor per point. SetPoint (`0x767c70`) returns at `0x767d5e` with no store and no layout queue when that point's anchor has the same target and relative point and both offsets differ by under 2⁻²² layout units (`[0x8029d4]`). GetPoint (`0x7a2340`) walks the nine slots in point order and pushes nothing past the last (`0x7a240d`). The `ANCHOR_CURSOR` update sets BOTTOM alone (`0x530b20`).

Anchors are now nine slots, and SetPoint, GetPoint and the cursor update follow those rules.

Tests: an unchanged re-set and an in-threshold offset touch no layout, GetPoint order and indexes, a cursor tooltip keeps an addon's second point.

Fixes #926
Fixes #131
Fixes #879

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:19:11 +07:00
Sam Sung af281a05f7 A drag starts at 1% of the screen diagonal, as in 1.12.1 (#931)
A drag started past a fixed 4 pixels from the press. In 1.12.1 the threshold is 0.01 layout units, where the screen diagonal is 1: `0x76b300` stores `0.01f × 0.01f` (`0x81c468`) as an f32, and `0x76b320` starts the drag when the squared distance from the press point is not below it, comparing at x87 double precision. The converters `0x425610`/`0x425710` scale the cursor into those units (`0x41ad80`).

The drag test now divides both points by the layout unit and compares the squared distance in f64 against the f32 threshold. At 1024×768 a drag needs 12.8 px, at 1920×1080 about 22 px; the UI scale does not change it.

Tests: just under and over 1% of the diagonal, 12 and 13 px at 1024×768, the exact f32 boundary, two screen sizes and three UI scales.

Fixes #157

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 02:51:42 +07:00
Sam Sung a2825a185f A second button pressed mid-drag re-arms or keeps it, as in 1.12.1 (#930)
Any press during a drag abandoned it with `OnDragStop`, so touching the right button while dragging an item or a window with the left stopped the drag.

In the reference, each press on the capture runs the drag arm: a button in the frame's drag mask re-arms it, started back to 0, with no `OnDragStop`, and any other button leaves the drag running. The release of a button in the mask ends a started drag with `OnDragStop`, or disarms an unstarted one. `OnDragStart` names the lowest held button.

Presses now re-arm or leave the drag as the reference does, the release tests the released button against the mask, and `OnDragStart` names the lowest held button. A release the client lost still stops the drag.

Tests cover a right press on a left-only drag, a re-arm, the first release after it, an item drag and the start's button.

Fixes #924

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 02:33:54 +07:00
Sam Sung 56f7fa003a A resolve keeps a rect that moved under 1.12.1's 1e-5 threshold (#929)
Every resolve stored the rect it computed, however small the move, so float noise in anchor chains moved rects, hit edges and size-change notifications where the reference keeps the old ones.

In the reference, the layout drain compares each of a node's four new edges with the rect it last stored. If every edge moved less than 1e-5 in its units (where the screen diagonal is 1), it keeps the stored rect and skips the store, its dependents and `ApplyRect`. A scale change, a new font or new text clears the resolved bit, so the next resolve stores without the test.

A resolve now keeps a frame's or region's rect under that threshold, scaled by the layout unit, and a scale change or a new measure stores the exact rect.

Tests cover jitter, a move just over, slow drift, a region and the forced stores.

Fixes #919

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 02:26:23 +07:00
Sam Sung b0ad656aaa A drag release fires OnDragStop and the drop, not OnMouseUp (#928)
A release that ended a started drag fired the frame's `OnMouseUp` before `OnDragStop`, so a frame that both drags and acts on mouse-up ran its mouse-up action at the end of every drag.

In the reference, the mouse-up first checks the frame's drag registration for the released button and its started drag: if both hold it fires `OnDragStop` and the hover frame's `OnReceiveDrag`, and returns before `OnMouseUp`, which only a release without a started drag reaches.

The release now follows that: a started drag fires `OnDragStop` and the drop in `OnMouseUp`'s place, and any other release fires `OnMouseUp` as before.

Tests cover a drag, a plain click, a button the frame is not registered to drag, and a resize grip.

Fixes #920

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 02:16:00 +07:00
Sam Sung eec1804d37 Chat bubbles are WorldFrame child frames, as in 1.12.1 (#925)
Chat bubbles were quads drawn straight into an overlay with no widget behind them, so `WorldFrame:GetChildren()` never returned them and bubble-skinning addons such as pfUI's found nothing.

In the reference, a bubble is an anonymous Frame under WorldFrame from a reused pool: eleven regions (the nine backdrop pieces, the tail, the text in the `NAMEPLATE_FONT` global), the text's bottom on the speaker's projected point, its own fade, and an OnShow on each reuse. It fades out and hides when the speaker is out of range or was not drawn last frame.

Bubbles are now built that way, fed by the app and drawn by the frame pass; the overlay path is gone. Item links show their bare names, and a speaker behind the camera fades out.

Tests cover the child, its regions, a pfUI-style skin, reuse and the fades.

Fixes #884

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 02:06:36 +07:00
Sam Sung d65fd19095 OnClick fires on release while the button is still PUSHED, as in 1.12.1 (#923)
A Button release un-pushed the button before `OnMouseUp` and `OnClick` ran, so both read NORMAL. A plain click on a floating chat tab then took the pick-up branch and left the window following the cursor.

In the reference, the mouse-up handler fires `OnMouseUp` first, then reads the state: a PUSHED button with the cursor inside it and the Up registration fires `OnDoubleClick` or `OnClick`, and only then is it set NORMAL, unless locked. A failed gate still un-pushes; an `OnMouseUp` that un-pushes cancels the click.

The release now runs that order after `OnMouseUp`, with the started-drag skip kept.

Tests read the state inside each handler and drive the stock chat tab.

Fixes #699

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 01:52:46 +07:00
Sam Sung ff3d15b132 The tick drains the layout around the walk; size gates in layout units (#922)
The tick ran the OnUpdate walk without resolving the layout around it, so a resize made in an event handler fired `OnSizeChanged` after the walk, and some walk slots resolved on their own to compensate. Separately, `OnSizeChanged` gated on 2⁻²² in benilla's units, and an emptied FontString kept its old measured box in the incremental layout.

In the reference, the pump drains the layout queue before the walk and again after it, each drain firing `OnSizeChanged`, then re-picks the hover. ApplyRect compares sizes against 2⁻²² in its own units, where the screen diagonal is 1.

The tick now drains before and after the walk and drops the stand-in resolves. Size gates scale 2⁻²² by the layout unit, and a FontString's text going empty or back names it on the layout when its node changes.

Tests pin each.

Fixes #912
Fixes #741
Fixes #914
Fixes #911

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 01:46:42 +07:00
Sam Sung 935b465c76 Button state textures have one shown bit; widget setters take 1.12 forms (#917)
A Button state texture's visibility was kept apart from its region's shown bit, so a script `Show()` on a non-current state texture drew nothing. The bar, thumb and ColorSelect setters took a colour form and accepted arguments the reference rejects, the loader built their textures from `file=` or `<Color>` alone, and a bar texture answered nil to `GetTexCoordModifiesRect`.

In the reference, a region has one shown bit that `Show`, `Hide` and the state switch all write. The setters fork on object, path, nil or usage. The loader builds each widget texture as a full Texture element, and installing a bar texture sets its texcoord flag and gives it all points.

All of these now match: one shown bit, the reference's argument forms, full-element textures with their names and texcoords, and no tint without a bar.

Tests pin each.

Fixes #909
Fixes #908
Fixes #575

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 01:21:22 +07:00
Sam Sung fa5568dcdc Creating or freeing a frame or region re-derives only what it touches (#915)
Any write that changed the layout graph's roster (a frame or region created, freed, re-owned or re-pointed) made the next resolve derive the whole graph: about 1.35 ms for one `CreateTexture` or `CreateFrame` on the stock UI, against 0.05 ms for a no-op.

A write now names the nodes it touched, and the resolve re-derives just those in the cached graph: a joining node is added with its edges, a leaving one is removed and its dependents seeded, a staying one has its edges and inputs re-synced. The full derivation stays the fallback. A region's owner and an art change are now layout inputs that name their region. Verify now also compares the graph itself.

A randomized test checks rects and graph against a scratch solve after every batch of creates, frees, re-owns and re-anchors. `CreateTexture` now costs 0.14 ms, `CreateFrame` 0.15 ms, a backdrop rebuild 0.22 ms.

Fixes #903

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 01:05:23 +07:00
Sam Sung 55729baff9 Message fades and scroll ranges run in the walk; OnUpdateModel gates (#913)
Hidden chat frames kept fading their lines, a scroll frame recomputed its range on every read and fired `OnScrollRangeChanged` on every `UpdateScrollChildRect`, hidden or not, and `OnUpdateModel` fired for panes with no size or off screen.

In the reference, each of these runs in the frame's own update slot, only while shown: message frames trim and fade there; a scroll frame recomputes a range its writers marked, stores it and notifies only on a real move. The model paint fires only for a resolved rect whose screen-clamped viewport has size.

Message frames and scroll frames are now walk kinds, the range is stored and marked, and the paint applies the rect and viewport gates. benilla's options scroll measures its body's own overhang.

Tests pin the hidden fades, the stored range and its notify, and the paint gates.

Fixes #182
Fixes #175
Fixes #892

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:25:14 +07:00
Sam Sung 016f08b56f A texture handed to a widget's setter moves in on the setter's layer (#910)
A texture object handed to a widget's texture setter stayed on its old frame and layer: Button and CheckButton slots only stored it, and StatusBar, Slider and ColorSelect ignored a texture object altogether.

In the reference, each setter deletes the slot's old texture and re-links the new one into the widget: Button states on ARTWORK, the highlight on HIGHLIGHT with its blend, checked textures, thumbs and markers on OVERLAY, the bar on the given layer. The link writes the texture's shown bit, and the old parent's removal hook runs. Thumbs and markers lose their anchors.

All these setters now go through one install that re-links through the region owner path and writes the shown bit; a non-current state texture answers `IsShown()` nil until its state comes, and the raise texts are the client's.

Tests cover each setter, both shown-bit directions and the backdrop teardown.

Fixes #902

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 00:12:55 +07:00
Sam Sung 0df676394e GameTooltip's fade, owner and health bar follow the 1.12.1 lifecycle (#907)
GameTooltip's lifecycle took shortcuts the reference does not: a 0.5 s linear fade armed once, a fade cancelled by new lines, cursor-anchored plates that faded instead of hiding, a SetOwner that never hid first, the last anchor kept after a hide, and a health bar shown and hidden without its handlers.

In the reference, FadeOut re-arms a 2 s countdown that holds full alpha for half and then ramps, or hides at once at the cursor anchor. Only the owner core, the show and FadeOut write the fade. SetOwner runs the tooltip's own hide first. The un-own leaves ANCHOR_NONE. The clear hides the bar through its own transition.

Every builder, verb and world or minimap seat now goes through these functions; an uncached item hides and un-owns as in the reference.

Tests pin each of these.

Fixes #889
Fixes #134
Fixes #896
Fixes #893
Fixes #895
Fixes #843

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:33:17 +07:00
Sam Sung b63d6e3609 A raise's level compaction stops at the stratum's visible high-water (#906)
A raise's level compaction counted and packed every level any frame of the stratum held, hidden or shown, so a frame given a high level while hidden was pulled down and later showed under a dialog it should cover.

In the reference, each stratum keeps a level bound that grows only when a visible frame links into a level, and the compaction examines and moves only the levels below it, then sets the bound to its count, which the raised frame takes. A frame above the bound keeps its level.

The arena now keeps that bound per stratum, grown on every visible link and set by the compaction, which packs only below it.

Tests cover the hidden frame above the bound and a high show raising the bound for the next raise.

Fixes #885

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 23:25:49 +07:00
Sam Sung 4e0011bdd7 Backdrop pieces are nine Texture regions on the frame, as in 1.12.1 (#905)
A backdrop was data drawn in the frame's own slot, so `GetRegions` and `GetNumRegions` never saw its pieces, and addons that skin by walking a frame's regions missed them.

In the reference, installing a backdrop creates nine Texture regions on the frame: the background on BACKGROUND, then eight border pieces on BORDER, linked into its region list in that order. A resize re-runs their texcoords and colours, and the colour setters tint the background or the border alone.

The pieces are now real regions, drawn through the region path, so edges draw over another frame's BACKGROUND at the same level. `<Layers>` and `<Backdrop>` load in document order. A region leaving its parent empties any Button, CheckButton, StatusBar, Slider or ColorSelect slot holding it, and a dead layout node now seeds only its dependents.

Tests pin the order, colours, resize, teardown and stock quads.

Fixes #883

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:10:33 +07:00
Sam Sung 9be2802f39 Flag predicates answer 1 or nil, and the gate now sees them all (#904)
Fourteen bindings answered Lua `true`/`false` where 1.12.1 pushes the number 1 or nil: the loot slot, resurrect and distance predicates, the talent flags (`isExceptional` read 0, which is true, for every ordinary talent), the cursor predicates, and `GetLootRollItemInfo`'s bind flag, whose count also echoed the stack size where the reference answers 1. `GetRepairAllCost` returned two values with no vendor open, and `GetLootRollItemInfo` a sixth value.

The reference pushes 1 or nil for each and returns exactly the values its catalogue row records.

All of them now answer through `binding_abi::flag`, and `GetRepairAllCost` answers the one value 0 unless a repairing merchant is open. The boolean gate, which missed these, now probes every row whose kinds are nil or number whatever its name or arity confidence, over seeded talent and roll state.

The widened gate fails on the parent for all fourteen.

Fixes #159
Fixes #900

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 23:02:34 +07:00
Sam Sung a1130c693a Mouse disable drops the press; a chorded press goes to the held frame (#899)
`EnableMouse(false)` only flipped the bit, so a frame disabled while pressed still got OnMouseUp and OnDragStart, and a hovered one kept its hover. A second mouse button pressed while one was held fired on the frame under the cursor rather than the held one.

In the reference, a mouse disable on a visible frame runs the same removal a hide does: the capture and the press drop, the hover ends with OnLeave at once. The down handler takes the held capture first and fires there, and a Button clicks on release only while PUSHED and with the cursor inside its own rect.

`EnableMouse` now runs that shared removal, the drag arm included. Presses go to the capture when one is held, and the Button release tests pushed and inside rather than topmost.

Tests cover a disable while pressed or hovered, chorded presses and the release gate.

Fixes #886
Fixes #887

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 22:37:01 +07:00
Sam Sung 07d8c8d4cf Kind updates run in the frame's walk slot; OnUpdateModel in draw order (#897)
The tooltip fade, a model's animation clock and its OnAnimFinished ran after the whole OnUpdate walk, and OnUpdateModel fired in creation order. A tooltip hidden through its parent also kept its owner and fade.

In the reference, the walk makes one call per frame: its OnUpdate, then its kind's engine update (a tooltip's fade step, a model pane's clock and completion test). OnUpdateModel fires later, from the paint, in draw order. A tooltip's own hide and show run from any caller, its parent's cascade included: the hide un-owns and clears it; the show needs an owner.

The walk now runs a per-kind update in each frame's slot, OnUpdateModel fires per stratum in draw order after the hover re-pick, and show and hide dispatch to a kind's override. CharacterModelBase's override is left for #890.

Tests pin each order and a parent's hide and show.

Fixes #861
Fixes #863
Fixes #864

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 22:20:26 +07:00
Sam Sung 46512dc5b5 A ScrollFrame builds its ScrollChild before its Frames and OnLoad (#894)
A ScrollFrame built its `<ScrollChild>` after its `<Frames>` children and so after their OnLoads: under a scroll frame template, the template's scroll bar loaded before the instance's scroll child, and an OnLoad that read the other frame saw it unbuilt.

In the reference, the ScrollFrame's load runs the base load, then builds the scroll child with its whole lifecycle and its own OnLoad, then stores it as the scroll child, all before the post-load hook builds `<Frames>` and fires the ScrollFrame's OnLoad. A template's scroll child is built at the template's level, ahead of the instance's, which wins.

The loader now builds `<ScrollChild>` in that place, on the one path XML and `CreateFrame` share, and only for a ScrollFrame.

Tests cover the order directly, through a template, and with a scroll child in both template and instance.

Fixes #846

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 22:11:58 +07:00
Sam Sung de17e48247 A level compaction relinks the moved frames in creation order (#891)
Raising an overlapped toplevel frame compacts its stratum's levels, and benilla wrote the new levels directly, so the moved frames kept their old link order: which of two frames on one level draws on top, takes the click and runs its OnUpdate first did not change as in 1.12.1.

The reference's compaction moves each frame of a shifted level through the non-propagating level setter, levels from the bottom and each in creation order, and the setter relinks a visible frame at its level's tail. So a shifted level's visible frames end in creation order.

Compaction now moves each frame through `set_frame_level` the same way, in that order; frames carry a creation stamp, since arena order is not creation order once a slot is reused.

Tests cover the relink order, the swapped draw and hit order after a raise, and a mid-walk raise.

Fixes #862

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:58:46 +07:00
Sam Sung 481cc8870e A hide drops the press and capture; only a mouse frame's show re-picks (#888)
A frame hidden while a button was pressed on it still got OnMouseUp on the release, and its stale capture aimed the next chorded press at it. And showing any frame, even one that takes no mouse input, scheduled a hover re-pick, so a still cursor could fire OnEnter or OnLeave a tick early.

In the reference, the hide's input-index removal clears the capture slot when it holds the hidden frame, and the release goes only to the capture, so it reaches no one. The hover re-pick is armed only when a show inserts a frame into the mouse index.

The hide now drops the capture and the pressed frame; the release then runs nothing, no world click either. A show arms the re-pick only for a frame that takes the mouse.

Tests cover hides while pressed and shows with and without mouse input.

Fixes #844
Fixes #845

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 21:50:57 +07:00
sindoring ad4749ac26 Sync upstream UI fixes through c0630f3d
Integrate six upstream fixes while retaining MoonWell and ruRU changes.

Verified on Windows: fmt, clippy, workspace tests with real 1.12.1 data and
without an install, doc links and render-pass lint. The 31 optional addon
corpus cases are absent. Player tests and engine boot checks are running
before this branch lands.
2026-10-11 18:47:47 +04:00
Sam Sung c0630f3d9d check.sh and gates.sh report every failing test, not the first crate's (#869)
`cargo test` stops at the first test binary that fails, so a red `scripts/check.sh` or gate run showed one crate's failures and hid the rest: the next run found more. Both scripts now pass `--no-fail-fast`, so one run reports every failing test across the workspace. The exit status is unchanged: any failure still fails the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:53:35 +07:00
Sam Sung 16affa8d45 OnUpdate walks strata, level and link order, as 1.12.1 does (#868)
OnUpdate ran in frame-creation order, from a list built before the walk, so a frame hidden by an earlier handler still updated, and strata and level played no part.

The reference's update walk `0x765650` goes through the nine strata from the bottom, each stratum's levels from 0, and each level's list oldest link first. It saves the next frame before each call, so a hide skips a frame before its turn. A frame linked into the level being walked waits a tick; one linked into a level still ahead runs there.

The walk now follows that order, using the link stamps shows and level changes already keep. It checks each frame at its turn and places frames linked or given an `OnUpdate` mid-walk. An EditBox still flushes right after its own `OnUpdate`.

Tests cover the order, mid-walk hides and shows, and a box's flush.

Fixes #742

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:46:15 +07:00
Sam Sung c9ddd80342 Script errors reach the error handler bare, as 1.12.1 hands them (#865)
Script errors reached the Lua error handler as mlua's display text: a `runtime error: ` word and a `stack traceback:` block, which overflow the stock `ScriptErrors` dialog. And a raise in a `CreateFrame` template's OnLoad was logged as a warning and never reached the handler at all.

In the reference, handlers run under `lua_pcall` with the error function `0x703b40`, which calls the `seterrorhandler` function with the bare message. `CreateFrame` builds its template through the XML instantiator `0x6ee280`, whose OnLoad runs under that same function (`0x704d50`).

Now every caught error records two texts: the decorated one for benilla's log and the bare message for the handler. A load report pairs the two per row, and `CreateFrame` records its template's errors as script errors.

Tests: the handler hears bare messages from handlers, and a template OnLoad raise reaches it.

Fixes #697
Fixes #859

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 19:12:21 +07:00
Sam Sung f356e90fe6 Addon files resolve case-insensitively, as on 1.12.1's Windows client (#860)
An addon's Lua and XML files were read with the exact case its `.toc` or `<Script file>` spelt. On a case-sensitive filesystem, Linux's, a file named in another case never loaded: Questie 3.7.1 lists `Astrolabe\Astrolabe.lua` from a folder shipped as `astrolabe`, so `Astrolabe` stayed nil and its OnUpdate raised every frame.

The reference is a Windows client, and every path it opens matches without regard to case. Addon textures and sounds already resolved that way through `loose_addon_file`; addon scripts, XML and `Bindings.xml` now go through the same resolver, and the second, case-sensitive one is gone. The shared resolver also refuses a component the host reads as more than a plain name (a Windows `C:`), so it still cannot leave the AddOns root.

Test: a file asked for in three spellings resolves to the one on disk; it fails without the change on a case-sensitive volume.

Fixes #851

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:35:06 +07:00
Sam Sung ff49eb5b8f UNIT_FACTION fires on the faction template's own edge (#858)
A target whose faction template the server swaps live (35 to 14, neither naming a faction group) kept its friendly plate colour: `UNIT_FACTION` fired only when the pvp, FFA, faction-group or tapped state moved.

The reference's per-field watch fires `UNIT_FACTION` on any change of `UNIT_FIELD_FACTIONTEMPLATE`, as it fires `UNIT_FLAGS` for that field. `fire_transitions` now also fires it on the faction template's edge.

Test: `a_live_faction_template_change_recolours_the_target_plate`.

From #855 by @kalistoking, landed here because the fork refuses maintainer pushes.

Co-authored-by: kalistoking <148718830+kalistoking@users.noreply.github.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:32:43 +07:00
elipp 45da0a0850 Optional feature to enable bevy/dynamic_linking in crates/benilla-app (#853)
- Add bevy/dynamic_linking feature forward for benilla-app for faster dev builds
- bevy_dynamic_linking says the binary starts only through cargo run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-11 17:05:21 +07:00
Sam Sung 710eb8f531 Dev builds drop ThinLTO; dev and play build dependencies as one unit (#857)
An incremental rebuild of `benilla-app` spent most of its time in ThinLTO: above opt-level 0 rustc runs it over a crate's own codegen units by default, and incremental compilation redoes it whole. `cargo play` already turns it off, which left its dependencies without cross-unit inlining.

`[profile.dev]` now sets `lto = "off"`, and dev and play build dependencies as one codegen unit each.

Measured on an M4 Max, one-constant edit in `benilla-app`, cpu_ms at the leg pin:

| | before | after |
|---|---|---|
| `cargo build -p benilla` | 24.4 s, 5.2 GB | 5.6 s, 2.7 GB |
| `cargo test -p benilla-app --lib --no-run` | 25.8 s, 7.0 GB | 8.3 s, 4.0 GB |
| cold dev build | 5:19 | 4:06 |
| dev cpu_ms | 11.06 | 11.71 |
| play cpu_ms (release: 10.1) | 11.74 | 10.63 |

Release and ship are unchanged.

Fixes #852.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:36:25 +07:00
Sam Sung c2fc3cf304 OnShow and OnHide fire children first, and after OnLoad, as in 1.12.1 (#842)
Show and hide propagated a whole subtree first, then fired from a snapshot, parent first: a parent's `OnShow` ran before its children's, and a child hidden by an earlier handler still got its `OnShow`. A frame visible at the end of its load got no `OnShow` at all.

In 1.12.1 show `0x76ae10` and hide `0x76ad50` mark the frame, walk the live child list re-checking each child's gate, and fire the frame's own handler last (`0x76aef5`, `0x76adfd`). The post-load hook fires `OnShow` after `OnLoad` for a visible frame (`0x76a3b3`), from XML and `CreateFrame` alike.

Now handlers run inside a live post-order walk, and the post-load `OnShow` fires. Tests cover the order, a sibling hidden mid-walk, and one or two `OnShow`s after a load; they fail without the fix. Four existing tests' expected orders flip to the reference's.

Fixes #350
Fixes #59

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:44:15 +07:00
Sam Sung dc63a06178 The UI scale is UIParent's own scale over a 768-unit root (#841)
The UI scale was folded into the pixel seam, with the root and `UIParent` at scale 1. Frames outside `UIParent` (dropdown menus, need/greed rolls, the world map) shrank with it, `UIParent:GetScale()` answered 1, and `GetCursorPosition()` was off by the scale.

In 1.12.1 the scale is `UIParent`'s own frame scale (`0x494550` → `0x76ac10`, floored at 0.64) over a 768-unit root. `GetScreenWidth`/`GetScreenHeight` divide by it (`0x494590`), and `GetCursorPosition` (`0x48b820`) does not.

Now the seam is `height/768`, and the scale is applied to `UIParent` at the load's end and on a resize. The nameplates' compensation is gone. Backdrops, hit insets and minimap pings now follow a frame's own scale (`0x76b580`, `0x77e8d0`); tooltips at the cursor and `OnCursorChanged` divide by it (`0x530b20`, `0x77db23`). Tests cover each, and a stock-UI comparison shows nothing inside `UIParent` moves.

Fixes #172

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:17:23 +07:00
Sam Sung f0dfa86148 PLAYER_LOGIN fires at world entry, once the player exists (#840)
`PLAYER_LOGIN` fired at the end of the UI load, before the player existed: its handlers saw `UnitExists("player")` nil and level, health and XP 0, at every login and `/reload`. Ace2's `OnEnable` runs there.

In 1.12.1 the load only arms a one-shot (`0x49011d`). The world-enter cascade fires `PLAYER_LOGIN` if armed (`0x49094b`), then `PLAYER_ENTERING_WORLD` (`0x49096a`), inside a sound-suppression bracket (`0x4908d5`–`0x490a56`). It runs from the player's own create (`0x5deb60`), or on `/reload` from the load (`0x490168`) with the player still in the world. A worldport re-arms nothing.

Now the load arms it, and the unit feed fires both, silenced, once the player is seated. A `/reload` loads under the live player and no longer plays the target-select sound. Tests cover login, worldport and reload; they fail without the fix.

Fixes #189
Fixes #191

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:38:06 +07:00
Sam Sung 87706792cb A frame or region takes no name or id from its template (#839)
An instance with no `name=` took its template's name: `framexml::merge` laid the instance's attributes over the template's, so `name` and `id` carried through. Stock `UIOptionsFrame.xml`'s unnamed `<Button inherits="UIPanelCloseButton">` became the global `UIPanelCloseButton`, with `GetName()` answering it, and any unnamed addon frame did the same to its template's name.

In 1.12.1, `PreLoadXML` (`0x769770`) reads `name` and `id` from the instance node before `LoadXML` walks the templates (`0x76985c`). The texture and font string factories also read `name` once, outside that walk (`0x6f2751`, `0x6f27e1`). So neither is ever inherited.

The merge now drops the template's `name` and `id`. Tests cover an unnamed frame, a named frame (no template id), an unnamed texture and `CreateFrame` with a nil name. All four fail without the fix.

Fixes #394

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:18:42 +07:00
Sam Sung d0d1b5def9 WORLD_MAP_UPDATE fires inside the verb that moves the map, as in 1.12.1 (#829)
Reopening the world map after zooming out showed the old map for a frame before the current zone.

In 1.12.1, every Lua verb that moves the map selection (`SetMapZoom`, `SetMapToCurrentZone`, a `ProcessMapClick` hit) goes through the setter `0x4a67a0`. The setter stores the selection, rebuilds the landmark list, then fires `WORLD_MAP_UPDATE` in place before returning (`0x4a6ce4`). So `WorldMapFrame`'s OnShow repaints the tiles before the first draw.

benilla queued the event to the next tick, so the first frame painted the previous map. The three verbs now run the setter whole. The landmark list is projected from per-row sources inside the setter, so the new tiles never show the old map's markers. The engine's own pushes still queue, as a narrowed deviation.

Tests replay the report's steps on the stock UI and check the event fires inside the verb with landmarks rebuilt first; they fail before the fix.

Fixes #811

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:24:25 +07:00
Sam Sung 208b1e0bb0 Your own name stays blue or green in FFA areas, as in 1.12.1 (#828)
In a free-for-all area such as the Gurubashi battle ring, your own overhead name and selection ring turned red.

1.12.1 colours a player's name and ring through `0x605960` by mutual attackability: `CanAttack` (`0x606980`) in both directions. Both true reads red, only theirs soft blue, only yours yellow. Neither splits on PvP: yourself green or blue, a party member pale, others green or blue. `UnitReaction` (`0x6061e0`) answers friendly for a unit toward itself before the FFA rung (`0x606200`), so you can never attack yourself.

benilla stood in a reaction-rank threshold for that matrix, and its reaction lacked the identity rung. The selector is now the reference's four-arm matrix, `CanAttack` runs in both directions, and a unit is friendly to itself. `UnitReaction`, `UnitCanAttack` and the cursor follow for yourself.

Tests pin each arm and yourself in FFA, on the shipped faction templates too; they fail before the fix.

Fixes #814

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:00:24 +07:00
Sam Sung 1c5a568191 Escape on the realm list closes only the list, as in 1.12.1 (#827)
Escape on the realm list closed the list and then also quit the game from the login screen, or went back to login from character select.

1.12.1 walks the keyboard frames once per press, strata high to low, and stops at the first handler that takes it (`0x765f10`, leaving at `0x765f64`/`0x765f86`). The realm list is DIALOG strata (`RealmList.xml:246`), so its Escape never reaches the screen beneath, even though it hides itself.

benilla's list and screens read the keys in no fixed order. A screen only checked whether the list was still shown, and the list's own Escape had just hidden it. Who owns a frame's keys is now decided once, before any of them runs (`Realms::owns_input`, set in `PreUpdate`).

Tests run the real list and screen systems in both orders, and fail before the fix with the reported symptoms.

Fixes #817

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:30:51 +07:00
Sam Sung ea7e0d087a Zone names stay uncoloured on PvE realms outside capitals, as in 1.12.1 (#825)
On a PvE realm, zone names were still coloured friendly, hostile or contested.

In 1.12.1, `GetZonePVPInfo` (`0x48d540`) answers a type only when its display gate is open (`0x48d5c2`/`0x48d5cc`). The gate opens on the realm's PvP flag or in a zone with Flags `0x10`, which is the six capitals. The realm flag is read from `Cfg_Configs.dbc` for the selected realm's type and stored once per world entry (`0x4015de`). A type with no row skips the store. Otherwise the type is nil, so the stock zone splash shows cream and the minimap zone text gold.

benilla now reads `Cfg_Configs.dbc` instead of a transcription that stopped at type 8, so realm type 10 lists as PvP. It latches the realm flag at world entry and applies the gate.

Tests cover the gate, the six capitals and every shipped Cfg_Configs row; each failed before the fix.

Fixes #816

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 08:53:16 +07:00
Sam Sung 63e917965d The quest log counts party members on each quest, as 1.12.1 does (#824)
The quest log never showed the `[n]` count of party members on a quest, because `IsUnitOnQuest` was a stub that always answered nil.

1.12.1 (`0x4dfe10`) checks both arguments first. It reads the row's quest id (`0x4df150`; a header or out-of-range row answers nil before the unit is resolved), resolves the token, and admits only you or one of the four party slots, by guid (`0x4e7f70`). It then needs the unit held as a player and scans the 20 `PLAYER_QUEST_LOG` ids for that quest. The answer is 1 or nil. The ids reach party members on the wire. `UNIT_QUEST_LOG_CHANGED` (`0x51bc63` → `0x51bd90`) fires once whenever any slot of a unit's window changes, so an open log recounts.

Unit snapshots now carry the window, the binding follows those steps, and the event fires. Tests cover each path and run the stock `QuestLogFrame.xml` to a `[2]` row; they fail against the stub.

Fixes #818

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 08:09:41 +07:00
goran2711 80b0848628 fix: trainer services show their spell's description, as 1.12.1 does (#803)
- capture: trainer scenarios shoot the service description field (#793)
- fix: trainer services show their spell's description, as 1.12.1 does (#793)
- review: reuse the caster closure, cut repeated comments, pin the profession rows
- trainer: the pet's skill value is the tooltip's one helper, not a copy
- trainer: the recipe row's real-data test reads a product that has text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-08 07:16:27 +07:00
Sam Sung 2e82d34c1b The meeting-stone query runs at every world entry, as 1.12.1 sends it (#810)
The meeting-stone status query (`CMSG 0x296`) and its text reset ran once per UI VM, and the text drop only on leaving the world. So after a cross-map worldport benilla kept the old text and never asked again.

In 1.12.1 the world-enter cascade's meeting-stone init (`0x490a14` → `0x4c9f40`) resets the text to `UNKNOWN` and sends `0x296`, right after the battlefield init, on every pass: login, every cross-map worldport and every `/reload`. The leave-world sweep `0x490a80` drops the text (`0x490b2f` → `0x4c9f80`) on a worldport, a `/reload` and leaving the world.

The enter leg now runs on the world-enter cascade after the battlefield status. The sweep is one edge, written whenever its latch is spent, and the drop reads it. Tests cover the cascade, a worldport, a reload and the schedule order; a live trace shows `0x296` after `0x2D3` and its reply at login, on `ReloadUI()` and after `.tele`.

Fixes #99

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:29:18 +07:00
Sam Sung 85980939f5 A crate on top finds its own benilla-config/ through config_dir (#809)
A crate built on benilla through `run_with` has its own `benilla-config/`, but could not ask where it is: `local_state::home` is crate-private. A crate that ships an addon has to write it into that folder's `AddOns/`, where benilla discovers addons and resolves their art and fonts, so without the path it needed a fork.

- `benilla_app::config_dir()` answers `local_state::home()`, asked from `run_with` on, since a dev build resolves it from the launcher's folder set there.
- CONTRIBUTING's "Building on top" says a crate's files and addons go there, and names `run_with` and this folder as the two seams opened for crates alone.
- The example launcher logs its `AddOns/` folder through it, so the example, which clippy and the tests build, is the outside caller that keeps it public.

No 1.12.1 behaviour changes.

Fixes #807

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:12:02 +07:00
Sam Sung f8493febb0 The out trace logs every world send, the login handshake's included (#806)
The `out` trace tag logged only what the long-lived writer sent, drained after each command. Everything the session sends before the reader and writer split never reached it: `CMSG_AUTH_SESSION`, `CMSG_CHAR_ENUM`, `CMSG_PLAYER_LOGIN`, character create and delete, the cinematic ack and logout. So a login trace could not show where `CMSG_PLAYER_LOGIN` sits against `SMSG_LOGIN_VERIFY_WORLD`, which wire-timing work needs.

The world socket has one write path, `send_packet`. It now reports each packet to an observer right after the write, and the app installs the trace there only when the `out` tag is on. The writer's sent-log and its drains are gone; the line format is unchanged.

A protocol test over the fake server checks that the handshake, a pre-split send and a writer send are all observed, in order. A live login trace now opens with `CMSG_AUTH_SESSION`, `CMSG_CHAR_ENUM` and `CMSG_PLAYER_LOGIN`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 08:45:22 +07:00
elipp ffdc206ac2 World-enter queries wait for the player's create, as 1.12.1 sends them (#801)
At login benilla sent `CMSG_SET_ACTIVE_MOVER`, `CMSG_QUERY_TIME`, `MSG_QUERY_NEXT_MAIL_TIME` and `CMSG_BATTLEFIELD_STATUS` right after `CMSG_PLAYER_LOGIN`, before the server had seated the player. cmangos drops them; after a worldport or `/reload` the time and mail queries never went again.

In 1.12.1 all four follow the local player's own create (`0x5dea50`): `SetActiveMover` (`0x6006e0`), then the world-enter cascade (`0x5deb60 call 0x4908c0`), whose inits send `0x1CE`, `0x284` and `0x2D3` in that order. A cross-map worldport re-creates the player and takes the same route; `/reload` re-enters the cascade alone (`0x490168`).

The four now ride the self create, in that order, and `/reload` re-sends the three. Tests cover login, the create, a worldport, the schedule order and the reload; a live trace shows the order at login, after `.tele` and on `ReloadUI()`.

Fixes #789
Fixes #100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Elias Miettinen <eliaspmiettinen@gmail.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-05 22:28:59 +07:00
goran2711 bb84f1f1fb Unit tooltips title the unit with its PvP name, as 1.12.1 does (#802)
A unit tooltip's title read the bare name where 1.12.1 decorates it.

The tooltip calls the name builder `0x609370` itself (`0x52a1ab`, or `0x52a1db` when there is no second part) with the decoration flag a literal `1`, the same call `UnitPVPName` makes, so no CVar gates it. With the flag on, a ranked player reads `UNIT_PVP_NAME` of the gendered `PVP_RANK_<rank>_<team>` and the name, a city protector's `PVP_MEDAL<n>` follows on a second line (`0x6093ef`), and a civilian kill (`0x612550`) reads the `PVP_RANK_CIVILIAN` prefix (`0x609461`).

The title now runs the builder `UnitPVPName` already uses. The test covers rank, gender, medal, civilian, an unranked player and a creature; an on-demand `ui-tooltip-rank` capture shows a ranked player's tooltip.

Fixes #794

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-05 22:08:33 +07:00
Mathih13 ab909df6d9 fix: TargetUnit("npc") selects the interaction NPC, as 1.12.1 does (#800)
`TargetUnit("npc")`, `AssistUnit("npc")` and `SpellTargetUnit("npc")` did nothing with a merchant, gossip or quest window open: the app's unit-token resolver answered nobody for `npc`.

In 1.12.1 the resolver (`0x515970`) matches `npc` as a whole token (`0x515bec`, an unbounded compare, so `npctarget` stays unknown) and takes the interaction NPC's guid `[0xb4e2d0]`, which `0x4930d0` writes when the window opens.

`npc` now resolves to the held unit `InteractNpc` names. Tests cover the three verbs, a closed window and a streamed-out NPC, and `/script TargetUnit("npc")` typed into the stock chat box.

Fixes #707

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 21:57:08 +07:00
goran2711 622e1c3e7a fix: overhead names carry the player's PvP title, as 1.12.1 does (#792)
- capture: a name-rank scenario shoots a ranked player's overhead name line
- Overhead names carry the player's PvP title under UnitNamePlayerPVPTitle, as 1.12.1 does (#550)
- review: bundle the rank-title inputs; doc the snapshot and rank-19 limits
- nameplates: read rank strings per VM; test the composed name line
- pvp: correct the rank-title docs; convert the credit team without a cast
- Fix the titles row comment; name-rank reuses WOLF_POS, cites :900
- rank strings: the honor feed reads them off the VM; nameplates only reads the value

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-04 11:04:32 +07:00
elipp aa103d5a65 fix: level-up gains read signed, so a loss prints -2, as 1.12.1 does (#791)
- Change `LevelUpInfo` to signed to match vanilla behavior
- Add parse test for negative values in SMSG_LEVELUP_INFO, update comments
- grammar
- level-up gains: cite the %d fire and vmangos's wrapped deltas; pin the reported line

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-04 10:18:24 +07:00
Mathih13 4a389add47 fix: ignore a loot right-click while moving, as 1.12.1 does (#790)
- A loot right-click while moving does nothing, as in 1.12.1 (#760)
- loot gate: name the emitter's drain and write the landing deviation

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-04 10:01:50 +07:00
goran2711 9bc7276dd8 fix: spell text $g takes the player's gender, as 1.12.1 does (#787)
- spell text: $g/$G take the active player's gender and the chosen form is space-trimmed, so a female character reads "her" (0x508180, 0x508214)
- spell text: trim the $g docs, drop the colon-less $g pin
- spell tooltips: $g reads the view's player store; nets cover gender
- item tooltips: re-substitute $-texts when the gender byte moves
- tests: share one real-spells loader beside Spells

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-04 08:29:04 +07:00
Mathih13 cf891dc375 fix: close a loot window that opens while you move, as 1.12.1 does (#786)
- A loot window that opens while you move closes, as in 1.12.1 (#782)
- Set auto_loot in the LootConfig initializer (clippy field_reassign_with_default)
- Close a window opened on the move in the feed's pass, so it never paints

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Sam <samuv.eth@gmail.com>
2026-10-03 17:36:21 +07:00
2 changed files with 0 additions and 93 deletions
@@ -5,27 +5,6 @@
BENILLA_REALMLIST and BENILLA_REALMLIST_PINNED (set while $WOW_HOST fixes the address),
and reopens the dialog with the typed text when it is not an address. -->
<Script>
-- CharacterSelect.xml:679 compares the confirmation through strupper. Native 1.12 upper
-- (0x7fc180) leaves Cyrillic unchanged; the community ruRU pack needs its own case fold.
if GetLocale() == "ruRU" then
local function upper(text)
local result = strupper(text)
local lower = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"
local capitals = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
for i = 1, string.len(lower), 2 do
result = string.gsub(result, string.sub(lower, i, i + 1), string.sub(capitals, i, i + 1))
end
return result
end
CharacterDeleteEditBox:SetScript("OnTextChanged", function()
if upper(this:GetText()) == upper(DELETE_CONFIRM_STRING) then
CharacterDeleteButton1:Enable()
else
CharacterDeleteButton1:Disable()
end
end)
end
GlueDialogTypes["BENILLA_REALMLIST"] = {
-- The realmList CVar's registered help text.
text = "Address of realm list server",
@@ -38,78 +38,6 @@ fn ruru_stock_glue_loads_and_keeps_cyrillic_character_names() {
assert!(script.take_errors().is_empty());
}
#[test]
fn ruru_delete_confirmation_accepts_typed_cyrillic_without_case_sensitivity() {
let data = benilla_formats::wow_data_or_skip!();
let locale = benilla_formats::ClientLocale::RuRu;
if locale.pack_folder(&data).is_none() {
benilla_formats::skipped_optional("no ruRU language pack", &[data.join("ruRU")]);
return;
}
let chain = benilla_formats::Chain::open_localized(&data, locale).unwrap();
let _selected = super::reference_ui::fixture::use_chain(chain);
let mut script = UiScript::new_glue().unwrap();
script.set_russian_language_pack(true);
script.set_screen_size(1024.0, 768.0);
assert!(load_glue(&mut script).is_empty());
// Offline only: exercise the stock buttons and Enter without requesting a real deletion.
script
.run(
"GetCharacterInfo = function() return 'Probe', 'Human', 'Warrior', 1 end; \
DELETE_REQUESTS = 0; \
DeleteCharacter = function() DELETE_REQUESTS = DELETE_REQUESTS + 1 end; \
CharacterSelect.selectedIndex = 1; GlueParent:Show()",
)
.unwrap();
for (typed, accepted) in [
("Удалить", true),
("удалить", true),
("УдАлИтЬ", true),
("УДАЛИТЬ", true),
("Удали", false),
("Удалить!", false),
(" Удалить", false),
("DELETE", false),
("", false),
] {
for enter in [false, true] {
script
.run(
"CharacterDeleteDialog:Hide(); CharacterDeleteDialog:Show(); \
CharacterDeleteEditBox:SetFocus()",
)
.unwrap();
script.tick(0.01);
assert_eq!(text(&script, "CharacterDeleteEditBox"), "");
for c in typed.chars() {
script.char_input(&c.to_string());
}
script.tick(0.01);
assert_eq!(text(&script, "CharacterDeleteEditBox"), typed);
assert_eq!(
script
.eval::<bool>("return CharacterDeleteButton1:IsEnabled() == 1")
.unwrap(),
accepted,
"{typed:?}"
);
let before: i64 = script.eval("return DELETE_REQUESTS").unwrap();
if enter {
script.frame_key_input("ENTER");
script.key_up("ENTER");
} else {
script.run("CharacterDeleteButton1:Click()").unwrap();
}
assert_eq!(
script.eval::<i64>("return DELETE_REQUESTS").unwrap() - before,
i64::from(accepted),
"{typed:?}, enter={enter}"
);
}
}
assert!(script.take_errors().is_empty());
}
/// The stock glue VM on `screen` with both agreements accepted, as a returning player's is.
fn glue_on(screen: GlueScreen) -> UiScript {
let mut s = UiScript::new_glue().unwrap();