Current state.

This commit is contained in:
Ottermandias 2024-12-27 16:02:50 +01:00
parent 67305d507a
commit 98a89bb2b4
28 changed files with 606 additions and 265 deletions

View file

@ -74,6 +74,9 @@ public class ModMetaEditor(
dict.ClearForDefault();
var count = 0;
foreach (var value in clone.GlobalEqp)
dict.TryAdd(value);
foreach (var (key, value) in clone.Imc)
{
var defaultEntry = ImcChecker.GetDefaultEntry(key, false);

View file

@ -36,9 +36,16 @@ public class ModSelection : EventWrapper<Mod?, Mod?, ModSelection.Priority>
_communicator.ModSettingChanged.Subscribe(OnSettingChange, ModSettingChanged.Priority.ModSelection);
}
public ModSettings Settings { get; private set; } = ModSettings.Empty;
public ModCollection Collection { get; private set; } = ModCollection.Empty;
public Mod? Mod { get; private set; }
public ModSettings Settings { get; private set; } = ModSettings.Empty;
public ModCollection Collection { get; private set; } = ModCollection.Empty;
public Mod? Mod { get; private set; }
public ModSettings? OwnSettings { get; private set; }
public bool IsTemporary
=> OwnSettings != Settings;
public TemporaryModSettings? AsTemporarySettings
=> Settings as TemporaryModSettings;
public void SelectMod(Mod? mod)
@ -83,12 +90,14 @@ public class ModSelection : EventWrapper<Mod?, Mod?, ModSelection.Priority>
{
if (Mod == null)
{
Settings = ModSettings.Empty;
Collection = ModCollection.Empty;
Settings = ModSettings.Empty;
Collection = ModCollection.Empty;
OwnSettings = null;
}
else
{
(var settings, Collection) = _collections.Current[Mod.Index];
(var settings, Collection) = _collections.Current.GetActualSettings(Mod.Index);
OwnSettings = _collections.Current.GetOwnSettings(Mod.Index);
Settings = settings ?? ModSettings.Empty;
}
}

View file

@ -12,7 +12,7 @@ namespace Penumbra.Mods.Settings;
public class ModSettings
{
public static readonly ModSettings Empty = new();
public SettingList Settings { get; private init; } = [];
public SettingList Settings { get; internal init; } = [];
public ModPriority Priority { get; set; }
public bool Enabled { get; set; }