mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-15 23:50:38 +00:00
Inline icons were CSimpleTextures registered on the fontstring's parent frame, with their visibility copied from the line once per tick, after the draw. Any line that hid kept its icons for one more frame; once chat lines moved with their text, a line scrolled off the top flashed its icons above the chat frame. 4.3.4's CSimpleEmbeddedTexture has no frame, and the fontstring draws it: CSimpleFontString::Draw queues the string, then QueueTextures. 1.12's equivalent is CSimpleFontString::Emit (0x00772E50), the only caller of AppendToBatch (0x00773080). The icon textures are now made with no frame (SimpleRegionConstruct skips SetRegionParent for a null parent; the frame-alpha fold 0x0077FAC0 tests the parent), anchored to the fontstring and given its scale through layout slot 0x10, as AddRegionToLayer does. A hook on Emit adds a line's icons to the layer batch right after its text, and only when the text went in (the batch count at +0x4 grew), so an icon draws exactly when its line does, in the same frame. The batch copies each texture's handle, blend and colour count when built (0x00772FD0) and reads vertices, texcoords and colours through pointers, so a change to a line's icon set marks the fontstring's layer (NotifyLayerChanged 0x0077FDF0), and moves and fades need no rebuild. 4.3.4 sets the textures up in UpdateString. RebuildString (0x007724A0) now does the same: when its gate passes (layout flags +0x60 bit 1, `test byte [esi+0x60],1`) it replaces the built string, so the line's icons are dropped, the new node is laid out (FUN_TEXT_ENSURE_BUILT) and its placements applied at once. The paint flush stays the backstop. Removed: the per-tick visibility mirror, the freshness expiry, region Show/Hide and re-parenting, and the SMF early apply with its _classicapi_InlineTexEarly toggle; the rebuild refresh covers what it did, and it rebuilt every icon line on every layout. The textures are deleted through their vtable slot 0 (as the frame destructor deletes regions) one tick after their fontstring dies or a reload, once the batches holding them were rebuilt.