Add interface for gui handling so plugins can determine if inputs are being blocked or if the mouse is being drawn (etc)
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 40s
Build / Build Nuget package (NuGet) (push) Successful in 1m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m2s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m55s
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 40s
Build / Build Nuget package (NuGet) (push) Successful in 1m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m2s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m55s
This commit is contained in:
@@ -8,15 +8,18 @@ namespace CringePlugins.Render;
|
||||
public sealed class RenderHandler : IRootRenderComponent
|
||||
{
|
||||
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
|
||||
private static RenderHandler? _current;
|
||||
private static IGuiHandler? _guiHandler;
|
||||
public static RenderHandler Current => _current ?? throw new InvalidOperationException("Render is not yet initialized");
|
||||
|
||||
public static IGuiHandler GuiHandler => _guiHandler ?? throw new InvalidOperationException("Render is not yet initialized");
|
||||
|
||||
private readonly ConcurrentBag<ComponentRegistration> _components = [];
|
||||
|
||||
internal RenderHandler()
|
||||
internal RenderHandler(IGuiHandler guiHandler)
|
||||
{
|
||||
_current = this;
|
||||
_guiHandler = guiHandler;
|
||||
}
|
||||
|
||||
public void RegisterComponent<TComponent>(TComponent instance) where TComponent : IRenderComponent
|
||||
@@ -29,7 +32,7 @@ public sealed class RenderHandler : IRootRenderComponent
|
||||
#if DEBUG
|
||||
ImGui.ShowDemoWindow();
|
||||
#endif
|
||||
|
||||
|
||||
foreach (var (instanceType, renderComponent) in _components)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user