Cleanup
This commit is contained in:
@@ -497,22 +497,6 @@ public unsafe sealed class ArmatureManager : IDisposable
|
|||||||
|
|
||||||
if (type == ProfileChanged.Type.TemporaryProfileAdded)
|
if (type == ProfileChanged.Type.TemporaryProfileAdded)
|
||||||
{
|
{
|
||||||
//todo: remove this later
|
|
||||||
/*Armature? armature = null;
|
|
||||||
foreach(var kvPair in Armatures)
|
|
||||||
{
|
|
||||||
//todo: check mount/companion
|
|
||||||
if(kvPair.Key.CompareIgnoringOwnership(profile.Character) &&
|
|
||||||
(kvPair.Key.Type != IdentifierType.Owned || kvPair.Key.IsOwnedByLocalPlayer()))
|
|
||||||
{
|
|
||||||
armature = kvPair.Value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (armature == null)
|
|
||||||
return;*/
|
|
||||||
|
|
||||||
foreach(var character in profile.Characters)
|
foreach(var character in profile.Characters)
|
||||||
{
|
{
|
||||||
if (!character.IsValid || !Armatures.ContainsKey(character))
|
if (!character.IsValid || !Armatures.ContainsKey(character))
|
||||||
@@ -588,10 +572,6 @@ public unsafe sealed class ArmatureManager : IDisposable
|
|||||||
{
|
{
|
||||||
(var armatureActorIdentifier, _) = _gameObjectService.GetTrueActorForSpecialTypeActor(kvPair.Key);
|
(var armatureActorIdentifier, _) = _gameObjectService.GetTrueActorForSpecialTypeActor(kvPair.Key);
|
||||||
|
|
||||||
//warn: side-effect: for Type = Owned will ignore owner.
|
|
||||||
//This isn't a particularly huge issue as this is only used for profile rebinding, but this probably should be handled better later.
|
|
||||||
/*if (actorIdentifier.IsValid && armatureActorIdentifier.MatchesIgnoringOwnership(actorIdentifier))
|
|
||||||
yield return kvPair.Value;*/
|
|
||||||
if (actorIdentifier.IsValid && armatureActorIdentifier.MatchesIgnoringOwnership(actorIdentifier) &&
|
if (actorIdentifier.IsValid && armatureActorIdentifier.MatchesIgnoringOwnership(actorIdentifier) &&
|
||||||
(armatureActorIdentifier.Type != IdentifierType.Owned || armatureActorIdentifier.IsOwnedByLocalPlayer()))
|
(armatureActorIdentifier.Type != IdentifierType.Owned || armatureActorIdentifier.IsOwnedByLocalPlayer()))
|
||||||
yield return kvPair.Value;
|
yield return kvPair.Value;
|
||||||
|
|||||||
@@ -30,19 +30,10 @@ public sealed class Profile : ISavable
|
|||||||
|
|
||||||
public List<Armature> Armatures = new();
|
public List<Armature> Armatures = new();
|
||||||
|
|
||||||
/* [Obsolete("To be removed in the future versions")]
|
|
||||||
public LowerString CharacterName { get; set; } = LowerString.Empty;*/
|
|
||||||
|
|
||||||
//public ActorIdentifier Character { get; set; } = ActorIdentifier.Invalid;
|
|
||||||
public List<ActorIdentifier> Characters { get; set; } = new();
|
public List<ActorIdentifier> Characters { get; set; } = new();
|
||||||
|
|
||||||
public LowerString Name { get; set; } = LowerString.Empty;
|
public LowerString Name { get; set; } = LowerString.Empty;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether to search only through local player owned characters or all characters when searching for game object by name
|
|
||||||
/// </summary>
|
|
||||||
//public bool LimitLookupToOwnedObjects { get; set; } = false;
|
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public DateTimeOffset CreationDate { get; set; } = DateTime.UtcNow;
|
public DateTimeOffset CreationDate { get; set; } = DateTime.UtcNow;
|
||||||
public DateTimeOffset ModifiedDate { get; set; } = DateTime.UtcNow;
|
public DateTimeOffset ModifiedDate { get; set; } = DateTime.UtcNow;
|
||||||
@@ -66,11 +57,6 @@ public sealed class Profile : ISavable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsTemporary => ProfileType == ProfileType.Temporary;
|
public bool IsTemporary => ProfileType == ProfileType.Temporary;
|
||||||
|
|
||||||
/* /// <summary>
|
|
||||||
/// Identificator specifying specific actor this profile applies to, only works for temporary profiles
|
|
||||||
/// </summary>
|
|
||||||
public ActorIdentifier TemporaryActor { get; set; } = ActorIdentifier.Invalid;*/
|
|
||||||
|
|
||||||
public string Incognito
|
public string Incognito
|
||||||
=> UniqueId.ToString()[..8];
|
=> UniqueId.ToString()[..8];
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public sealed class ProfileChanged() : EventWrapper<ProfileChanged.Type, Profile
|
|||||||
PriorityChanged,
|
PriorityChanged,
|
||||||
AddedCharacter,
|
AddedCharacter,
|
||||||
RemovedCharacter,
|
RemovedCharacter,
|
||||||
//ChangedCharacter,
|
|
||||||
AddedTemplate,
|
AddedTemplate,
|
||||||
RemovedTemplate,
|
RemovedTemplate,
|
||||||
MovedTemplate,
|
MovedTemplate,
|
||||||
@@ -28,13 +27,7 @@ public sealed class ProfileChanged() : EventWrapper<ProfileChanged.Type, Profile
|
|||||||
ChangedDefaultProfile,
|
ChangedDefaultProfile,
|
||||||
ChangedDefaultLocalPlayerProfile,
|
ChangedDefaultLocalPlayerProfile,
|
||||||
TemporaryProfileAdded,
|
TemporaryProfileAdded,
|
||||||
TemporaryProfileDeleted,
|
TemporaryProfileDeleted
|
||||||
/*
|
|
||||||
ToggledProfile,
|
|
||||||
AddedTemplate,
|
|
||||||
RemovedTemplate,
|
|
||||||
MovedTemplate,
|
|
||||||
ChangedTemplate*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Priority
|
public enum Priority
|
||||||
|
|||||||
@@ -373,12 +373,6 @@ public partial class ProfileManager : IDisposable
|
|||||||
if (!actor.Identifier(_actorManager, out var identifier))
|
if (!actor.Identifier(_actorManager, out var identifier))
|
||||||
throw new ActorNotFoundException();
|
throw new ActorNotFoundException();
|
||||||
|
|
||||||
/* if (identifier.Type != IdentifierType.Player)
|
|
||||||
{
|
|
||||||
_logger.Warning($"Tried applying temporary profile to actor {identifier.Incognito(null)}. Temporary profiles can only be applied to players right now.");
|
|
||||||
return; //do not return error code as I plan to eventually fix this
|
|
||||||
}*/
|
|
||||||
|
|
||||||
profile.Enabled = true;
|
profile.Enabled = true;
|
||||||
profile.ProfileType = ProfileType.Temporary;
|
profile.ProfileType = ProfileType.Temporary;
|
||||||
profile.Priority = int.MaxValue; //Make sure temporary profile is always at max priority
|
profile.Priority = int.MaxValue; //Make sure temporary profile is always at max priority
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public class TemplateEditorManager : IDisposable
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
//todo: check with mounts/companions
|
|
||||||
var playerName = _gameObjectService.GetCurrentPlayerName();
|
var playerName = _gameObjectService.GetCurrentPlayerName();
|
||||||
return _gameObjectService.FindActorsByIdentifierIgnoringOwnership(Character)
|
return _gameObjectService.FindActorsByIdentifierIgnoringOwnership(Character)
|
||||||
.Where(x => x.Item1.Type != Penumbra.GameData.Enums.IdentifierType.Owned || x.Item1.IsOwnedByLocalPlayer())
|
.Where(x => x.Item1.Type != Penumbra.GameData.Enums.IdentifierType.Owned || x.Item1.IsOwnedByLocalPlayer())
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class TemplatePanel : IDisposable
|
|||||||
|
|
||||||
private void DrawHeader()
|
private void DrawHeader()
|
||||||
=> HeaderDrawer.Draw(SelectionName, 0, ImGui.GetColorU32(ImGuiCol.FrameBg),
|
=> HeaderDrawer.Draw(SelectionName, 0, ImGui.GetColorU32(ImGuiCol.FrameBg),
|
||||||
1, /*SetFromClipboardButton(),*/ ExportToClipboardButton(), LockButton(),
|
1, ExportToClipboardButton(), LockButton(),
|
||||||
HeaderDrawer.Button.IncognitoButton(_selector.IncognitoMode, v => _selector.IncognitoMode = v));
|
HeaderDrawer.Button.IncognitoButton(_selector.IncognitoMode, v => _selector.IncognitoMode = v));
|
||||||
|
|
||||||
private void DrawMultiSelection()
|
private void DrawMultiSelection()
|
||||||
|
|||||||
Reference in New Issue
Block a user