mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
* fix(frame): move a frame's children along when SetParent sets its level Vanilla's SetParent gives the frame its new parent's strata and level + 1, but calls the level setter without its children flag, so the frames under it keep the levels they had. A panel built on its own and then moved into a raised window draws its contents behind that window: Zygor Guides Viewer 2.0's AceConfigDialog-3.0 panel in the Interface Options window had its widgets at levels 1-4 under a window at level 5. Hook the level setter (0x0076A4F0) and pass the children flag on SetParent's two calls, recognized by their return addresses. The setter then moves each same-strata child by the same amount, recursively. Script SetFrameLevel and the setter's other callers are unchanged. Verified in-game (1.12.1 client via VanillaFixes, Zygor Guides Viewer 2.0): the AceConfigDialog-3.0 panel's widgets draw above the Interface Options window, and none of its 18 frames sit below the window's container any more. A frame with a child and a grandchild moved under a level-20 frame sits at 21/22/23, and at 0/1/2 once moved to no parent. * refactor(frame): patch SetParent's children flag instead of hooking the setter The two `push 0` that pass the level setter's children flag from SetParent become `push 1`, which is what 3.3.5's SetParent passes. This drops the MinHook on the level setter, which 11 call sites share, and the return-address checks. Each site's bytes are checked before the write, as in Quest::CompleteMessage. Docs: describe only the current behavior in API.md and the README row. Verified in-game: a frame with a child and a grandchild moved under a level-20 frame sits at 21/22/23, and at 0/1/2 once moved to no parent. --------- Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>