using System.Numerics; namespace AcDream.App.UI; /// /// Full-device modal root for retail dialog element classes. The authored child with id /// 0x3D supplies the visible popup art; this root only owns modality and input capture. /// public sealed class UiDialogRoot : UiPanel { public Action? Cancel { get; set; } public UiDialogRoot() { BackgroundColor = Vector4.Zero; BorderColor = Vector4.Zero; ClickThrough = false; } public override bool OnEvent(in UiEvent e) { if (e.Type == UiEventType.KeyDown && e.Data0 == (int)Silk.NET.Input.Key.Escape) { Cancel?.Invoke(); } // A dialog root is full-screen and modal. Unhandled clicks/keys must not // fall through into movement, combat, or the default chat input. return true; } }