mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-19 22:17:44 +01:00
Add option to skip or partially apply invalid automatic design customizations.
This commit is contained in:
parent
f8f90124ee
commit
279a5d6923
3 changed files with 19 additions and 14 deletions
|
|
@ -102,7 +102,7 @@ public class AutoDesignApplier : IDisposable
|
|||
if (!GetPlayerSet(id, out var set))
|
||||
{
|
||||
if (_state.TryGetValue(id, out var s))
|
||||
s.LastJob = (byte) newJob.Id;
|
||||
s.LastJob = (byte)newJob.Id;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -143,23 +143,14 @@ public class AutoDesignApplier : IDisposable
|
|||
return false;
|
||||
}
|
||||
else if (!GetPlayerSet(identifier, out set!))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reduce(actor, state, set, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Reduce(Actor actor, ActorIdentifier identifier, ActorState state)
|
||||
{
|
||||
if (!_config.EnableAutoDesigns)
|
||||
return;
|
||||
|
||||
if (!GetPlayerSet(identifier, out var set))
|
||||
return;
|
||||
|
||||
Reduce(actor, state, set, true);
|
||||
}
|
||||
|
||||
private unsafe void Reduce(Actor actor, ActorState state, AutoDesignSet set, bool respectManual)
|
||||
{
|
||||
EquipFlag totalEquipFlags = 0;
|
||||
|
|
@ -273,6 +264,15 @@ public class AutoDesignApplier : IDisposable
|
|||
|
||||
var customize = state.ModelData.Customize;
|
||||
CustomizeFlag fixFlags = 0;
|
||||
|
||||
// Skip invalid designs entirely.
|
||||
if (_config.SkipInvalidCustomizations
|
||||
&& !_code.EnabledMesmer
|
||||
&& (customize.Clan != design.Customize.Clan
|
||||
|| customize.Gender != design.Customize.Gender
|
||||
|| customize.Face != design.Customize.Face))
|
||||
return;
|
||||
|
||||
if (customizeFlags.HasFlag(CustomizeFlag.Clan))
|
||||
{
|
||||
if (!respectManual || state[CustomizeIndex.Clan] is not StateChanged.Source.Manual)
|
||||
|
|
@ -283,6 +283,9 @@ public class AutoDesignApplier : IDisposable
|
|||
|
||||
if (customizeFlags.HasFlag(CustomizeFlag.Gender))
|
||||
{
|
||||
if (_config.SkipInvalidCustomizations && customize.Gender != design.Customize.Gender)
|
||||
return;
|
||||
|
||||
if (!respectManual || state[CustomizeIndex.Gender] is not StateChanged.Source.Manual)
|
||||
fixFlags |= _customizations.ChangeGender(ref customize, design.Customize.Gender);
|
||||
customizeFlags &= ~CustomizeFlag.Gender;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue