mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Make stuff not apply in Aesthetician in general.
This commit is contained in:
parent
89b1a22800
commit
e64e94f78d
6 changed files with 37 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ using Glamourer.Customization;
|
||||||
using Glamourer.Events;
|
using Glamourer.Events;
|
||||||
using Glamourer.Interop.Structs;
|
using Glamourer.Interop.Structs;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
|
using Penumbra.String.Functions;
|
||||||
using CustomizeData = Penumbra.GameData.Structs.CustomizeData;
|
using CustomizeData = Penumbra.GameData.Structs.CustomizeData;
|
||||||
|
|
||||||
namespace Glamourer.Interop;
|
namespace Glamourer.Interop;
|
||||||
|
|
@ -74,9 +75,7 @@ public unsafe class ChangeCustomizeService : EventWrapper<Action<Model, Ref<Cust
|
||||||
{
|
{
|
||||||
var customize = new Ref<Customize>(new Customize(*(CustomizeData*)data));
|
var customize = new Ref<Customize>(new Customize(*(CustomizeData*)data));
|
||||||
Invoke(this, (Model)human, customize);
|
Invoke(this, (Model)human, customize);
|
||||||
fixed (byte* ptr = customize.Value.Data.Data)
|
((Customize*)data)->Load(customize.Value);
|
||||||
{
|
return _changeCustomizeHook.Original(human, data, skipEquipment);
|
||||||
return _changeCustomizeHook.Original(human, ptr, skipEquipment);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public readonly unsafe struct Actor : IEquatable<Actor>
|
||||||
=> actor.Address;
|
=> actor.Address;
|
||||||
|
|
||||||
public bool IsGPoseOrCutscene
|
public bool IsGPoseOrCutscene
|
||||||
=> Index is >= (int)ScreenActor.CutsceneStart and < (int)ScreenActor.CutsceneEnd;
|
=> Index.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);
|
||||||
|
|
@ -63,8 +63,8 @@ public readonly unsafe struct Actor : IEquatable<Actor>
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Index
|
public ObjectIndex Index
|
||||||
=> Valid ? AsObject->ObjectIndex : -1;
|
=> Valid ? AsObject->ObjectIndex : ObjectIndex.AnyIndex;
|
||||||
|
|
||||||
public Model Model
|
public Model Model
|
||||||
=> Valid ? AsObject->DrawObject : null;
|
=> Valid ? AsObject->DrawObject : null;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public unsafe class UpdateSlotService : IDisposable
|
||||||
var slot = slotIdx.ToEquipSlot();
|
var slot = slotIdx.ToEquipSlot();
|
||||||
var returnValue = ulong.MaxValue;
|
var returnValue = ulong.MaxValue;
|
||||||
SlotUpdatingEvent.Invoke(drawObject, slot, ref *data, ref returnValue);
|
SlotUpdatingEvent.Invoke(drawObject, slot, ref *data, ref returnValue);
|
||||||
Glamourer.Log.Excessive($"[FlagSlotForUpdate] Called with 0x{drawObject:X} for slot {slot} with {*data} ({returnValue}).");
|
Glamourer.Log.Excessive($"[FlagSlotForUpdate] Called with 0x{drawObject:X} for slot {slot} with {*data} ({returnValue:X}).");
|
||||||
return returnValue == ulong.MaxValue ? _flagSlotForUpdateHook.Original(drawObject, slotIdx, data) : returnValue;
|
return returnValue == ulong.MaxValue ? _flagSlotForUpdateHook.Original(drawObject, slotIdx, data) : returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Game;
|
using Dalamud.Game;
|
||||||
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.ClientState.Keys;
|
using Dalamud.Game.ClientState.Keys;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.Gui;
|
using Dalamud.Game.Gui;
|
||||||
|
|
@ -23,6 +24,7 @@ public class DalamudServices
|
||||||
services.AddSingleton(Commands);
|
services.AddSingleton(Commands);
|
||||||
services.AddSingleton(GameData);
|
services.AddSingleton(GameData);
|
||||||
services.AddSingleton(ClientState);
|
services.AddSingleton(ClientState);
|
||||||
|
services.AddSingleton(Condition);
|
||||||
services.AddSingleton(GameGui);
|
services.AddSingleton(GameGui);
|
||||||
services.AddSingleton(Chat);
|
services.AddSingleton(Chat);
|
||||||
services.AddSingleton(Framework);
|
services.AddSingleton(Framework);
|
||||||
|
|
@ -40,6 +42,7 @@ public class DalamudServices
|
||||||
[PluginService][RequiredVersion("1.0")] public ICommandManager Commands { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public ICommandManager Commands { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public IDataManager GameData { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public IDataManager GameData { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public IClientState ClientState { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public IClientState ClientState { get; private set; } = null!;
|
||||||
|
[PluginService][RequiredVersion("1.0")] public Condition Condition { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public IGameGui GameGui { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public IGameGui GameGui { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public ChatGui Chat { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public ChatGui Chat { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public Framework Framework { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public Framework Framework { get; private set; } = null!;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public unsafe class FunModule
|
||||||
if (actor.AsCharacter->CharacterData.ModelCharaId != 0)
|
if (actor.AsCharacter->CharacterData.ModelCharaId != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyEmperor(new Span<CharacterArmor>(ref armor));
|
ApplyEmperor(new Span<CharacterArmor>(ref armor), slot);
|
||||||
ApplyClown(new Span<CharacterArmor>(ref armor));
|
ApplyClown(new Span<CharacterArmor>(ref armor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ using Penumbra.GameData.Data;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using System;
|
using System;
|
||||||
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
|
|
||||||
namespace Glamourer.State;
|
namespace Glamourer.State;
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@ public class StateListener : IDisposable
|
||||||
private readonly MovedEquipment _movedEquipment;
|
private readonly MovedEquipment _movedEquipment;
|
||||||
private readonly GPoseService _gPose;
|
private readonly GPoseService _gPose;
|
||||||
private readonly ChangeCustomizeService _changeCustomizeService;
|
private readonly ChangeCustomizeService _changeCustomizeService;
|
||||||
|
private readonly Condition _condition;
|
||||||
|
|
||||||
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
||||||
private ActorState? _creatingState;
|
private ActorState? _creatingState;
|
||||||
|
|
@ -55,7 +57,7 @@ public class StateListener : IDisposable
|
||||||
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, GPoseService gPose,
|
StateApplier applier, MovedEquipment movedEquipment, ObjectManager objects, GPoseService gPose,
|
||||||
ChangeCustomizeService changeCustomizeService, CustomizationService customizations)
|
ChangeCustomizeService changeCustomizeService, CustomizationService customizations, Condition condition)
|
||||||
{
|
{
|
||||||
_manager = manager;
|
_manager = manager;
|
||||||
_items = items;
|
_items = items;
|
||||||
|
|
@ -76,6 +78,7 @@ public class StateListener : IDisposable
|
||||||
_gPose = gPose;
|
_gPose = gPose;
|
||||||
_changeCustomizeService = changeCustomizeService;
|
_changeCustomizeService = changeCustomizeService;
|
||||||
_customizations = customizations;
|
_customizations = customizations;
|
||||||
|
_condition = condition;
|
||||||
|
|
||||||
if (Enabled)
|
if (Enabled)
|
||||||
Subscribe();
|
Subscribe();
|
||||||
|
|
@ -123,6 +126,9 @@ public class StateListener : IDisposable
|
||||||
private unsafe void OnCreatingCharacterBase(nint actorPtr, string _, nint modelPtr, nint customizePtr, nint equipDataPtr)
|
private unsafe void OnCreatingCharacterBase(nint actorPtr, string _, nint modelPtr, nint customizePtr, nint equipDataPtr)
|
||||||
{
|
{
|
||||||
var actor = (Actor)actorPtr;
|
var actor = (Actor)actorPtr;
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||||
|
return;
|
||||||
|
|
||||||
_creatingIdentifier = actor.GetIdentifier(_actors.AwaitedService);
|
_creatingIdentifier = actor.GetIdentifier(_actors.AwaitedService);
|
||||||
|
|
||||||
ref var modelId = ref *(uint*)modelPtr;
|
ref var modelId = ref *(uint*)modelPtr;
|
||||||
|
|
@ -154,7 +160,7 @@ public class StateListener : IDisposable
|
||||||
|
|
||||||
private unsafe void OnCustomizeChange(Model model, Ref<Customize> customize)
|
private unsafe void OnCustomizeChange(Model model, Ref<Customize> customize)
|
||||||
{
|
{
|
||||||
if (!model.IsHuman)
|
if (_condition[ConditionFlag.CreatingCharacter] || !model.IsHuman)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var actor = _penumbra.GameObjectFromDrawObject(model);
|
var actor = _penumbra.GameObjectFromDrawObject(model);
|
||||||
|
|
@ -206,6 +212,9 @@ public class StateListener : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnSlotUpdating(Model model, EquipSlot slot, Ref<CharacterArmor> armor, Ref<ulong> returnValue)
|
private void OnSlotUpdating(Model model, EquipSlot slot, Ref<CharacterArmor> armor, Ref<ulong> returnValue)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
var actor = _penumbra.GameObjectFromDrawObject(model);
|
var actor = _penumbra.GameObjectFromDrawObject(model);
|
||||||
if (actor.Identifier(_actors.AwaitedService, out var identifier)
|
if (actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||||
&& _manager.TryGetValue(identifier, out var state))
|
&& _manager.TryGetValue(identifier, out var state))
|
||||||
|
|
@ -259,6 +268,9 @@ public class StateListener : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnWeaponLoading(Actor actor, EquipSlot slot, Ref<CharacterWeapon> weapon)
|
private void OnWeaponLoading(Actor actor, EquipSlot slot, Ref<CharacterWeapon> weapon)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
// Fist weapon gauntlet hack.
|
// Fist weapon gauntlet hack.
|
||||||
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Set.Id != 0 && _lastFistOffhand.Set.Id != 0)
|
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Set.Id != 0 && _lastFistOffhand.Set.Id != 0)
|
||||||
weapon.Value = _lastFistOffhand;
|
weapon.Value = _lastFistOffhand;
|
||||||
|
|
@ -448,6 +460,9 @@ public class StateListener : IDisposable
|
||||||
/// <summary> Handle visor state changes made by the game. </summary>
|
/// <summary> Handle visor state changes made by the game. </summary>
|
||||||
private void OnVisorChange(Model model, Ref<bool> value)
|
private void OnVisorChange(Model model, Ref<bool> value)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
// Find appropriate actor and state.
|
// Find appropriate actor and state.
|
||||||
// We do not need to handle fixed designs,
|
// We do not need to handle fixed designs,
|
||||||
// since a fixed design would already have established state-tracking.
|
// since a fixed design would already have established state-tracking.
|
||||||
|
|
@ -478,6 +493,9 @@ public class StateListener : IDisposable
|
||||||
/// <summary> Handle Hat Visibility changes. These act on the game object. </summary>
|
/// <summary> Handle Hat Visibility changes. These act on the game object. </summary>
|
||||||
private void OnHeadGearVisibilityChange(Actor actor, Ref<bool> value)
|
private void OnHeadGearVisibilityChange(Actor actor, Ref<bool> value)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
// Find appropriate state.
|
// Find appropriate state.
|
||||||
// We do not need to handle fixed designs,
|
// We do not need to handle fixed designs,
|
||||||
// if there is no model that caused a fixed design to exist yet,
|
// if there is no model that caused a fixed design to exist yet,
|
||||||
|
|
@ -508,6 +526,9 @@ public class StateListener : IDisposable
|
||||||
/// <summary> Handle Weapon Visibility changes. These act on the game object. </summary>
|
/// <summary> Handle Weapon Visibility changes. These act on the game object. </summary>
|
||||||
private void OnWeaponVisibilityChange(Actor actor, Ref<bool> value)
|
private void OnWeaponVisibilityChange(Actor actor, Ref<bool> value)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
// Find appropriate state.
|
// Find appropriate state.
|
||||||
// We do not need to handle fixed designs,
|
// We do not need to handle fixed designs,
|
||||||
// if there is no model that caused a fixed design to exist yet,
|
// if there is no model that caused a fixed design to exist yet,
|
||||||
|
|
@ -579,6 +600,9 @@ public class StateListener : IDisposable
|
||||||
|
|
||||||
private void OnCreatedCharacterBase(nint gameObject, string _, nint drawObject)
|
private void OnCreatedCharacterBase(nint gameObject, string _, nint drawObject)
|
||||||
{
|
{
|
||||||
|
if (_condition[ConditionFlag.CreatingCharacter])
|
||||||
|
return;
|
||||||
|
|
||||||
if (_creatingState == null)
|
if (_creatingState == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue