use one single instance for all plugins
This commit is contained in:
@@ -37,4 +37,7 @@ public interface INamePlateGui
|
|||||||
/// Requests that all nameplates should be redrawn on the following frame.
|
/// Requests that all nameplates should be redrawn on the following frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void RequestRedraw();
|
void RequestRedraw();
|
||||||
|
|
||||||
|
private static NamePlateGui instance;
|
||||||
|
public static INamePlateGui Instance => instance ??= new ();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public sealed class NamePlateGui : IDisposable, INamePlateGui
|
|||||||
|
|
||||||
private NamePlateUpdateHandler[] updateHandlers = [];
|
private NamePlateUpdateHandler[] updateHandlers = [];
|
||||||
|
|
||||||
public NamePlateGui()
|
internal NamePlateGui()
|
||||||
{
|
{
|
||||||
this.addonLifecycle.RegisterListener(AddonEvent.PreRequestedUpdate, "NamePlate", this.OnPreRequestedUpdate);
|
this.addonLifecycle.RegisterListener(AddonEvent.PreRequestedUpdate, "NamePlate", this.OnPreRequestedUpdate);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user