From 579a20bbd4da5461599207ca5a80b48432f08e1a Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Wed, 10 Jan 2024 02:37:11 +0530 Subject: [PATCH] Add `SendUIMessage::SendInventoryUpdateMessage` --- include/RE/A/ActorMagicCaster.h | 2 +- include/RE/I/InventoryUpdateData.h | 10 ++++++---- include/RE/M/MagicCaster.h | 2 +- include/RE/M/MagicSystem.h | 3 ++- include/RE/S/SendUIMessage.h | 17 +++++++++++++++++ 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 include/RE/S/SendUIMessage.h diff --git a/include/RE/A/ActorMagicCaster.h b/include/RE/A/ActorMagicCaster.h index 3318dad72..71868251c 100644 --- a/include/RE/A/ActorMagicCaster.h +++ b/include/RE/A/ActorMagicCaster.h @@ -47,7 +47,7 @@ namespace RE void FinishCastImpl() override; // 07 - { return; } void InterruptCastImpl(bool a_depleteEnergy) override; // 08 - { return; } void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem* a_spell) override; // 09 - { return; } - bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_alchStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost) override; // 0A + bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_effectStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost) override; // 0A TESObjectREFR* GetCasterStatsObject() const override; // 0B - { return actor; } Actor* GetCasterAsActor() const override; // 0C - { return actor; } NiNode* GetMagicNode() override; // 0E - { return magicNode; } diff --git a/include/RE/I/InventoryUpdateData.h b/include/RE/I/InventoryUpdateData.h index 0c1a8e769..dd96e9d7e 100644 --- a/include/RE/I/InventoryUpdateData.h +++ b/include/RE/I/InventoryUpdateData.h @@ -4,7 +4,9 @@ namespace RE { - class InventoryUpdateData : public IUIMessageData + class TESBoundObject; + + class InventoryUpdateData : public IUIMessageData { public: inline static constexpr auto RTTI = RTTI_InventoryUpdateData; @@ -12,9 +14,9 @@ namespace RE ~InventoryUpdateData() override = default; // 00 // members - RefHandle unk10; // 10 - std::uint32_t pad14; // 14 - TESForm* unk18; // 18 + RefHandle inventoryRef; // 10 + std::uint32_t pad14; // 14 + TESBoundObject* updateObj; // 18 }; static_assert(sizeof(InventoryUpdateData) == 0x20); } diff --git a/include/RE/M/MagicCaster.h b/include/RE/M/MagicCaster.h index 63df5cca6..3586862b3 100644 --- a/include/RE/M/MagicCaster.h +++ b/include/RE/M/MagicCaster.h @@ -52,7 +52,7 @@ namespace RE virtual void FinishCastImpl(); // 07 - { return; } virtual void InterruptCastImpl(bool a_depleteEnergy); // 08 - { return; } virtual void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem* a_spell); // 09 - { return; } - virtual bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_alchStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost); // 0A + virtual bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_effectStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost); // 0A virtual TESObjectREFR* GetCasterStatsObject() const; // 0B - { return 0; } virtual Actor* GetCasterAsActor() const; // 0C - { return 0; } virtual TESObjectREFR* GetCasterObjectReference(Actor** a_outCaster) const; // 0D diff --git a/include/RE/M/MagicSystem.h b/include/RE/M/MagicSystem.h index a5190684d..2dbb0f53a 100644 --- a/include/RE/M/MagicSystem.h +++ b/include/RE/M/MagicSystem.h @@ -16,7 +16,8 @@ namespace RE kItemCharge = 5, kCastWhileShouting = 6, kShoutWhileCasting = 7, - kShoutWhileRecovering = 8 + kShoutWhileRecovering = 8, + kCustomReasonNoStart = 100, }; enum class CastingSource diff --git a/include/RE/S/SendUIMessage.h b/include/RE/S/SendUIMessage.h new file mode 100644 index 000000000..12932922f --- /dev/null +++ b/include/RE/S/SendUIMessage.h @@ -0,0 +1,17 @@ +#pragma once + +namespace RE +{ + class TESBoundObject; + class TESObjectREFR; + + namespace SendUIMessage + { + void SendInventoryUpdateMessage(TESObjectREFR* a_inventoryRef, const TESBoundObject* a_updateObj) + { + using func_t = decltype(&SendUIMessage::SendInventoryUpdateMessage); + static REL::Relocation func{ RELOCATION_ID(51911, 52849) }; + return func(a_inventoryRef, a_updateObj); + } + } +}