mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Merge branch 'Ottermandias:main' into main
This commit is contained in:
commit
2e11481276
6 changed files with 33 additions and 12 deletions
|
|
@ -6,8 +6,8 @@ namespace Glamourer.Gui.Customization;
|
||||||
|
|
||||||
public struct CustomizeParameterDrawData(CustomizeParameterFlag flag, in DesignData data)
|
public struct CustomizeParameterDrawData(CustomizeParameterFlag flag, in DesignData data)
|
||||||
{
|
{
|
||||||
private IDesignEditor _editor;
|
private IDesignEditor _editor = null!;
|
||||||
private object _object;
|
private object _object = null!;
|
||||||
public readonly CustomizeParameterFlag Flag = flag;
|
public readonly CustomizeParameterFlag Flag = flag;
|
||||||
public bool Locked;
|
public bool Locked;
|
||||||
public bool DisplayApplication;
|
public bool DisplayApplication;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ namespace Glamourer.Gui.Equipment;
|
||||||
|
|
||||||
public struct BonusDrawData(BonusItemFlag slot, in DesignData designData)
|
public struct BonusDrawData(BonusItemFlag slot, in DesignData designData)
|
||||||
{
|
{
|
||||||
private IDesignEditor _editor;
|
private IDesignEditor _editor = null!;
|
||||||
private object _object;
|
private object _object = null!;
|
||||||
public readonly BonusItemFlag Slot = slot;
|
public readonly BonusItemFlag Slot = slot;
|
||||||
public bool Locked;
|
public bool Locked;
|
||||||
public bool DisplayApplication;
|
public bool DisplayApplication;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ namespace Glamourer.Gui.Equipment;
|
||||||
|
|
||||||
public struct EquipDrawData(EquipSlot slot, in DesignData designData)
|
public struct EquipDrawData(EquipSlot slot, in DesignData designData)
|
||||||
{
|
{
|
||||||
private IDesignEditor _editor;
|
private IDesignEditor _editor = null!;
|
||||||
private object _object;
|
private object _object = null!;
|
||||||
public readonly EquipSlot Slot = slot;
|
public readonly EquipSlot Slot = slot;
|
||||||
public bool Locked;
|
public bool Locked;
|
||||||
public bool DisplayApplication;
|
public bool DisplayApplication;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||||
using Glamourer.GameData;
|
using Glamourer.GameData;
|
||||||
using Penumbra.GameData.DataContainers;
|
using Penumbra.GameData.DataContainers;
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
|
|
@ -53,6 +54,7 @@ public class StateListener : IDisposable
|
||||||
private readonly Dictionary<Actor, CharacterWeapon> _fistOffhands = [];
|
private readonly Dictionary<Actor, CharacterWeapon> _fistOffhands = [];
|
||||||
|
|
||||||
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
private ActorIdentifier _creatingIdentifier = ActorIdentifier.Invalid;
|
||||||
|
private bool _isPlayerNpc;
|
||||||
private ActorState? _creatingState;
|
private ActorState? _creatingState;
|
||||||
private ActorState? _customizeState;
|
private ActorState? _customizeState;
|
||||||
|
|
||||||
|
|
@ -122,11 +124,13 @@ public class StateListener : IDisposable
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_creatingIdentifier = actor.GetIdentifier(_actors);
|
_creatingIdentifier = actor.GetIdentifier(_actors);
|
||||||
|
|
||||||
ref var modelId = ref *(uint*)modelPtr;
|
ref var modelId = ref *(uint*)modelPtr;
|
||||||
ref var customize = ref *(CustomizeArray*)customizePtr;
|
ref var customize = ref *(CustomizeArray*)customizePtr;
|
||||||
if (_autoDesignApplier.Reduce(actor, _creatingIdentifier, out _creatingState))
|
if (_autoDesignApplier.Reduce(actor, _creatingIdentifier, out _creatingState))
|
||||||
{
|
{
|
||||||
|
_isPlayerNpc = _creatingIdentifier.Type is IdentifierType.Player
|
||||||
|
&& actor.IsCharacter
|
||||||
|
&& actor.AsCharacter->GetObjectKind() is ObjectKind.EventNpc;
|
||||||
switch (UpdateBaseData(actor, _creatingState, modelId, customizePtr, equipDataPtr))
|
switch (UpdateBaseData(actor, _creatingState, modelId, customizePtr, equipDataPtr))
|
||||||
{
|
{
|
||||||
// TODO handle right
|
// TODO handle right
|
||||||
|
|
@ -347,7 +351,7 @@ public class StateListener : IDisposable
|
||||||
&& weapon.Weapon.Id != 0
|
&& weapon.Weapon.Id != 0
|
||||||
&& _fistOffhands.TryGetValue(actor, out var lastFistOffhand))
|
&& _fistOffhands.TryGetValue(actor, out var lastFistOffhand))
|
||||||
{
|
{
|
||||||
Glamourer.Log.Information($"Applying stored fist weapon offhand {lastFistOffhand} for 0x{actor.Address:X}.");
|
Glamourer.Log.Verbose($"Applying stored fist weapon offhand {lastFistOffhand} for 0x{actor.Address:X}.");
|
||||||
weapon = lastFistOffhand;
|
weapon = lastFistOffhand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -440,15 +444,22 @@ public class StateListener : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseData = state.BaseData.Armor(slot);
|
var baseData = state.BaseData.Armor(slot);
|
||||||
var change = UpdateState.NoChange;
|
|
||||||
|
var change = UpdateState.NoChange;
|
||||||
if (baseData.Stains != armor.Stains)
|
if (baseData.Stains != armor.Stains)
|
||||||
{
|
{
|
||||||
|
if (_isPlayerNpc)
|
||||||
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
state.BaseData.SetStain(slot, armor.Stains);
|
state.BaseData.SetStain(slot, armor.Stains);
|
||||||
change = UpdateState.Change;
|
change = UpdateState.Change;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseData.Set.Id != armor.Set.Id || baseData.Variant != armor.Variant && !fistWeapon)
|
if (baseData.Set.Id != armor.Set.Id || baseData.Variant != armor.Variant && !fistWeapon)
|
||||||
{
|
{
|
||||||
|
if (_isPlayerNpc)
|
||||||
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
var item = _items.Identify(slot, armor.Set, armor.Variant);
|
var item = _items.Identify(slot, armor.Set, armor.Variant);
|
||||||
state.BaseData.SetItem(slot, item);
|
state.BaseData.SetItem(slot, item);
|
||||||
change = UpdateState.Change;
|
change = UpdateState.Change;
|
||||||
|
|
@ -480,6 +491,9 @@ public class StateListener : IDisposable
|
||||||
var change = UpdateState.NoChange;
|
var change = UpdateState.NoChange;
|
||||||
if (baseData.Id != actorItem.Id || baseData.PrimaryId != item.Set || baseData.Variant != item.Variant)
|
if (baseData.Id != actorItem.Id || baseData.PrimaryId != item.Set || baseData.Variant != item.Variant)
|
||||||
{
|
{
|
||||||
|
if (_isPlayerNpc)
|
||||||
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
var identified = _items.Identify(slot, item.Set, item.Variant);
|
var identified = _items.Identify(slot, item.Set, item.Variant);
|
||||||
state.BaseData.SetBonusItem(slot, identified);
|
state.BaseData.SetBonusItem(slot, identified);
|
||||||
change = UpdateState.Change;
|
change = UpdateState.Change;
|
||||||
|
|
@ -596,6 +610,9 @@ public class StateListener : IDisposable
|
||||||
|
|
||||||
if (baseData.Skeleton.Id != weapon.Skeleton.Id || baseData.Weapon.Id != weapon.Weapon.Id || baseData.Variant != weapon.Variant)
|
if (baseData.Skeleton.Id != weapon.Skeleton.Id || baseData.Weapon.Id != weapon.Weapon.Id || baseData.Variant != weapon.Variant)
|
||||||
{
|
{
|
||||||
|
if (_isPlayerNpc)
|
||||||
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
var item = _items.Identify(slot, weapon.Skeleton, weapon.Weapon, weapon.Variant,
|
var item = _items.Identify(slot, weapon.Skeleton, weapon.Weapon, weapon.Variant,
|
||||||
slot is EquipSlot.OffHand ? state.BaseData.MainhandType : FullEquipType.Unknown);
|
slot is EquipSlot.OffHand ? state.BaseData.MainhandType : FullEquipType.Unknown);
|
||||||
state.BaseData.SetItem(slot, item);
|
state.BaseData.SetItem(slot, item);
|
||||||
|
|
@ -643,6 +660,10 @@ public class StateListener : IDisposable
|
||||||
if (checkTransform && !actor.Customize->Equals(customize))
|
if (checkTransform && !actor.Customize->Equals(customize))
|
||||||
return UpdateState.Transformed;
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
|
// Check for player NPCs with a different game state.
|
||||||
|
if (_isPlayerNpc && !actor.Customize->Equals(state.BaseData.Customize))
|
||||||
|
return UpdateState.Transformed;
|
||||||
|
|
||||||
// Customize array did not change to stored state.
|
// Customize array did not change to stored state.
|
||||||
if (state.BaseData.Customize.Equals(customize))
|
if (state.BaseData.Customize.Equals(customize))
|
||||||
return UpdateState.NoChange; // TODO: handle wrong base data.
|
return UpdateState.NoChange; // TODO: handle wrong base data.
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 63ffca0ff0ad626605120e58809c888d92053d64
|
Subproject commit 5bac66e5ad73e57919aff7f8b046606b75e191a2
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
],
|
],
|
||||||
"InternalName": "Glamourer",
|
"InternalName": "Glamourer",
|
||||||
"AssemblyVersion": "1.3.5.1",
|
"AssemblyVersion": "1.3.5.1",
|
||||||
"TestingAssemblyVersion": "1.3.5.2",
|
"TestingAssemblyVersion": "1.3.5.3",
|
||||||
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"DalamudApiLevel": 11,
|
"DalamudApiLevel": 11,
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
"LastUpdate": 1618608322,
|
"LastUpdate": 1618608322,
|
||||||
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/releases/download/1.3.5.1/Glamourer.zip",
|
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/releases/download/1.3.5.1/Glamourer.zip",
|
||||||
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/releases/download/1.3.5.1/Glamourer.zip",
|
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/releases/download/1.3.5.1/Glamourer.zip",
|
||||||
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/releases/download/testing_1.3.5.2/Glamourer.zip",
|
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/releases/download/testing_1.3.5.3/Glamourer.zip",
|
||||||
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/main/images/icon.png"
|
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/main/images/icon.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue