fix: Schedule removal of CS types from API

- Remove AtkValueSpan from addon args
- Don't expose SmnGauge enum
- Replace HelpMarker vector4
This commit is contained in:
Kaz Wolfe 2025-09-06 23:51:46 -07:00
parent 1b08d986ca
commit f6cf266e99
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
9 changed files with 33 additions and 14 deletions

View file

@ -1,3 +1,5 @@
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes; namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
@ -31,6 +33,8 @@ public class AddonRefreshArgs : AddonArgs, ICloneable
/// <summary> /// <summary>
/// Gets the AtkValues in the form of a span. /// Gets the AtkValues in the form of a span.
/// </summary> /// </summary>
[Api14ToDo(Api14ToDoAttribute.Remove)]
[Obsolete($"Exposed ClientStructs type; use {nameof(AtkValues)}/{nameof(AtkValueCount)} instead.", false)]
public unsafe Span<AtkValue> AtkValueSpan => new(this.AtkValues.ToPointer(), (int)this.AtkValueCount); public unsafe Span<AtkValue> AtkValueSpan => new(this.AtkValues.ToPointer(), (int)this.AtkValueCount);
/// <inheritdoc cref="ICloneable.Clone"/> /// <inheritdoc cref="ICloneable.Clone"/>

View file

@ -1,3 +1,5 @@
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes; namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
@ -31,6 +33,8 @@ public class AddonSetupArgs : AddonArgs, ICloneable
/// <summary> /// <summary>
/// Gets the AtkValues in the form of a span. /// Gets the AtkValues in the form of a span.
/// </summary> /// </summary>
[Api14ToDo(Api14ToDoAttribute.Remove)]
[Obsolete($"Exposed ClientStructs type; use {nameof(AtkValues)}/{nameof(AtkValueCount)} instead.", false)]
public unsafe Span<AtkValue> AtkValueSpan => new(this.AtkValues.ToPointer(), (int)this.AtkValueCount); public unsafe Span<AtkValue> AtkValueSpan => new(this.AtkValues.ToPointer(), (int)this.AtkValueCount);
/// <inheritdoc cref="ICloneable.Clone"/> /// <inheritdoc cref="ICloneable.Clone"/>

View file

@ -12,7 +12,7 @@ public enum AddonEvent
/// <summary> /// <summary>
/// An event that is fired prior to an addon being setup with its implementation of /// An event that is fired prior to an addon being setup with its implementation of
/// <see cref="AtkUnitBase.OnSetup"/>. This event is useful for modifying the initial data contained within /// <see cref="AtkUnitBase.OnSetup"/>. This event is useful for modifying the initial data contained within
/// <see cref="AddonSetupArgs.AtkValueSpan"/> prior to the addon being created. /// <see cref="AddonSetupArgs.AtkValues"/> prior to the addon being created.
/// </summary> /// </summary>
/// <seealso cref="AddonSetupArgs"/> /// <seealso cref="AddonSetupArgs"/>
PreSetup, PreSetup,

View file

@ -1,4 +1,6 @@
using Dalamud.Game.ClientState.JobGauge.Enums; using Dalamud.Game.ClientState.JobGauge.Enums;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game.Gauge; using FFXIVClientStructs.FFXIV.Client.Game.Gauge;
namespace Dalamud.Game.ClientState.JobGauge.Types; namespace Dalamud.Game.ClientState.JobGauge.Types;
@ -69,6 +71,7 @@ public unsafe class SMNGauge : JobGaugeBase<SummonerGauge>
/// Gets the current aether flags. /// Gets the current aether flags.
/// Use the summon accessors instead. /// Use the summon accessors instead.
/// </summary> /// </summary>
[Api14ToDo("Declare our own enum for this to avoid CS type.")]
public AetherFlags AetherFlags => this.Struct->AetherFlags; public AetherFlags AetherFlags => this.Struct->AetherFlags;
/// <summary> /// <summary>

View file

@ -143,7 +143,7 @@ internal sealed unsafe class DtrBarEntry : IDisposable, IDtrBarEntry
} }
/// <inheritdoc/> /// <inheritdoc/>
[Api13ToDo("Maybe make this config scoped to internal name?")] [Api14ToDo("Maybe make this config scoped to internal name?")]
public bool UserHidden => this.configuration.DtrIgnore?.Contains(this.Title) ?? false; public bool UserHidden => this.configuration.DtrIgnore?.Contains(this.Title) ?? false;
/// <summary> /// <summary>

View file

@ -48,7 +48,7 @@ public abstract class Easing
/// Gets the current value of the animation, following unclamped logic. /// Gets the current value of the animation, following unclamped logic.
/// </summary> /// </summary>
[Obsolete($"This field has been deprecated. Use either {nameof(ValueClamped)} or {nameof(ValueUnclamped)} instead.", true)] [Obsolete($"This field has been deprecated. Use either {nameof(ValueClamped)} or {nameof(ValueUnclamped)} instead.", true)]
[Api13ToDo("Map this field to ValueClamped, probably.")] [Api14ToDo("Map this field to ValueClamped, probably.")]
public double Value => this.ValueUnclamped; public double Value => this.ValueUnclamped;
/// <summary> /// <summary>

View file

@ -1,5 +1,7 @@
using Dalamud.Bindings.ImGui; using Dalamud.Bindings.ImGui;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Common.Math; using FFXIVClientStructs.FFXIV.Common.Math;
namespace Dalamud.Interface.Components; namespace Dalamud.Interface.Components;
@ -21,6 +23,7 @@ public static partial class ImGuiComponents
/// <param name="helpText">The text to display on hover.</param> /// <param name="helpText">The text to display on hover.</param>
/// <param name="icon">The icon to use.</param> /// <param name="icon">The icon to use.</param>
/// <param name="color">The color of the icon.</param> /// <param name="color">The color of the icon.</param>
[Api14ToDo("Replace CS Vector4 with System.Numerics.Vector4")]
public static void HelpMarker(string helpText, FontAwesomeIcon icon, Vector4? color = null) public static void HelpMarker(string helpText, FontAwesomeIcon icon, Vector4? color = null)
{ {
using var col = new ImRaii.Color(); using var col = new ImRaii.Color();

View file

@ -4,7 +4,7 @@ namespace Dalamud.Utility;
/// Utility class for marking something to be changed for API 13, for ease of lookup. /// Utility class for marking something to be changed for API 13, for ease of lookup.
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.All, Inherited = false)] [AttributeUsage(AttributeTargets.All, Inherited = false)]
internal sealed class Api13ToDoAttribute : Attribute internal sealed class Api14ToDoAttribute : Attribute
{ {
/// <summary> /// <summary>
/// Marks that this should be made internal. /// Marks that this should be made internal.
@ -12,11 +12,16 @@ internal sealed class Api13ToDoAttribute : Attribute
public const string MakeInternal = "Make internal."; public const string MakeInternal = "Make internal.";
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Api13ToDoAttribute"/> class. /// Marks that this should be removed entirely.
/// </summary>
public const string Remove = "Remove.";
/// <summary>
/// Initializes a new instance of the <see cref="Api14ToDoAttribute"/> class.
/// </summary> /// </summary>
/// <param name="what">The explanation.</param> /// <param name="what">The explanation.</param>
/// <param name="what2">The explanation 2.</param> /// <param name="what2">The explanation 2.</param>
public Api13ToDoAttribute(string what, string what2 = "") public Api14ToDoAttribute(string what, string what2 = "")
{ {
_ = what; _ = what;
_ = what2; _ = what2;

View file

@ -75,7 +75,7 @@ public static partial class Util
/// <summary> /// <summary>
/// Gets the Dalamud version. /// Gets the Dalamud version.
/// </summary> /// </summary>
[Api13ToDo("Remove. Make both versions here internal. Add an API somewhere.")] [Api14ToDo("Remove. Make both versions here internal. Add an API somewhere.")]
public static string AssemblyVersion { get; } = public static string AssemblyVersion { get; } =
Assembly.GetAssembly(typeof(ChatHandlers))!.GetName().Version!.ToString(); Assembly.GetAssembly(typeof(ChatHandlers))!.GetName().Version!.ToString();