mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 07:17:53 +01:00
Start group rework.
This commit is contained in:
parent
75cfffeba7
commit
8fc7de64d9
9 changed files with 106 additions and 45 deletions
|
|
@ -1,5 +1,7 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.Collections.Cache;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Subclasses;
|
||||
using Penumbra.String.Classes;
|
||||
|
|
@ -59,6 +61,23 @@ public sealed class Mod : IMod
|
|||
public readonly SubMod Default;
|
||||
public readonly List<IModGroup> Groups = [];
|
||||
|
||||
public AppliedModData GetData(ModSettings? settings = null)
|
||||
{
|
||||
if (settings is not { Enabled: true })
|
||||
return AppliedModData.Empty;
|
||||
|
||||
var dictRedirections = new Dictionary<Utf8GamePath, FullPath>(TotalFileCount);
|
||||
var setManips = new HashSet<MetaManipulation>(TotalManipulations);
|
||||
foreach (var (group, groupIndex) in Groups.WithIndex().OrderByDescending(g => g.Value.Priority))
|
||||
{
|
||||
var config = settings.Settings[groupIndex];
|
||||
group.AddData(config, dictRedirections, setManips);
|
||||
}
|
||||
|
||||
((ISubMod)Default).AddData(dictRedirections, setManips);
|
||||
return new AppliedModData(dictRedirections, setManips);
|
||||
}
|
||||
|
||||
ISubMod IMod.Default
|
||||
=> Default;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue