Add call-on-services-ready attribute for service methods, and fix scene nullability (#900)

This commit is contained in:
kizer 2022-06-27 01:49:34 +09:00 committed by GitHub
parent 5809accf5d
commit 3369f569fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 274 additions and 273 deletions

View file

@ -16,7 +16,7 @@ namespace Dalamud.Game.Gui.PartyFinder
[PluginInterface]
[InterfaceVersion("1.0")]
[ServiceManager.BlockingEarlyLoadedService]
public sealed class PartyFinderGui : IDisposable
public sealed class PartyFinderGui : IDisposable, IServiceType
{
private readonly PartyFinderAddressResolver address;
private readonly IntPtr memory;
@ -55,14 +55,6 @@ namespace Dalamud.Game.Gui.PartyFinder
/// </summary>
public event PartyFinderListingEventDelegate ReceiveListing;
/// <summary>
/// Enables this module.
/// </summary>
public void Enable()
{
this.receiveListingHook.Enable();
}
/// <summary>
/// Dispose of managed and unmanaged resources.
/// </summary>
@ -80,6 +72,12 @@ namespace Dalamud.Game.Gui.PartyFinder
}
}
[ServiceManager.CallWhenServicesReady]
private void ContinueConstruction(GameGui gameGui)
{
this.receiveListingHook.Enable();
}
private void HandleReceiveListingDetour(IntPtr managerPtr, IntPtr data)
{
try