refactor: move Dalamud.Interface utils into main assembly, warnings pass

This commit is contained in:
goat 2023-08-04 19:36:09 +02:00
parent 758ae7c097
commit 02e1f2502e
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
80 changed files with 394 additions and 303 deletions

View file

@ -53,12 +53,6 @@ namespace Dalamud.Plugin.Internal;
#pragma warning restore SA1015
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.
/// As of Dalamud 9.x, this always matches the major version number of Dalamud.
/// </summary>
public static int DalamudApiLevel => Assembly.GetExecutingAssembly().GetName().Version!.Major;
/// <summary>
/// Default time to wait between plugin unload and plugin assembly unload.
/// </summary>
@ -88,6 +82,11 @@ internal partial class PluginManager : IDisposable, IServiceType
[ServiceManager.ServiceDependency]
private readonly HappyHttpClient happyHttpClient = Service<HappyHttpClient>.Get();
static PluginManager()
{
DalamudApiLevel = typeof(PluginManager).Assembly.GetName().Version!.Major;
}
[ServiceManager.ServiceConstructor]
private PluginManager()
{
@ -149,6 +148,12 @@ internal partial class PluginManager : IDisposable, IServiceType
/// </summary>
public event Action? OnAvailablePluginsChanged;
/// <summary>
/// Gets the current Dalamud API level, used to handle breaking changes. Only plugins with this level will be loaded.
/// As of Dalamud 9.x, this always matches the major version number of Dalamud.
/// </summary>
public static int DalamudApiLevel { get; private set; }
/// <summary>
/// Gets a copy of the list of all loaded plugins.
/// </summary>

View file

@ -83,7 +83,7 @@ public interface IGameConfig
/// Attempts to get the properties of a String option from the System section.
/// </summary>
/// <param name="option">Option to get the properties of.</param>
/// <param name="properties">Details of the option: Default Value</param>
/// <param name="properties">Details of the option: Default Value.</param>
/// <returns>A value representing the success.</returns>
public bool TryGet(SystemConfigOption option, out StringConfigProperties? properties);
@ -139,7 +139,7 @@ public interface IGameConfig
/// Attempts to get the properties of a String option from the UiConfig section.
/// </summary>
/// <param name="option">Option to get the properties of.</param>
/// <param name="properties">Details of the option: Default Value</param>
/// <param name="properties">Details of the option: Default Value.</param>
/// <returns>A value representing the success.</returns>
public bool TryGet(UiConfigOption option, out StringConfigProperties? properties);
@ -195,7 +195,7 @@ public interface IGameConfig
/// Attempts to get the properties of a String option from the UiControl section.
/// </summary>
/// <param name="option">Option to get the properties of.</param>
/// <param name="properties">Details of the option: Default Value</param>
/// <param name="properties">Details of the option: Default Value.</param>
/// <returns>A value representing the success.</returns>
public bool TryGet(UiControlOption option, out StringConfigProperties? properties);

View file

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using Dalamud.Game.ClientState.Keys;
using PInvoke;
namespace Dalamud.Plugin.Services;