Hopefully this doesn't break anything, I can't test this properly on my free trial account
Removed "Limit to my creatures", the code now automatically detects this for all owned actors. If you liked to apply edits to minions and stuff of other players... too bad. Implemented UI for setting profiles to NPC, minions and mounts (still WIP, will probably have to implement multiple characters per profile)
This commit is contained in:
@@ -28,6 +28,35 @@ public static class ActorIdentifierExtensions
|
||||
return PenumbraExtensions.Manager.Data.ToName(identifier.Kind, identifier.DataId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two actor identifiers while ignoring ownership for owned objects. For all other identifier types will use Matches() method.
|
||||
/// </summary>
|
||||
public static bool CompareIgnoringOwnership(this ActorIdentifier identifier, ActorIdentifier other)
|
||||
{
|
||||
if (identifier.Type != other.Type)
|
||||
return false;
|
||||
|
||||
return identifier.Type switch
|
||||
{
|
||||
IdentifierType.Owned => PenumbraExtensions.Manager.DataIdEquals(identifier, other),
|
||||
_ => identifier.Matches(other)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if owned actor is owned by local player. Will return false if Type is not Owned.
|
||||
/// </summary>
|
||||
public static bool IsOwnedByLocalPlayer(this ActorIdentifier identifier)
|
||||
{
|
||||
if (identifier.Type != IdentifierType.Owned)
|
||||
return false;
|
||||
|
||||
if (PenumbraExtensions.Manager == null)
|
||||
return false;
|
||||
|
||||
return identifier.PlayerName == PenumbraExtensions.Manager.GetCurrentPlayer().PlayerName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around Incognito which returns non-incognito name in debug builds
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user