chore: clean up lumina obsoletes and warnings

This commit is contained in:
Kaz Wolfe 2025-08-04 23:24:37 -07:00
parent 82f9db4ca6
commit 2f9363b9cc
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
6 changed files with 26 additions and 18 deletions

View file

@ -65,6 +65,9 @@ public enum ConditionFlag
/// </summary> /// </summary>
RidingPillion = 10, RidingPillion = 10,
/// <summary>
/// Unable to execute command while mounted.
/// </summary>
[Obsolete("Renamed to RidingPillion", true)] [Obsolete("Renamed to RidingPillion", true)]
Mounted2 = 10, Mounted2 = 10,
@ -430,6 +433,9 @@ public enum ConditionFlag
/// </summary> /// </summary>
MountImmobile = 88, MountImmobile = 88,
/// <summary>
/// Unable to execute command in this state.
/// </summary>
[Obsolete("Renamed to MountImmobile", true)] [Obsolete("Renamed to MountImmobile", true)]
InThisState88 = 88, InThisState88 = 88,

View file

@ -71,6 +71,7 @@ public readonly struct SeStringParameter
public static implicit operator SeStringParameter(ReadOnlySeStringSpan value) => new(new ReadOnlySeString(value)); public static implicit operator SeStringParameter(ReadOnlySeStringSpan value) => new(new ReadOnlySeString(value));
[Obsolete("Switch to using ReadOnlySeString instead of Lumina's SeString.", true)]
public static implicit operator SeStringParameter(LSeString value) => new(new ReadOnlySeString(value.RawData)); public static implicit operator SeStringParameter(LSeString value) => new(new ReadOnlySeString(value.RawData));
public static implicit operator SeStringParameter(DSeString value) => new(new ReadOnlySeString(value.Encode())); public static implicit operator SeStringParameter(DSeString value) => new(new ReadOnlySeString(value.Encode()));

View file

@ -118,6 +118,7 @@ public class SeString
/// </summary> /// </summary>
/// <param name="str">string to convert.</param> /// <param name="str">string to convert.</param>
/// <returns>Equivalent SeString.</returns> /// <returns>Equivalent SeString.</returns>
[Obsolete("Switch to using ReadOnlySeString instead of Lumina's SeString.", true)]
public static explicit operator SeString(Lumina.Text.SeString str) => str.ToDalamudString(); public static explicit operator SeString(Lumina.Text.SeString str) => str.ToDalamudString();
/// <summary> /// <summary>

View file

@ -532,15 +532,6 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
/// </summary> /// </summary>
public bool ShouldUseReducedMotion => Service<DalamudConfiguration>.Get().ReduceMotions ?? false; public bool ShouldUseReducedMotion => Service<DalamudConfiguration>.Get().ReduceMotions ?? false;
private void OnDefaultStyleChanged()
=> this.DefaultStyleChanged.InvokeSafely();
private void OnDefaultGlobalScaleChanged()
=> this.DefaultGlobalScaleChanged.InvokeSafely();
private void OnDefaultFontChanged()
=> this.DefaultFontChanged.InvokeSafely();
/// <summary> /// <summary>
/// Gets or sets a value indicating whether statistics about UI draw time should be collected. /// Gets or sets a value indicating whether statistics about UI draw time should be collected.
/// </summary> /// </summary>
@ -550,6 +541,15 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
internal static bool DoStats { get; set; } = false; internal static bool DoStats { get; set; } = false;
#endif #endif
private void OnDefaultStyleChanged()
=> this.DefaultStyleChanged.InvokeSafely();
private void OnDefaultGlobalScaleChanged()
=> this.DefaultGlobalScaleChanged.InvokeSafely();
private void OnDefaultFontChanged()
=> this.DefaultFontChanged.InvokeSafely();
/// <summary> /// <summary>
/// Gets a value indicating whether this UiBuilder has a configuration UI registered. /// Gets a value indicating whether this UiBuilder has a configuration UI registered.
/// </summary> /// </summary>

View file

@ -8,13 +8,12 @@ using Dalamud.Memory.Exceptions;
using Dalamud.Utility; using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.System.Memory; using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using Lumina.Text.Payloads;
using Lumina.Text.ReadOnly;
using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.ObjectPool;
using Windows.Win32.Foundation; using Windows.Win32.Foundation;
using Windows.Win32.System.Memory; using Windows.Win32.System.Memory;
using LPayloadType = Lumina.Text.Payloads.PayloadType;
using LSeString = Lumina.Text.SeString;
// Heavily inspired from Reloaded (https://github.com/Reloaded-Project/Reloaded.Memory) // Heavily inspired from Reloaded (https://github.com/Reloaded-Project/Reloaded.Memory)
namespace Dalamud.Memory; namespace Dalamud.Memory;
@ -414,7 +413,7 @@ public static unsafe class MemoryHelper
containsNonRepresentedPayload = false; containsNonRepresentedPayload = false;
while (*pin != 0 && maxLength > 0) while (*pin != 0 && maxLength > 0)
{ {
if (*pin != LSeString.StartByte) if (*pin != ReadOnlySeString.Stx)
{ {
var len = *pin switch var len = *pin switch
{ {
@ -439,7 +438,7 @@ public static unsafe class MemoryHelper
--maxLength; --maxLength;
// Payload type // Payload type
var payloadType = (LPayloadType)(*pin++); var payloadType = (MacroCode)(*pin++);
// Payload length // Payload length
if (!ReadIntExpression(ref pin, ref maxLength, out var expressionLength)) if (!ReadIntExpression(ref pin, ref maxLength, out var expressionLength))
@ -450,19 +449,19 @@ public static unsafe class MemoryHelper
maxLength -= unchecked((int)expressionLength); maxLength -= unchecked((int)expressionLength);
// End byte // End byte
if (*pin++ != LSeString.EndByte) if (*pin++ != ReadOnlySeString.Etx)
break; break;
--maxLength; --maxLength;
switch (payloadType) switch (payloadType)
{ {
case LPayloadType.NewLine: case MacroCode.NewLine:
sb.AppendLine(); sb.AppendLine();
break; break;
case LPayloadType.Hyphen: case MacroCode.Hyphen:
sb.Append(''); sb.Append('');
break; break;
case LPayloadType.SoftHyphen: case MacroCode.SoftHyphen:
sb.Append('\u00AD'); sb.Append('\u00AD');
break; break;
default: default:

View file

@ -24,6 +24,7 @@ public static class SeStringExtensions
/// </summary> /// </summary>
/// <param name="originalString">The original Lumina SeString.</param> /// <param name="originalString">The original Lumina SeString.</param>
/// <returns>The re-parsed Dalamud SeString.</returns> /// <returns>The re-parsed Dalamud SeString.</returns>
[Obsolete("Switch to using ReadOnlySeString instead of Lumina's SeString.", true)]
public static DSeString ToDalamudString(this LSeString originalString) => DSeString.Parse(originalString.RawData); public static DSeString ToDalamudString(this LSeString originalString) => DSeString.Parse(originalString.RawData);
/// <summary> /// <summary>