mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-13 12:14:18 +01:00
Fix sources, let invalid model state weapons reset to base if necessary, check design application against base type.
This commit is contained in:
parent
ee426eb29f
commit
c99aa51f8a
3 changed files with 6 additions and 7 deletions
|
|
@ -1,6 +1,4 @@
|
|||
using Glamourer.Events;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.State;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,6 @@ public class StateEditor(
|
|||
if (settings.RespectManual && state.Sources[weaponSlot, false].IsManual())
|
||||
continue;
|
||||
|
||||
var currentType = state.ModelData.Item(weaponSlot).Type;
|
||||
if (!settings.FromJobChange)
|
||||
{
|
||||
if (gPose.InGPose)
|
||||
|
|
@ -291,10 +290,11 @@ public class StateEditor(
|
|||
});
|
||||
}
|
||||
|
||||
var currentType = state.BaseData.Item(weaponSlot).Type;
|
||||
if (mergedDesign.Weapons.TryGetValue(currentType, out var weapon))
|
||||
{
|
||||
var source = settings.UseSingleSource ? settings.Source :
|
||||
weapon.Item2 is StateSource.Game ? StateSource.Game : weapon.Item2;
|
||||
weapon.Item2 is StateSource.Game ? StateSource.Game : settings.Source;
|
||||
Editor.ChangeItem(state, weaponSlot, weapon.Item1, source, out _,
|
||||
settings.Key);
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ public class StateEditor(
|
|||
if (settings.FromJobChange)
|
||||
jobChange.Set(state, mergedDesign.Weapons.Values.Select(m =>
|
||||
(m.Item1, settings.UseSingleSource ? settings.Source :
|
||||
m.Item2 is StateSource.Game ? StateSource.Game : m.Item2)));
|
||||
m.Item2 is StateSource.Game ? StateSource.Game : settings.Source)));
|
||||
|
||||
foreach (var meta in MetaExtensions.AllRelevant.Where(mergedDesign.Design.DoApplyMeta))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -331,7 +331,8 @@ public class StateListener : IDisposable
|
|||
{
|
||||
if (weapon.Skeleton.Id != 0)
|
||||
weapon = weapon.With(newWeapon.Stain);
|
||||
_manager.ChangeItem(state, slot, state.BaseData.Item(slot), ApplySettings.Game);
|
||||
// Force unlock if necessary.
|
||||
_manager.ChangeItem(state, slot, state.BaseData.Item(slot), ApplySettings.Game with { Key = state.Combination });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue