Add option to not use any mods when inspecting players.

This commit is contained in:
Ottermandias 2023-01-06 16:03:45 +01:00
parent 72408bf45c
commit 28ab12c21b
3 changed files with 10 additions and 2 deletions

View file

@ -37,6 +37,7 @@ public partial class Configuration : IPluginConfiguration
public bool UseCharacterCollectionInInspect { get; set; } = true; public bool UseCharacterCollectionInInspect { get; set; } = true;
public bool UseCharacterCollectionInTryOn { get; set; } = true; public bool UseCharacterCollectionInTryOn { get; set; } = true;
public bool UseOwnerNameForCharacterCollection { get; set; } = true; public bool UseOwnerNameForCharacterCollection { get; set; } = true;
public bool UseNoModsInInspect { get; set; } = false;
public bool HideRedrawBar { get; set; } = false; public bool HideRedrawBar { get; set; } = false;

View file

@ -57,6 +57,11 @@ public unsafe partial class PathResolver
} }
var identifier = Penumbra.Actors.FromObject( gameObject, out var owner, true, false ); 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 ); identifier = Penumbra.CollectionManager.Individuals.ConvertSpecialIdentifier( identifier );
var collection = CollectionByIdentifier( identifier ) var collection = CollectionByIdentifier( identifier )
?? CheckYourself( identifier, gameObject ) ?? CheckYourself( identifier, gameObject )
@ -77,8 +82,8 @@ public unsafe partial class PathResolver
// or the default collection if no player exists. // or the default collection if no player exists.
public static ModCollection PlayerCollection() public static ModCollection PlayerCollection()
{ {
using var performance = Penumbra.Performance.Measure( PerformanceType.IdentifyCollection ); using var performance = Penumbra.Performance.Measure( PerformanceType.IdentifyCollection );
var gameObject = ( GameObject* )Dalamud.Objects.GetObjectAddress( 0 ); var gameObject = ( GameObject* )Dalamud.Objects.GetObjectAddress( 0 );
if( gameObject == null ) if( gameObject == null )
{ {
return Penumbra.CollectionManager.ByType( CollectionType.Yourself ) return Penumbra.CollectionManager.ByType( CollectionType.Yourself )

View file

@ -74,6 +74,8 @@ public partial class ConfigWindow
Checkbox( $"Use {AssignedCollections} in Try-On Window", 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.", "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 ); 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", Checkbox( $"Use {AssignedCollections} in Inspect Windows",
"Use the appropriate individual collection for the character you are currently inspecting, based on their name.", "Use the appropriate individual collection for the character you are currently inspecting, based on their name.",
Penumbra.Config.UseCharacterCollectionInInspect, v => Penumbra.Config.UseCharacterCollectionInInspect = v ); Penumbra.Config.UseCharacterCollectionInInspect, v => Penumbra.Config.UseCharacterCollectionInInspect = v );