mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Bunch of stuff...
This commit is contained in:
parent
eb9555ee22
commit
08c1768286
17 changed files with 74 additions and 116 deletions
|
|
@ -11,7 +11,7 @@ namespace Dalamud.Configuration;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Configuration to store settings for a dalamud plugin.
|
/// Configuration to store settings for a dalamud plugin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Api13ToDo("Make this a service. We need to be able to dispose it reliably to write configs asynchronously. Maybe also let people write files with vfs.")]
|
[Api14ToDo("Make this a service. We need to be able to dispose it reliably to write configs asynchronously. Maybe also let people write files with vfs.")]
|
||||||
public sealed class PluginConfigurations
|
public sealed class PluginConfigurations
|
||||||
{
|
{
|
||||||
private readonly DirectoryInfo configDirectory;
|
private readonly DirectoryInfo configDirectory;
|
||||||
|
|
|
||||||
|
|
@ -33,41 +33,14 @@ public abstract class AddonArgs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract AddonArgsType Type { get; }
|
public abstract AddonArgsType Type { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Checks if addon name matches the given span of char.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">The name to check.</param>
|
|
||||||
/// <returns>Whether it is the case.</returns>
|
|
||||||
internal bool IsAddon(string name)
|
|
||||||
{
|
|
||||||
if (this.Addon.IsNull)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (name.Length is 0 or > 32)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(this.Addon.Name))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return name == this.Addon.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clears this AddonArgs values.
|
|
||||||
/// </summary>
|
|
||||||
internal virtual void Clear()
|
|
||||||
{
|
|
||||||
this.addonName = null;
|
|
||||||
this.Addon = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper method for ensuring the name of the addon is valid.
|
/// Helper method for ensuring the name of the addon is valid.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The name of the addon for this object. <see cref="InvalidAddon"/> when invalid.</returns>
|
/// <returns>The name of the addon for this object. <see cref="InvalidAddon"/> when invalid.</returns>
|
||||||
private string GetAddonName()
|
private string GetAddonName()
|
||||||
{
|
{
|
||||||
if (this.Addon.IsNull) return InvalidAddon;
|
if (this.Addon.IsNull)
|
||||||
|
return InvalidAddon;
|
||||||
|
|
||||||
var name = this.Addon.Name;
|
var name = this.Addon.Name;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
using Dalamud.Utility;
|
||||||
|
|
||||||
|
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Addon argument data for Draw events.
|
/// Addon argument data for Draw events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use AddonGenericArgs instead.")]
|
||||||
|
[Api15ToDo("Remove this")]
|
||||||
public class AddonDrawArgs : AddonArgs
|
public class AddonDrawArgs : AddonArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonDrawArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonDrawArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonDrawArgs()
|
||||||
public AddonDrawArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
|
using Dalamud.Utility;
|
||||||
|
|
||||||
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Addon argument data for ReceiveEvent events.
|
/// Addon argument data for ReceiveEvent events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use AddonGenericArgs instead.")]
|
||||||
|
[Api15ToDo("Remove this")]
|
||||||
public class AddonFinalizeArgs : AddonArgs
|
public class AddonFinalizeArgs : AddonArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonFinalizeArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonFinalizeArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonFinalizeArgs()
|
||||||
public AddonFinalizeArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ public class AddonGenericArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonGenericArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonGenericArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonGenericArgs()
|
||||||
public AddonGenericArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
using Dalamud.Utility;
|
||||||
|
|
||||||
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -8,8 +10,7 @@ public class AddonReceiveEventArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonReceiveEventArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonReceiveEventArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonReceiveEventArgs()
|
||||||
public AddonReceiveEventArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,17 +33,8 @@ public class AddonReceiveEventArgs : AddonArgs
|
||||||
public nint AtkEvent { get; set; }
|
public nint AtkEvent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the pointer to a block of data for this event message.
|
/// Gets or sets the pointer to an AtkEventData for this event message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Api14ToDo("Rename to AtkEventData")]
|
||||||
public nint Data { get; set; }
|
public nint Data { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc cref="AddonArgs.Clear"/>
|
|
||||||
internal override void Clear()
|
|
||||||
{
|
|
||||||
base.Clear();
|
|
||||||
this.AtkEventType = 0;
|
|
||||||
this.EventParam = 0;
|
|
||||||
this.AtkEvent = 0;
|
|
||||||
this.Data = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -10,8 +12,7 @@ public class AddonRefreshArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonRefreshArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonRefreshArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonRefreshArgs()
|
||||||
public AddonRefreshArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,13 +32,7 @@ public class AddonRefreshArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the AtkValues in the form of a span.
|
/// Gets the AtkValues in the form of a span.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Pending removal, unsafe to use when using custom ClientStructs")]
|
||||||
|
[Api15ToDo("Remove this")]
|
||||||
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="AddonArgs.Clear"/>
|
|
||||||
internal override void Clear()
|
|
||||||
{
|
|
||||||
base.Clear();
|
|
||||||
this.AtkValueCount = 0;
|
|
||||||
this.AtkValues = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ public class AddonRequestedUpdateArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonRequestedUpdateArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonRequestedUpdateArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonRequestedUpdateArgs()
|
||||||
public AddonRequestedUpdateArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -25,12 +24,4 @@ public class AddonRequestedUpdateArgs : AddonArgs
|
||||||
/// Gets or sets the StringArrayData** for this event.
|
/// Gets or sets the StringArrayData** for this event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public nint StringArrayData { get; set; }
|
public nint StringArrayData { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc cref="AddonArgs.Clear"/>
|
|
||||||
internal override void Clear()
|
|
||||||
{
|
|
||||||
base.Clear();
|
|
||||||
this.NumberArrayData = 0;
|
|
||||||
this.StringArrayData = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -10,8 +12,7 @@ public class AddonSetupArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonSetupArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonSetupArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonSetupArgs()
|
||||||
public AddonSetupArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,13 +32,7 @@ public class AddonSetupArgs : AddonArgs
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the AtkValues in the form of a span.
|
/// Gets the AtkValues in the form of a span.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Pending removal, unsafe to use when using custom ClientStructs")]
|
||||||
|
[Api15ToDo("Remove this")]
|
||||||
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="AddonArgs.Clear"/>
|
|
||||||
internal override void Clear()
|
|
||||||
{
|
|
||||||
base.Clear();
|
|
||||||
this.AtkValueCount = 0;
|
|
||||||
this.AtkValues = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,35 @@
|
||||||
|
using Dalamud.Utility;
|
||||||
|
|
||||||
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
namespace Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Addon argument data for Update events.
|
/// Addon argument data for Update events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Use AddonGenericArgs instead.")]
|
||||||
|
[Api15ToDo("Remove this")]
|
||||||
public class AddonUpdateArgs : AddonArgs
|
public class AddonUpdateArgs : AddonArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AddonUpdateArgs"/> class.
|
/// Initializes a new instance of the <see cref="AddonUpdateArgs"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Obsolete("Not intended for public construction.", false)]
|
internal AddonUpdateArgs()
|
||||||
public AddonUpdateArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override AddonArgsType Type => AddonArgsType.Update;
|
public override AddonArgsType Type => AddonArgsType.Update;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the time since the last update.
|
|
||||||
/// </summary>
|
|
||||||
public float TimeDelta
|
|
||||||
{
|
|
||||||
get => this.TimeDeltaInternal;
|
|
||||||
init => this.TimeDeltaInternal = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the time since the last update.
|
/// Gets or sets the time since the last update.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal float TimeDeltaInternal { get; set; }
|
internal float TimeDeltaInternal { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc cref="AddonArgs.Clear"/>
|
/// <summary>
|
||||||
internal override void Clear()
|
/// Gets the time since the last update.
|
||||||
|
/// </summary>
|
||||||
|
private float TimeDelta
|
||||||
{
|
{
|
||||||
base.Clear();
|
get => this.TimeDeltaInternal;
|
||||||
this.TimeDeltaInternal = 0;
|
init => this.TimeDeltaInternal = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace Dalamud.Game.Addon.Lifecycle;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// AddonLifecycleService memory address resolver.
|
/// AddonLifecycleService memory address resolver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Api13ToDo("Remove this class entirely, its not used by AddonLifecycle anymore, also need to use something else for HookWidget")]
|
[Api14ToDo("Remove this class entirely, its not used by AddonLifecycle anymore, also need to use something else for HookWidget")]
|
||||||
internal class AddonLifecycleAddressResolver : BaseAddressResolver
|
internal class AddonLifecycleAddressResolver : BaseAddressResolver
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
|
|
||||||
private readonly AddonLifecycle lifecycleService;
|
private readonly AddonLifecycle lifecycleService;
|
||||||
|
|
||||||
// Obsolete warning is only to prevent users from creating their own event objects.
|
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
|
||||||
private readonly AddonSetupArgs addonSetupArg = new();
|
private readonly AddonSetupArgs addonSetupArg = new();
|
||||||
private readonly AddonFinalizeArgs addonFinalizeArg = new();
|
private readonly AddonFinalizeArgs addonFinalizeArg = new();
|
||||||
private readonly AddonDrawArgs addonDrawArg = new();
|
private readonly AddonDrawArgs addonDrawArg = new();
|
||||||
|
|
@ -36,7 +34,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
private readonly AddonRequestedUpdateArgs addonRequestedUpdateArg = new();
|
private readonly AddonRequestedUpdateArgs addonRequestedUpdateArg = new();
|
||||||
private readonly AddonReceiveEventArgs addonReceiveEventArg = new();
|
private readonly AddonReceiveEventArgs addonReceiveEventArg = new();
|
||||||
private readonly AddonGenericArgs addonGenericArg = new();
|
private readonly AddonGenericArgs addonGenericArg = new();
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
|
||||||
|
|
||||||
private readonly AtkUnitBase* atkUnitBase;
|
private readonly AtkUnitBase* atkUnitBase;
|
||||||
|
|
||||||
|
|
@ -136,7 +133,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonSetupArg.Clear();
|
|
||||||
this.addonSetupArg.Addon = addon;
|
this.addonSetupArg.Addon = addon;
|
||||||
this.addonSetupArg.AtkValueCount = valueCount;
|
this.addonSetupArg.AtkValueCount = valueCount;
|
||||||
this.addonSetupArg.AtkValues = (nint)values;
|
this.addonSetupArg.AtkValues = (nint)values;
|
||||||
|
|
@ -160,7 +156,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonFinalizeArg.Clear();
|
|
||||||
this.addonFinalizeArg.Addon = thisPtr;
|
this.addonFinalizeArg.Addon = thisPtr;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreFinalize, this.addonFinalizeArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreFinalize, this.addonFinalizeArg);
|
||||||
|
|
||||||
|
|
@ -178,7 +173,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonDrawArg.Clear();
|
|
||||||
this.addonDrawArg.Addon = addon;
|
this.addonDrawArg.Addon = addon;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreDraw, this.addonDrawArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreDraw, this.addonDrawArg);
|
||||||
|
|
||||||
|
|
@ -198,7 +192,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonUpdateArg.Clear();
|
|
||||||
this.addonUpdateArg.Addon = addon;
|
this.addonUpdateArg.Addon = addon;
|
||||||
this.addonUpdateArg.TimeDeltaInternal = delta;
|
this.addonUpdateArg.TimeDeltaInternal = delta;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreUpdate, this.addonUpdateArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreUpdate, this.addonUpdateArg);
|
||||||
|
|
@ -221,7 +214,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
this.addonRefreshArg.Clear();
|
|
||||||
this.addonRefreshArg.Addon = addon;
|
this.addonRefreshArg.Addon = addon;
|
||||||
this.addonRefreshArg.AtkValueCount = valueCount;
|
this.addonRefreshArg.AtkValueCount = valueCount;
|
||||||
this.addonRefreshArg.AtkValues = (nint)values;
|
this.addonRefreshArg.AtkValues = (nint)values;
|
||||||
|
|
@ -246,7 +238,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonRequestedUpdateArg.Clear();
|
|
||||||
this.addonRequestedUpdateArg.Addon = addon;
|
this.addonRequestedUpdateArg.Addon = addon;
|
||||||
this.addonRequestedUpdateArg.NumberArrayData = (nint)numberArrayData;
|
this.addonRequestedUpdateArg.NumberArrayData = (nint)numberArrayData;
|
||||||
this.addonRequestedUpdateArg.StringArrayData = (nint)stringArrayData;
|
this.addonRequestedUpdateArg.StringArrayData = (nint)stringArrayData;
|
||||||
|
|
@ -270,7 +261,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonReceiveEventArg.Clear();
|
|
||||||
this.addonReceiveEventArg.Addon = (nint)addon;
|
this.addonReceiveEventArg.Addon = (nint)addon;
|
||||||
this.addonReceiveEventArg.AtkEventType = (byte)eventType;
|
this.addonReceiveEventArg.AtkEventType = (byte)eventType;
|
||||||
this.addonReceiveEventArg.EventParam = eventParam;
|
this.addonReceiveEventArg.EventParam = eventParam;
|
||||||
|
|
@ -300,7 +290,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
this.addonGenericArg.Clear();
|
|
||||||
this.addonGenericArg.Addon = thisPtr;
|
this.addonGenericArg.Addon = thisPtr;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreOpen, this.addonGenericArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreOpen, this.addonGenericArg);
|
||||||
|
|
||||||
|
|
@ -324,7 +313,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
this.addonGenericArg.Clear();
|
|
||||||
this.addonGenericArg.Addon = thisPtr;
|
this.addonGenericArg.Addon = thisPtr;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreClose, this.addonGenericArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreClose, this.addonGenericArg);
|
||||||
|
|
||||||
|
|
@ -346,7 +334,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonGenericArg.Clear();
|
|
||||||
this.addonGenericArg.Addon = thisPtr;
|
this.addonGenericArg.Addon = thisPtr;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreShow, this.addonGenericArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreShow, this.addonGenericArg);
|
||||||
|
|
||||||
|
|
@ -366,7 +353,6 @@ internal unsafe class AddonVirtualTable : IDisposable
|
||||||
{
|
{
|
||||||
this.LogEvent(EnableLogging);
|
this.LogEvent(EnableLogging);
|
||||||
|
|
||||||
this.addonGenericArg.Clear();
|
|
||||||
this.addonGenericArg.Addon = thisPtr;
|
this.addonGenericArg.Addon = thisPtr;
|
||||||
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreHide, this.addonGenericArg);
|
this.lifecycleService.InvokeListenersSafely(AddonEvent.PreHide, this.addonGenericArg);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,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;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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,11 @@ 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.
|
/// 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;
|
||||||
25
Dalamud/Utility/Api15ToDoAttribute.cs
Normal file
25
Dalamud/Utility/Api15ToDoAttribute.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
namespace Dalamud.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Utility class for marking something to be changed for API 13, for ease of lookup.
|
||||||
|
/// Intended to represent not the upcoming API, but the one after it for more major changes.
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||||
|
internal sealed class Api15ToDoAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marks that this should be made internal.
|
||||||
|
/// </summary>
|
||||||
|
public const string MakeInternal = "Make internal.";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Api15ToDoAttribute"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="what">The explanation.</param>
|
||||||
|
/// <param name="what2">The explanation 2.</param>
|
||||||
|
public Api15ToDoAttribute(string what, string what2 = "")
|
||||||
|
{
|
||||||
|
_ = what;
|
||||||
|
_ = what2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -79,7 +79,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();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue