mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-26 02:19:20 +01:00
Lots of collection progress.
This commit is contained in:
parent
d908f22a17
commit
3f33bab296
22 changed files with 666 additions and 636 deletions
|
|
@ -57,7 +57,8 @@ public class ItemSwapTab : IDisposable, ITab
|
|||
};
|
||||
|
||||
_communicator.CollectionChange.Subscribe(OnCollectionChange);
|
||||
_collectionManager.Active.Current.ModSettingChanged += OnSettingChange;
|
||||
_communicator.ModSettingChanged.Subscribe(OnSettingChange);
|
||||
_communicator.CollectionInheritanceChanged.Subscribe(OnInheritanceChange);
|
||||
_communicator.ModOptionChanged.Subscribe(OnModOptionChange);
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +103,8 @@ public class ItemSwapTab : IDisposable, ITab
|
|||
public void Dispose()
|
||||
{
|
||||
_communicator.CollectionChange.Unsubscribe(OnCollectionChange);
|
||||
_collectionManager.Active.Current.ModSettingChanged -= OnSettingChange;
|
||||
_communicator.ModSettingChanged.Unsubscribe(OnSettingChange);
|
||||
_communicator.CollectionInheritanceChanged.Unsubscribe(OnInheritanceChange);
|
||||
_communicator.ModOptionChanged.Unsubscribe(OnModOptionChange);
|
||||
}
|
||||
|
||||
|
|
@ -744,21 +746,29 @@ public class ItemSwapTab : IDisposable, ITab
|
|||
if (collectionType != CollectionType.Current || _mod == null || newCollection == null)
|
||||
return;
|
||||
|
||||
UpdateMod(_mod, _mod.Index < newCollection.Settings.Count ? newCollection.Settings[_mod.Index] : null);
|
||||
newCollection.ModSettingChanged += OnSettingChange;
|
||||
if (oldCollection != null)
|
||||
oldCollection.ModSettingChanged -= OnSettingChange;
|
||||
UpdateMod(_mod, _mod.Index < newCollection.Settings.Count ? newCollection[_mod.Index].Settings : null);
|
||||
}
|
||||
|
||||
private void OnSettingChange(ModSettingChange type, int modIdx, int oldValue, int groupIdx, bool inherited)
|
||||
private void OnSettingChange(ModCollection collection, ModSettingChange type, Mod? mod, int oldValue, int groupIdx, bool inherited)
|
||||
{
|
||||
if (modIdx != _mod?.Index)
|
||||
|
||||
if (collection != _collectionManager.Active.Current || mod != _mod)
|
||||
return;
|
||||
|
||||
_swapData.LoadMod(_mod, _modSettings);
|
||||
_dirty = true;
|
||||
}
|
||||
|
||||
private void OnInheritanceChange(ModCollection collection, bool _)
|
||||
{
|
||||
if (collection != _collectionManager.Active.Current || _mod == null)
|
||||
return;
|
||||
|
||||
UpdateMod(_mod, collection[_mod.Index].Settings);
|
||||
_swapData.LoadMod(_mod, _modSettings);
|
||||
_dirty = true;
|
||||
}
|
||||
|
||||
private void OnModOptionChange(ModOptionChangeType type, Mod mod, int a, int b, int c)
|
||||
{
|
||||
if (type is ModOptionChangeType.PrepareChange || mod != _mod)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue