Merge branch 'master' into api11

# Conflicts:
#	Dalamud/Game/ClientState/Fates/Fate.cs
#	Dalamud/Game/Gui/NamePlate/NamePlateUpdateContext.cs
#	Dalamud/Interface/Internal/DalamudInterface.cs
#	Dalamud/Interface/Windowing/Window.cs
#	Dalamud/Utility/StringExtensions.cs
#	lib/FFXIVClientStructs
This commit is contained in:
Kaz Wolfe 2024-11-11 08:38:20 -08:00
commit 720b1676e5
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
49 changed files with 4573 additions and 93 deletions

View file

@ -526,13 +526,40 @@ internal sealed class DalamudPluginInterface : IDalamudPluginInterface, IDisposa
/// <param name="affectedThisPlugin">If this plugin was affected by the change.</param>
internal void NotifyActivePluginsChanged(PluginListInvalidationKind kind, bool affectedThisPlugin)
{
this.ActivePluginsChanged?.Invoke(kind, affectedThisPlugin);
if (this.ActivePluginsChanged is { } callback)
{
foreach (var action in callback.GetInvocationList().Cast<IDalamudPluginInterface.ActivePluginsChangedDelegate>())
{
try
{
action(kind, affectedThisPlugin);
}
catch (Exception ex)
{
Log.Error(ex, "Exception during raise of {handler}", action.Method);
}
}
}
}
private void OnLocalizationChanged(string langCode)
{
this.UiLanguage = langCode;
this.LanguageChanged?.Invoke(langCode);
if (this.LanguageChanged is { } callback)
{
foreach (var action in callback.GetInvocationList().Cast<IDalamudPluginInterface.LanguageChangedDelegate>())
{
try
{
action(langCode);
}
catch (Exception ex)
{
Log.Error(ex, "Exception during raise of {handler}", action.Method);
}
}
}
}
private void OnDalamudConfigurationSaved(DalamudConfiguration dalamudConfiguration)

View file

@ -205,6 +205,13 @@ internal class PluginRepository
return false;
}
if (manifest.TestingAssemblyVersion != null &&
manifest.TestingAssemblyVersion > manifest.AssemblyVersion &&
manifest.TestingDalamudApiLevel == null)
{
Log.Warning("The plugin {PluginName} in {RepoLink} has a testing version available, but it lacks an associated testing API. The 'TestingDalamudApiLevel' property is required.", manifest.InternalName, this.PluginMasterUrl);
}
return true;
}

View file

@ -9,7 +9,6 @@ namespace Dalamud.Plugin.Ipc;
/// </summary>
public interface ICallGateSubscriber
{
/// <inheritdoc cref="CallGatePubSubBase.HasAction"/>
public bool HasAction { get; }

View file

@ -103,4 +103,11 @@ public interface IGameInventory
/// <inheritdoc cref="ItemMerged"/>
public event InventoryChangedDelegate<InventoryItemMergedArgs> ItemMergedExplicit;
/// <summary>
/// Gets all item slots of the specified inventory type.
/// </summary>
/// <param name="type">The type of inventory to get the items for.</param>
/// <returns>A read-only span of all items in the specified inventory type.</returns>
public ReadOnlySpan<GameInventoryItem> GetInventoryItems(GameInventoryType type);
}

View file

@ -26,6 +26,15 @@ public interface INamePlateGui
/// </remarks>
event OnPlateUpdateDelegate? OnNamePlateUpdate;
/// <summary>
/// An event which fires after nameplate data is updated and at least one nameplate had important updates. The
/// subscriber is provided with a list of handlers for nameplates with important updates.
/// </summary>
/// <remarks>
/// Fires before <see cref="OnPostDataUpdate"/>.
/// </remarks>
event OnPlateUpdateDelegate? OnPostNamePlateUpdate;
/// <summary>
/// An event which fires when nameplate data is updated. The subscriber is provided with a list of handlers for all
/// nameplates.
@ -36,6 +45,16 @@ public interface INamePlateGui
/// </remarks>
event OnPlateUpdateDelegate? OnDataUpdate;
/// <summary>
/// An event which fires after nameplate data is updated. The subscriber is provided with a list of handlers for all
/// nameplates.
/// </summary>
/// <remarks>
/// This event is likely to fire every frame even when no nameplates are actually updated, so in most cases
/// <see cref="OnNamePlateUpdate"/> is preferred. Fires after <see cref="OnPostNamePlateUpdate"/>.
/// </remarks>
event OnPlateUpdateDelegate? OnPostDataUpdate;
/// <summary>
/// Requests that all nameplates should be redrawn on the following frame.
/// </summary>

View file

@ -5,7 +5,6 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Internal.Windows.Data.Widgets;
using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps;
@ -281,4 +280,20 @@ public interface ITextureProvider
/// <returns><c>true</c> if supported.</returns>
/// <remarks><para>This function does not throw exceptions.</para></remarks>
bool IsDxgiFormatSupportedForCreateFromExistingTextureAsync(int dxgiFormat);
/// <summary>Converts an existing <see cref="IDalamudTextureWrap"/> instance to a new instance of
/// <see cref="FFXIVClientStructs.FFXIV.Client.Graphics.Kernel.Texture"/> which can be used to supply a custom
/// texture onto an in-game addon (UI element.)</summary>
/// <param name="wrap">Instance of <see cref="IDalamudTextureWrap"/> to convert.</param>
/// <param name="leaveWrapOpen">Whether to leave <paramref name="wrap"/> non-disposed when the returned
/// <see cref="Task{TResult}"/> completes.</param>
/// <returns>Address of the new <see cref="FFXIVClientStructs.FFXIV.Client.Graphics.Kernel.Texture"/>.</returns>
/// <example>See <c>PrintTextureInfo</c> in <see cref="Interface.Internal.UiDebug.PrintSimpleNode"/> for an example
/// of replacing the texture of an image node.</example>
/// <remarks>
/// <para>If the returned kernel texture is to be destroyed, call the fourth function in its vtable, by calling
/// <see cref="FFXIVClientStructs.FFXIV.Client.Graphics.Kernel.Texture.DecRef"/> or
/// <c>((delegate* unmanaged&lt;nint, void&gt;)(*(nint**)ptr)[3](ptr)</c>.</para>
/// </remarks>
nint ConvertToKernelTexture(IDalamudTextureWrap wrap, bool leaveWrapOpen = false);
}

View file

@ -22,6 +22,9 @@ public interface ITextureReadbackProvider
/// <remarks>
/// <para>The length of the returned <c>RawData</c> may not match
/// <see cref="RawImageSpecification.Height"/> * <see cref="RawImageSpecification.Pitch"/>.</para>
/// <para><see cref="RawImageSpecification.Pitch"/> may not be the minimal value required to represent the texture
/// bitmap data. For example, if a texture is 4x4 B8G8R8A8, the minimal pitch would be 32, but the function may
/// return 64 instead.</para>
/// <para>This function may throw an exception.</para>
/// </remarks>
Task<(RawImageSpecification Specification, byte[] RawData)> GetRawImageAsync(