Files
WoWee/include/core
Kelsi 639ea1cc22 feat(ui): give the addon API a widget system that actually draws
CreateFrame answered and events dispatched, but CreateTexture handed back a
table whose every method was a no-op — SetTexture, SetPoint, SetVertexColor, all
of them, with a metatable turning any remaining capitalised name into another
no-op. An addon could be written, loaded and run without ever putting a pixel on
the screen. The API looked supported and nothing happened.

There is now a real retained tree behind it. Frames and regions are still Lua
tables, so existing addon code is untouched, but each carries a handle into C++
state that holds its geometry and its art, and a renderer walks it.

The layout is WoW's: anchors as constraints rather than positions. An anchor
says "this fraction of my rect sits at that point", so one anchor plus a size
places a frame and two opposing anchors give the size as well — which is how
SetAllPoints works, and how most of FrameXML sizes its backgrounds without ever
stating a size. Draw order is strata, then frame level, then layer, then
sublevel, then creation order, so a child draws over its parent and an OVERLAY
in a low stratum still falls behind a BACKGROUND in a high one.

Coordinates are kept in WoW's convention throughout — origin bottom-left, y
upward — and flipped once at the point of drawing, so every anchor rule reads
the way Blizzard documents it rather than mirrored.

The tree is deliberately free of Vulkan and ImGui so the layout rules are
testable without a device; thirteen cases cover the anchor solver, inheritance
of visibility and strata, and the draw ordering. Rendering is separate and
loads Interface art through the existing asset path, the same route the action
bar already takes for its backpack button — the player's own install, nothing
new shipped.

addons/WoweeWidgetDemo is a hand-written addon using only the ordinary API:
anchored art from Interface\Buttons, layer ordering, a sibling-relative anchor
and a slash command. Copy it into the AddOns directory to see it.

This is the piece both goals needed. Addons can draw now, and the same tree is
what FrameXML targets, which is what makes running the original interface
possible rather than imitating it.
2026-08-01 10:50:20 -07:00
..
2026-02-21 22:04:17 -08:00