RynthCore/src/RynthCore.Engine/UI/OverlayHost.cs
tombohar 80b71d295d Initial commit
A modern .NET 9 NativeAOT framework for Asheron's Call client modding.
Self-contained injection system that hooks D3D9 EndScene to render an
ImGui overlay inside the AC client process.
2026-04-10 18:38:07 -04:00

26 lines
1,000 B
C#

// ============================================================================
// RynthCore.Engine - UI/OverlayHost.cs
// Static registry for overlay panels. Engine code registers panels before
// AvaloniaOverlay.Start() is called; the window reads them at creation time.
// ============================================================================
using System;
using System.Collections.Generic;
using Avalonia.Controls;
namespace RynthCore.Engine.UI;
internal static class OverlayHost
{
private static readonly List<(string Title, Func<Control> Factory)> _panels = new();
/// <summary>
/// Register a panel tab. Call before AvaloniaOverlay.Start().
/// Factory is invoked on the Avalonia UI thread when the window is created.
/// </summary>
internal static void RegisterPanel(string title, Func<Control> factory)
=> _panels.Add((title, factory));
internal static IReadOnlyList<(string Title, Func<Control> Factory)> GetPanels()
=> _panels;
}