mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Fix gpose weapon type when redrawing is necessary.
This commit is contained in:
parent
4fee749954
commit
4ac062fdc5
3 changed files with 8 additions and 3 deletions
|
|
@ -42,6 +42,9 @@ public readonly unsafe struct Actor : IEquatable<Actor>
|
||||||
public static implicit operator nint(Actor actor)
|
public static implicit operator nint(Actor actor)
|
||||||
=> actor.Address;
|
=> actor.Address;
|
||||||
|
|
||||||
|
public bool IsGPoseOrCutscene
|
||||||
|
=> Index is >= (int)ScreenActor.CutsceneStart and < (int)ScreenActor.CutsceneEnd;
|
||||||
|
|
||||||
public ActorIdentifier GetIdentifier(ActorManager actors)
|
public ActorIdentifier GetIdentifier(ActorManager actors)
|
||||||
=> actors.FromObject(AsObject, out _, true, true, false);
|
=> actors.FromObject(AsObject, out _, true, true, false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,5 +45,5 @@ public readonly struct ActorData
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActorData OnlyGPose()
|
public ActorData OnlyGPose()
|
||||||
=> new(Objects.Where(o => o.Index is >= (int)ScreenActor.GPosePlayer and < (int)ScreenActor.CutsceneEnd).ToList(), Label);
|
=> new(Objects.Where(o => o.IsGPoseOrCutscene).ToList(), Label);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public class StateListener : IDisposable
|
||||||
private readonly FunModule _funModule;
|
private readonly FunModule _funModule;
|
||||||
private readonly HumanModelList _humans;
|
private readonly HumanModelList _humans;
|
||||||
private readonly MovedEquipment _movedEquipment;
|
private readonly MovedEquipment _movedEquipment;
|
||||||
|
private readonly GPoseService _gpose;
|
||||||
|
|
||||||
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
||||||
private ActorState? _creatingState;
|
private ActorState? _creatingState;
|
||||||
|
|
@ -51,7 +52,7 @@ public class StateListener : IDisposable
|
||||||
public StateListener(StateManager manager, ItemManager items, PenumbraService penumbra, ActorService actors, Configuration config,
|
public StateListener(StateManager manager, ItemManager items, PenumbraService penumbra, ActorService actors, Configuration config,
|
||||||
SlotUpdating slotUpdating, WeaponLoading weaponLoading, VisorStateChanged visorState, WeaponVisibilityChanged weaponVisibility,
|
SlotUpdating slotUpdating, WeaponLoading weaponLoading, VisorStateChanged visorState, WeaponVisibilityChanged weaponVisibility,
|
||||||
HeadGearVisibilityChanged headGearVisibility, AutoDesignApplier autoDesignApplier, FunModule funModule, HumanModelList humans,
|
HeadGearVisibilityChanged headGearVisibility, AutoDesignApplier autoDesignApplier, FunModule funModule, HumanModelList humans,
|
||||||
StateApplier applier, MovedEquipment movedEquipment, ObjectManager objects)
|
StateApplier applier, MovedEquipment movedEquipment, ObjectManager objects, GPoseService gpose)
|
||||||
{
|
{
|
||||||
_manager = manager;
|
_manager = manager;
|
||||||
_items = items;
|
_items = items;
|
||||||
|
|
@ -69,6 +70,7 @@ public class StateListener : IDisposable
|
||||||
_applier = applier;
|
_applier = applier;
|
||||||
_movedEquipment = movedEquipment;
|
_movedEquipment = movedEquipment;
|
||||||
_objects = objects;
|
_objects = objects;
|
||||||
|
_gpose = gpose;
|
||||||
|
|
||||||
if (Enabled)
|
if (Enabled)
|
||||||
Subscribe();
|
Subscribe();
|
||||||
|
|
@ -248,7 +250,7 @@ public class StateListener : IDisposable
|
||||||
{
|
{
|
||||||
// Only allow overwriting identical weapons
|
// Only allow overwriting identical weapons
|
||||||
var newWeapon = state.ModelData.Weapon(slot);
|
var newWeapon = state.ModelData.Weapon(slot);
|
||||||
if (baseType is FullEquipType.Unknown || baseType == state.ModelData.Item(slot).Type)
|
if (baseType is FullEquipType.Unknown || baseType == state.ModelData.Item(slot).Type || _gpose.InGPose && actor.IsGPoseOrCutscene)
|
||||||
actorWeapon = newWeapon;
|
actorWeapon = newWeapon;
|
||||||
else if (actorWeapon.Set.Value != 0)
|
else if (actorWeapon.Set.Value != 0)
|
||||||
actorWeapon = actorWeapon.With(newWeapon.Stain);
|
actorWeapon = actorWeapon.With(newWeapon.Stain);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue