chore: move all dalamud logo textures into special service

This commit is contained in:
goat 2023-10-01 21:35:21 +02:00
parent 2bdb837577
commit 263771c082
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
6 changed files with 77 additions and 35 deletions

View file

@ -16,7 +16,7 @@ using JetBrains.Annotations;
namespace Dalamud;
// TODO:
// - Unify dependency walking code(load/unload
// - Unify dependency walking code(load/unload)
// - Visualize/output .dot or imgui thing
/// <summary>
@ -122,8 +122,7 @@ internal static class ServiceManager
foreach (var serviceType in Assembly.GetExecutingAssembly().GetTypes().Where(x => x.IsAssignableTo(typeof(IServiceType)) && !x.IsInterface && !x.IsAbstract))
{
var serviceKind = serviceType.GetServiceKind();
if (serviceKind is ServiceKind.None)
throw new Exception($"Service<{serviceType.FullName}> did not specify a kind");
Debug.Assert(serviceKind != ServiceKind.None, $"Service<{serviceType.FullName}> did not specify a kind");
// Let IoC know about the interfaces this service implements
serviceContainer.RegisterInterfaces(serviceType);
@ -148,6 +147,11 @@ internal static class ServiceManager
if (serviceKind.HasFlag(ServiceKind.ProvidedService))
continue;
Debug.Assert(
serviceKind.HasFlag(ServiceKind.EarlyLoadedService) ||
serviceKind.HasFlag(ServiceKind.BlockingEarlyLoadedService),
"At this point, service must be either early loaded or blocking early loaded");
if (serviceKind.HasFlag(ServiceKind.BlockingEarlyLoadedService))
{
blockingEarlyLoadingServices.Add(serviceType);