mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 04:13:40 +01:00
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900)
This commit is contained in:
parent
5809accf5d
commit
3369f569fb
52 changed files with 274 additions and 273 deletions
|
|
@ -25,7 +25,7 @@ namespace Dalamud.Game
|
|||
[PluginInterface]
|
||||
[InterfaceVersion("1.0")]
|
||||
[ServiceManager.BlockingEarlyLoadedService]
|
||||
public sealed class Framework : IDisposable
|
||||
public sealed class Framework : IDisposable, IServiceType
|
||||
{
|
||||
private static Stopwatch statsStopwatch = new();
|
||||
|
||||
|
|
@ -47,13 +47,6 @@ namespace Dalamud.Game
|
|||
this.updateHook = new Hook<OnUpdateDetour>(this.Address.TickAddress, this.HandleFrameworkUpdate);
|
||||
this.freeHook = new Hook<OnDestroyDetour>(this.Address.FreeAddress, this.HandleFrameworkFree);
|
||||
this.destroyHook = new Hook<OnRealDestroyDelegate>(this.Address.DestroyAddress, this.HandleFrameworkDestroy);
|
||||
|
||||
gameGui.Enable();
|
||||
gameNetwork.Enable();
|
||||
|
||||
this.updateHook.Enable();
|
||||
this.freeHook.Enable();
|
||||
this.destroyHook.Enable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -224,6 +217,14 @@ namespace Dalamud.Game
|
|||
statsStopwatch.Reset();
|
||||
}
|
||||
|
||||
[ServiceManager.CallWhenServicesReady]
|
||||
private void ContinueConstruction()
|
||||
{
|
||||
this.updateHook.Enable();
|
||||
this.freeHook.Enable();
|
||||
this.destroyHook.Enable();
|
||||
}
|
||||
|
||||
private bool HandleFrameworkUpdate(IntPtr framework)
|
||||
{
|
||||
this.frameworkUpdateThread ??= Thread.CurrentThread;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue