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

@ -31,7 +31,7 @@ namespace Dalamud.Plugin.Internal;
/// Class responsible for loading and unloading plugins.
/// </summary>
[ServiceManager.EarlyLoadedService]
internal partial class PluginManager : IDisposable
internal partial class PluginManager : IDisposable, IServiceType
{
/// <summary>
/// The current Dalamud API level, used to handle breaking changes. Only plugins with this level will be loaded.
@ -386,12 +386,8 @@ internal partial class PluginManager : IDisposable
// Load plugins that want to be loaded during Framework.Tick, when drawing facilities are available
loadTasks.Add(
Service<InterfaceManager>
Service<InterfaceManager.InterfaceManagerWithScene>
.GetAsync()
.ContinueWith(
x => x.Result.SceneInitializeTask,
TaskContinuationOptions.RunContinuationsAsynchronously)
.Unwrap()
.ContinueWith(
_ => Service<Framework>.Get().RunOnTick(
() => LoadPluginsSync(

View file

@ -10,7 +10,7 @@ namespace Dalamud.Plugin.Internal;
/// Class responsible for loading plugins on startup.
/// </summary>
[ServiceManager.BlockingEarlyLoadedService]
public class StartupPluginLoader
public class StartupPluginLoader : IServiceType
{
private static readonly ModuleLog Log = new("SPL");

View file

@ -6,7 +6,7 @@ namespace Dalamud.Plugin.Ipc.Internal
/// This class facilitates inter-plugin communication.
/// </summary>
[ServiceManager.EarlyLoadedService]
internal class CallGate
internal class CallGate : IServiceType
{
private readonly Dictionary<string, CallGateChannel> gates = new();