mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-30 04:13:43 +01:00
Reworked all of the meta, made StateIndex its own thing.
This commit is contained in:
parent
70e4833fb5
commit
1ad70541d3
36 changed files with 747 additions and 657 deletions
|
|
@ -523,15 +523,7 @@ public class DesignManager
|
|||
/// <summary> Change the application value of one of the meta flags. </summary>
|
||||
public void ChangeApplyMeta(Design design, MetaIndex metaIndex, bool value)
|
||||
{
|
||||
var change = metaIndex switch
|
||||
{
|
||||
MetaIndex.Wetness => design.SetApplyWetness(value),
|
||||
MetaIndex.HatState => design.SetApplyHatVisible(value),
|
||||
MetaIndex.VisorState => design.SetApplyVisorToggle(value),
|
||||
MetaIndex.WeaponState => design.SetApplyWeaponVisible(value),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(metaIndex), metaIndex, null),
|
||||
};
|
||||
if (!change)
|
||||
if (!design.SetApplyMeta(metaIndex, value))
|
||||
return;
|
||||
|
||||
design.LastEdit = DateTimeOffset.UtcNow;
|
||||
|
|
@ -556,14 +548,8 @@ public class DesignManager
|
|||
public void ApplyDesign(Design design, DesignBase other)
|
||||
{
|
||||
_undoStore[design.Identifier] = design.DesignData;
|
||||
if (other.DoApplyWetness())
|
||||
design.GetDesignDataRef().SetIsWet(other.DesignData.IsWet());
|
||||
if (other.DoApplyHatVisible())
|
||||
design.GetDesignDataRef().SetHatVisible(other.DesignData.IsHatVisible());
|
||||
if (other.DoApplyVisorToggle())
|
||||
design.GetDesignDataRef().SetVisor(other.DesignData.IsVisorToggled());
|
||||
if (other.DoApplyWeaponVisible())
|
||||
design.GetDesignDataRef().SetWeaponVisible(other.DesignData.IsWeaponVisible());
|
||||
foreach (var index in MetaExtensions.AllRelevant.Where(other.DoApplyMeta))
|
||||
design.GetDesignDataRef().SetMeta(index, other.DesignData.GetMeta(index));
|
||||
|
||||
if (design.DesignData.IsHuman)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue