Glamourer-related changes.

This commit is contained in:
Ottermandias 2023-07-12 02:45:40 +02:00
parent a7ace8a8c8
commit 9e0c38169f
15 changed files with 184 additions and 90 deletions

View file

@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using System.Runtime.InteropServices;
using Dalamud.Game.ClientState.Objects.Enums;
using Newtonsoft.Json.Linq;
@ -17,10 +17,10 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
public enum RetainerType : ushort
{
Both = 0,
Bell = 1,
Both = 0,
Bell = 1,
Mannequin = 2,
}
}
// @formatter:off
[FieldOffset( 0 )] public readonly IdentifierType Type; // All
@ -75,7 +75,7 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
var parts = name.Split(' ', 3);
return string.Join(" ",
parts.Length != 3 ? parts.Select(n => $"{n[0]}.") : parts[..2].Select(n => $"{n[0]}.").Append(parts[2]));
}
}
public override string ToString()
=> Manager?.ToString(this)
@ -95,6 +95,9 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
_ => "Invalid",
};
public string ToName()
=> Manager?.ToName(this) ?? "Unknown Object";
public override int GetHashCode()
=> Type switch
{
@ -217,6 +220,6 @@ public static class ActorManagerExtensions
ScreenActor.FittingRoom => "Fitting Room Actor",
ScreenActor.DyePreview => "Dye Preview Actor",
ScreenActor.Portrait => "Portrait Actor",
_ => "Invalid",
_ => "Invalid",
};
}