use one single instance for all plugins

This commit is contained in:
2024-07-17 14:55:49 +02:00
parent 7f41e593c3
commit 8273c68318
2 changed files with 4 additions and 1 deletions

View File

@@ -37,4 +37,7 @@ public interface INamePlateGui
/// Requests that all nameplates should be redrawn on the following frame.
/// </summary>
void RequestRedraw();
private static NamePlateGui instance;
public static INamePlateGui Instance => instance ??= new ();
}

View File

@@ -41,7 +41,7 @@ public sealed class NamePlateGui : IDisposable, INamePlateGui
private NamePlateUpdateHandler[] updateHandlers = [];
public NamePlateGui()
internal NamePlateGui()
{
this.addonLifecycle.RegisterListener(AddonEvent.PreRequestedUpdate, "NamePlate", this.OnPreRequestedUpdate);
}