mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 12:44:19 +01:00
Fix enable/disable/inherit all descendants.
This commit is contained in:
parent
4ef8eeb042
commit
ea4d087ae9
2 changed files with 16 additions and 16 deletions
|
|
@ -81,34 +81,33 @@ public partial class ModCollection
|
|||
|
||||
private void OnModSettingChange( ModSettingChange type, int modIdx, int oldValue, int groupIdx, bool _ )
|
||||
{
|
||||
var mod = Penumbra.ModManager[ modIdx ];
|
||||
switch( type )
|
||||
{
|
||||
case ModSettingChange.Inheritance:
|
||||
ReloadMod( mod, true );
|
||||
ReloadMod( Penumbra.ModManager[ modIdx ], true );
|
||||
break;
|
||||
case ModSettingChange.EnableState:
|
||||
if( oldValue != 1 )
|
||||
{
|
||||
AddMod( mod, true );
|
||||
AddMod( Penumbra.ModManager[ modIdx ], true );
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveMod( mod, true );
|
||||
RemoveMod( Penumbra.ModManager[ modIdx ], true );
|
||||
}
|
||||
|
||||
break;
|
||||
case ModSettingChange.Priority:
|
||||
if( Conflicts( mod ).Count > 0 )
|
||||
if( Conflicts( Penumbra.ModManager[ modIdx ] ).Count > 0 )
|
||||
{
|
||||
ReloadMod( mod, true );
|
||||
ReloadMod( Penumbra.ModManager[ modIdx ], true );
|
||||
}
|
||||
|
||||
break;
|
||||
case ModSettingChange.Setting:
|
||||
if( _collection[ modIdx ].Settings?.Enabled == true )
|
||||
{
|
||||
ReloadMod( mod, true );
|
||||
ReloadMod( Penumbra.ModManager[ modIdx ], true );
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -248,6 +247,7 @@ public partial class ModCollection
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddSubMod( mod.Default, mod );
|
||||
|
||||
if( addMetaChanges )
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public partial class ModCollection
|
|||
var changes = false;
|
||||
foreach( var mod in mods )
|
||||
{
|
||||
var oldValue = _settings[ mod.Index ]?.Enabled ?? this[ mod.Index ].Settings?.Enabled ?? false;
|
||||
var oldValue = _settings[ mod.Index ]?.Enabled;
|
||||
if( newValue != oldValue )
|
||||
{
|
||||
FixInheritance( mod.Index, false );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue