mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
feat: add GameLifecycle service
This commit is contained in:
parent
03a409306f
commit
9ff7eb801f
3 changed files with 79 additions and 3 deletions
|
|
@ -25,6 +25,8 @@ namespace Dalamud.Game;
|
|||
[ServiceManager.BlockingEarlyLoadedService]
|
||||
public sealed class Framework : IDisposable, IServiceType
|
||||
{
|
||||
private readonly GameLifecycle lifecycle;
|
||||
|
||||
private static Stopwatch statsStopwatch = new();
|
||||
|
||||
private readonly Stopwatch updateStopwatch = new();
|
||||
|
|
@ -41,10 +43,11 @@ public sealed class Framework : IDisposable, IServiceType
|
|||
|
||||
[ServiceManager.ServiceDependency]
|
||||
private readonly DalamudConfiguration configuration = Service<DalamudConfiguration>.Get();
|
||||
|
||||
|
||||
[ServiceManager.ServiceConstructor]
|
||||
private Framework(SigScanner sigScanner)
|
||||
private Framework(SigScanner sigScanner, GameLifecycle lifecycle)
|
||||
{
|
||||
this.lifecycle = lifecycle;
|
||||
this.hitchDetector = new HitchDetector("FrameworkUpdate", this.configuration.FrameworkUpdateHitch);
|
||||
|
||||
this.Address = new FrameworkAddressResolver();
|
||||
|
|
@ -489,6 +492,10 @@ public sealed class Framework : IDisposable, IServiceType
|
|||
this.IsFrameworkUnloading = true;
|
||||
this.DispatchUpdateEvents = false;
|
||||
|
||||
// All the same, for now...
|
||||
this.lifecycle.SetShuttingDown();
|
||||
this.lifecycle.SetUnloading();
|
||||
|
||||
Log.Information("Framework::Destroy!");
|
||||
Service<Dalamud>.Get().Unload();
|
||||
this.RunPendingTickTasks();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue