mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
chore: clean up lumina obsoletes and warnings
This commit is contained in:
parent
82f9db4ca6
commit
2f9363b9cc
6 changed files with 26 additions and 18 deletions
|
|
@ -65,6 +65,9 @@ public enum ConditionFlag
|
|||
/// </summary>
|
||||
RidingPillion = 10,
|
||||
|
||||
/// <summary>
|
||||
/// Unable to execute command while mounted.
|
||||
/// </summary>
|
||||
[Obsolete("Renamed to RidingPillion", true)]
|
||||
Mounted2 = 10,
|
||||
|
||||
|
|
@ -430,6 +433,9 @@ public enum ConditionFlag
|
|||
/// </summary>
|
||||
MountImmobile = 88,
|
||||
|
||||
/// <summary>
|
||||
/// Unable to execute command in this state.
|
||||
/// </summary>
|
||||
[Obsolete("Renamed to MountImmobile", true)]
|
||||
InThisState88 = 88,
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ public readonly struct SeStringParameter
|
|||
|
||||
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(DSeString value) => new(new ReadOnlySeString(value.Encode()));
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ public class SeString
|
|||
/// </summary>
|
||||
/// <param name="str">string to convert.</param>
|
||||
/// <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();
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -532,15 +532,6 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
|
|||
/// </summary>
|
||||
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>
|
||||
/// Gets or sets a value indicating whether statistics about UI draw time should be collected.
|
||||
/// </summary>
|
||||
|
|
@ -550,6 +541,15 @@ public sealed class UiBuilder : IDisposable, IUiBuilder
|
|||
internal static bool DoStats { get; set; } = false;
|
||||
#endif
|
||||
|
||||
private void OnDefaultStyleChanged()
|
||||
=> this.DefaultStyleChanged.InvokeSafely();
|
||||
|
||||
private void OnDefaultGlobalScaleChanged()
|
||||
=> this.DefaultGlobalScaleChanged.InvokeSafely();
|
||||
|
||||
private void OnDefaultFontChanged()
|
||||
=> this.DefaultFontChanged.InvokeSafely();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this UiBuilder has a configuration UI registered.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -8,13 +8,12 @@ using Dalamud.Memory.Exceptions;
|
|||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Memory;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.String;
|
||||
using Lumina.Text.Payloads;
|
||||
using Lumina.Text.ReadOnly;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
using Windows.Win32.Foundation;
|
||||
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)
|
||||
|
||||
namespace Dalamud.Memory;
|
||||
|
|
@ -414,7 +413,7 @@ public static unsafe class MemoryHelper
|
|||
containsNonRepresentedPayload = false;
|
||||
while (*pin != 0 && maxLength > 0)
|
||||
{
|
||||
if (*pin != LSeString.StartByte)
|
||||
if (*pin != ReadOnlySeString.Stx)
|
||||
{
|
||||
var len = *pin switch
|
||||
{
|
||||
|
|
@ -439,7 +438,7 @@ public static unsafe class MemoryHelper
|
|||
--maxLength;
|
||||
|
||||
// Payload type
|
||||
var payloadType = (LPayloadType)(*pin++);
|
||||
var payloadType = (MacroCode)(*pin++);
|
||||
|
||||
// Payload length
|
||||
if (!ReadIntExpression(ref pin, ref maxLength, out var expressionLength))
|
||||
|
|
@ -450,19 +449,19 @@ public static unsafe class MemoryHelper
|
|||
maxLength -= unchecked((int)expressionLength);
|
||||
|
||||
// End byte
|
||||
if (*pin++ != LSeString.EndByte)
|
||||
if (*pin++ != ReadOnlySeString.Etx)
|
||||
break;
|
||||
--maxLength;
|
||||
|
||||
switch (payloadType)
|
||||
{
|
||||
case LPayloadType.NewLine:
|
||||
case MacroCode.NewLine:
|
||||
sb.AppendLine();
|
||||
break;
|
||||
case LPayloadType.Hyphen:
|
||||
case MacroCode.Hyphen:
|
||||
sb.Append('–');
|
||||
break;
|
||||
case LPayloadType.SoftHyphen:
|
||||
case MacroCode.SoftHyphen:
|
||||
sb.Append('\u00AD');
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public static class SeStringExtensions
|
|||
/// </summary>
|
||||
/// <param name="originalString">The original Lumina SeString.</param>
|
||||
/// <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);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue