Finish CollectionTab rework.

This commit is contained in:
Ottermandias 2023-04-21 18:42:54 +02:00
parent 25cb46525a
commit 9c4f7b7562
22 changed files with 1350 additions and 1543 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using Dalamud.Game.ClientState.Objects.Enums;
using Newtonsoft.Json.Linq;
@ -65,6 +66,17 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
public bool IsValid
=> Type is not (IdentifierType.UnkObject or IdentifierType.Invalid);
public string Incognito(string? name)
{
name ??= ToString();
if (Type is not (IdentifierType.Player or IdentifierType.Owned))
return name;
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)
?? Type switch