acdream/src/AcDream.App/UI/UiTextureElement.cs
Erik a1175e6aac feat(ui): port retail component book rows
Instantiate gmSpellComponentUI category and component entries from LayoutDesc 0x21000033 instead of synthesizing catalog rows. Preserve localized category titles, authored textures and geometry, live icon/count/desired bindings, selected-object synchronization, and retail's inclusive 0..5000 desired-level contract.

Co-authored-by: OpenAI Codex <codex@openai.com>
2026-07-15 17:38:24 +02:00

23 lines
707 B
C#

using System.Numerics;
using AcDream.App.Rendering;
namespace AcDream.App.UI;
/// <summary>
/// Runtime-owned texture content inside an authored retained-UI region. LayoutDesc
/// still owns the region's geometry and chrome; controllers supply only the live
/// texture handle (for example a composed item icon).
/// </summary>
public sealed class UiTextureElement : UiElement
{
public UiTextureElement() => ClickThrough = true;
public uint Texture { get; set; }
public Vector4 Tint { get; set; } = Vector4.One;
protected override void OnDraw(UiRenderContext ctx)
{
if (Texture != 0u)
ctx.DrawSprite(Texture, 0f, 0f, Width, Height, 0f, 0f, 1f, 1f, Tint);
}
}