From 28ab12c21b6a61fdaec9fe0bb3bc8a3d10711336 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 6 Jan 2023 16:03:45 +0100 Subject: [PATCH] Add option to not use any mods when inspecting players. --- Penumbra/Configuration.cs | 1 + Penumbra/Interop/Resolver/PathResolver.Identification.cs | 9 +++++++-- Penumbra/UI/ConfigWindow.SettingsTab.General.cs | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Penumbra/Configuration.cs b/Penumbra/Configuration.cs index 0e6b70d2..167be4f4 100644 --- a/Penumbra/Configuration.cs +++ b/Penumbra/Configuration.cs @@ -37,6 +37,7 @@ public partial class Configuration : IPluginConfiguration public bool UseCharacterCollectionInInspect { get; set; } = true; public bool UseCharacterCollectionInTryOn { get; set; } = true; public bool UseOwnerNameForCharacterCollection { get; set; } = true; + public bool UseNoModsInInspect { get; set; } = false; public bool HideRedrawBar { get; set; } = false; diff --git a/Penumbra/Interop/Resolver/PathResolver.Identification.cs b/Penumbra/Interop/Resolver/PathResolver.Identification.cs index 8ee75678..d3a2fb3f 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Identification.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Identification.cs @@ -57,6 +57,11 @@ public unsafe partial class PathResolver } var identifier = Penumbra.Actors.FromObject( gameObject, out var owner, true, false ); + if( Penumbra.Config.UseNoModsInInspect && identifier.Type == IdentifierType.Special && identifier.Special == SpecialActor.ExamineScreen ) + { + return IdentifiedCache.Set( ModCollection.Empty, identifier, gameObject ); + } + identifier = Penumbra.CollectionManager.Individuals.ConvertSpecialIdentifier( identifier ); var collection = CollectionByIdentifier( identifier ) ?? CheckYourself( identifier, gameObject ) @@ -77,8 +82,8 @@ public unsafe partial class PathResolver // or the default collection if no player exists. public static ModCollection PlayerCollection() { - using var performance = Penumbra.Performance.Measure( PerformanceType.IdentifyCollection ); - var gameObject = ( GameObject* )Dalamud.Objects.GetObjectAddress( 0 ); + using var performance = Penumbra.Performance.Measure( PerformanceType.IdentifyCollection ); + var gameObject = ( GameObject* )Dalamud.Objects.GetObjectAddress( 0 ); if( gameObject == null ) { return Penumbra.CollectionManager.ByType( CollectionType.Yourself ) diff --git a/Penumbra/UI/ConfigWindow.SettingsTab.General.cs b/Penumbra/UI/ConfigWindow.SettingsTab.General.cs index 379428d6..ea73e1b4 100644 --- a/Penumbra/UI/ConfigWindow.SettingsTab.General.cs +++ b/Penumbra/UI/ConfigWindow.SettingsTab.General.cs @@ -74,6 +74,8 @@ public partial class ConfigWindow Checkbox( $"Use {AssignedCollections} in Try-On Window", "Use the individual collection for your character's name in your try-on, dye preview or glamour plate window, if it is set.", Penumbra.Config.UseCharacterCollectionInTryOn, v => Penumbra.Config.UseCharacterCollectionInTryOn = v ); + Checkbox( "Use No Mods in Inspect Windows", "Use the empty collection for characters you are inspecting, regardless of the character.\n" + + "Takes precedence before the next option.", Penumbra.Config.UseNoModsInInspect, v => Penumbra.Config.UseNoModsInInspect = v ); Checkbox( $"Use {AssignedCollections} in Inspect Windows", "Use the appropriate individual collection for the character you are currently inspecting, based on their name.", Penumbra.Config.UseCharacterCollectionInInspect, v => Penumbra.Config.UseCharacterCollectionInInspect = v );