mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-19 14:07:43 +01:00
Move MetaIndex to its first class enum.
This commit is contained in:
parent
e4fc86ca38
commit
4f9e224494
10 changed files with 147 additions and 148 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Glamourer.Events;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.State;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
@ -15,15 +16,38 @@ public sealed class MergedDesign
|
|||
Design.ApplyCustomize = 0;
|
||||
Design.ApplyCrest = 0;
|
||||
Design.ApplyParameters = 0;
|
||||
Design.SetApplyWetness(false);
|
||||
Design.SetApplyVisorToggle(false);
|
||||
Design.SetApplyWeaponVisible(false);
|
||||
Design.SetApplyHatVisible(false);
|
||||
Design.ApplyMeta = 0;
|
||||
}
|
||||
|
||||
public MergedDesign(DesignBase design)
|
||||
{
|
||||
Design = design;
|
||||
if (design.DoApplyEquip(EquipSlot.MainHand))
|
||||
{
|
||||
var weapon = design.DesignData.Item(EquipSlot.MainHand);
|
||||
if (weapon.Valid)
|
||||
Weapons.TryAdd(weapon.Type, (weapon, StateChanged.Source.Manual));
|
||||
}
|
||||
|
||||
if (design.DoApplyEquip(EquipSlot.OffHand))
|
||||
{
|
||||
var weapon = design.DesignData.Item(EquipSlot.OffHand);
|
||||
if (weapon.Valid)
|
||||
Weapons.TryAdd(weapon.Type, (weapon, StateChanged.Source.Manual));
|
||||
}
|
||||
}
|
||||
|
||||
public MergedDesign(Design design)
|
||||
: this((DesignBase)design)
|
||||
{
|
||||
foreach (var (mod, settings) in design.AssociatedMods)
|
||||
AssociatedMods[mod] = settings;
|
||||
}
|
||||
|
||||
public readonly DesignBase Design;
|
||||
public readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> Weapons = new(4);
|
||||
public readonly StateSource Source = new();
|
||||
public readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> Weapons = new(4);
|
||||
public readonly StateSource Source = new();
|
||||
public readonly SortedList<Mod, ModSettings> AssociatedMods = [];
|
||||
|
||||
public StateChanged.Source GetSource(EquipSlot slot, bool stain, StateChanged.Source actualSource)
|
||||
=> GetSource(Source[slot, stain], actualSource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue