From 060e8047ca4d0f2c0459ce58d6173af2f50de7ab Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 31 Dec 2023 12:59:15 +0100 Subject: [PATCH] Add Stain to IPC Set. --- Glamourer/Api/GlamourerIpc.Set.cs | 16 ++++++++-------- Glamourer/Api/GlamourerIpc.cs | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Glamourer/Api/GlamourerIpc.Set.cs b/Glamourer/Api/GlamourerIpc.Set.cs index f6fe92e..5a6405d 100644 --- a/Glamourer/Api/GlamourerIpc.Set.cs +++ b/Glamourer/Api/GlamourerIpc.Set.cs @@ -23,16 +23,16 @@ public partial class GlamourerIpc public const string LabelSetItemByActorName = "Glamourer.SetItemByActorName"; - private readonly FuncProvider _setItemProvider; - private readonly FuncProvider _setItemByActorNameProvider; + private readonly FuncProvider _setItemProvider; + private readonly FuncProvider _setItemByActorNameProvider; - public static FuncSubscriber SetItemSubscriber(DalamudPluginInterface pi) + public static FuncSubscriber SetItemSubscriber(DalamudPluginInterface pi) => new(pi, LabelSetItem); - public static FuncSubscriber SetItemByActorNameSubscriber(DalamudPluginInterface pi) + public static FuncSubscriber SetItemByActorNameSubscriber(DalamudPluginInterface pi) => new(pi, LabelSetItemByActorName); - private GlamourerErrorCode SetItem(Character? character, EquipSlot slot, CustomItemId itemId, uint key) + private GlamourerErrorCode SetItem(Character? character, EquipSlot slot, CustomItemId itemId, StainId stainId, uint key) { if (itemId.Id == 0) itemId = ItemManager.NothingId(slot); @@ -56,11 +56,11 @@ public partial class GlamourerIpc if (!state.ModelData.IsHuman) return GlamourerErrorCode.ActorNotHuman; - _stateManager.ChangeItem(state, slot, item, StateChanged.Source.Ipc, key); + _stateManager.ChangeEquip(state, slot, item, stainId, StateChanged.Source.Ipc, key); return GlamourerErrorCode.Success; } - private GlamourerErrorCode SetItemByActorName(string name, EquipSlot slot, CustomItemId itemId, uint key) + private GlamourerErrorCode SetItemByActorName(string name, EquipSlot slot, CustomItemId itemId, StainId stainId, uint key) { if (itemId.Id == 0) itemId = ItemManager.NothingId(slot); @@ -83,7 +83,7 @@ public partial class GlamourerIpc if (!state.ModelData.IsHuman) return GlamourerErrorCode.ActorNotHuman; - _stateManager.ChangeItem(state, slot, item, StateChanged.Source.Ipc, key); + _stateManager.ChangeEquip(state, slot, item, stainId, StateChanged.Source.Ipc, key); found = true; } diff --git a/Glamourer/Api/GlamourerIpc.cs b/Glamourer/Api/GlamourerIpc.cs index a19dd6f..43f39c6 100644 --- a/Glamourer/Api/GlamourerIpc.cs +++ b/Glamourer/Api/GlamourerIpc.cs @@ -80,10 +80,10 @@ public sealed partial class GlamourerIpc : IDisposable _stateChangedProvider = new EventProvider>(pi, LabelStateChanged); _gPoseChangedProvider = new EventProvider(pi, LabelGPoseChanged); - _setItemProvider = new FuncProvider(pi, LabelSetItem, - (idx, slot, item, key) => (int)SetItem(idx, (EquipSlot)slot, item, key)); - _setItemByActorNameProvider = new FuncProvider(pi, LabelSetItemByActorName, - (name, slot, item, key) => (int)SetItemByActorName(name, (EquipSlot)slot, item, key)); + _setItemProvider = new FuncProvider(pi, LabelSetItem, + (idx, slot, item, stain, key) => (int)SetItem(idx, (EquipSlot)slot, item, stain, key)); + _setItemByActorNameProvider = new FuncProvider(pi, LabelSetItemByActorName, + (name, slot, item, stain, key) => (int)SetItemByActorName(name, (EquipSlot)slot, item, stain, key)); _stateChangedEvent.Subscribe(OnStateChanged, StateChanged.Priority.GlamourerIpc); _gPose.Subscribe(OnGPoseChanged, GPoseService.Priority.GlamourerIpc);