A few comments, further cleanup. A few TODOs handled.

This commit is contained in:
Ottermandias 2022-04-27 17:19:33 +02:00
parent dbb9931189
commit c78725d7d5
47 changed files with 347 additions and 3664 deletions

View file

@ -251,7 +251,7 @@ public partial class ModCollection
return;
}
var mod = Penumbra.ModManager.Mods[ modIdx ];
var mod = Penumbra.ModManager[ modIdx ];
AddSubMod( mod.Default, new FileRegister( modIdx, settings.Priority, 0, 0 ), withManipulations );
for( var idx = 0; idx < mod.Groups.Count; ++idx )
{

View file

@ -98,7 +98,7 @@ public partial class ModCollection
if( oldValue != newValue )
{
var inheritance = FixInheritance( idx, false );
_settings[ idx ]!.SetValue( Penumbra.ModManager.Mods[ idx ], groupIdx, newValue );
_settings[ idx ]!.SetValue( Penumbra.ModManager[ idx ], groupIdx, newValue );
ModSettingChanged.Invoke( ModSettingChange.Setting, idx, inheritance ? -1 : ( int )oldValue, groupIdx, false );
}
}
@ -137,7 +137,7 @@ public partial class ModCollection
return false;
}
_settings[ idx ] = inherit ? null : this[ idx ].Settings?.DeepCopy() ?? ModSettings.DefaultSettings( Penumbra.ModManager.Mods[ idx ] );
_settings[ idx ] = inherit ? null : this[ idx ].Settings?.DeepCopy() ?? ModSettings.DefaultSettings( Penumbra.ModManager[ idx ] );
return true;
}

View file

@ -32,6 +32,10 @@ public partial class ModCollection
public IReadOnlyList< ModSettings? > Settings
=> _settings;
// Returns whether there are settings not in use by any current mod.
public bool HasUnusedSettings
=> _unusedSettings.Count > 0;
// Evaluates the settings along the whole inheritance tree.
public IEnumerable< ModSettings? > ActualSettings
=> Enumerable.Range( 0, _settings.Count ).Select( i => this[ i ].Settings );