feat(equipmentset): follow 4.3.4's equipment manager

UseEquipmentSet now behaves like 4.3.4's CGEquipmentManager:
- in combat only the weapon slots swap (one COMBAT_SWAP message);
- missing items and full bags report through UI_ERROR_MESSAGE;
- bank items are used only while the bank is open, and then equip
  straight from the bank;
- a swap in flight or an item on the cursor refuses the call.

EQUIPMENT_SWAP_FINISHED now fires when the swap settles instead of
during the call: success when the paperdoll matches, failure on an
SMSG_INVENTORY_CHANGE_FAILURE for one of the moved items, or when the
paperdoll stops changing short of the target. Its failure value is nil,
not 0. CanUseEquipmentSets and the set buttons are blocked meanwhile.

GetEquipmentSetInfo uses 4.3.4's GetSetStatus counts and strict
IsSetEquipped; GetItemIDs and GetItemLocations return all 19 slots with
the 0/1/-1 markers; set buttons also grey when a replaced item is
locked. Set names go through a port of ScrubString. Item tooltips get
the "Equipment Sets:" line (dontShowEquipmentSetsOnItems hides it).
This commit is contained in:
Brues
2026-10-18 00:24:00 -05:00
parent 2b9d0e7127
commit af4a379311
19 changed files with 891 additions and 431 deletions
+4 -1
View File
@@ -42,6 +42,7 @@
#include "Game.h"
#include "Offsets.h"
#include "equipmentset/Tooltip.h"
#include "unit/Tooltip.h"
#include <cstdint>
@@ -170,7 +171,8 @@ int __fastcall Resolver_h(void *self, void *edx, const char *name) {
// Builders whose callers use the return value (spell, unit) are declared to
// return it so the co-hook forwards it.
// Item — FUN_GAMETOOLTIP_BUILD_ITEM, 9 stack args, return unused.
// Item — FUN_GAMETOOLTIP_BUILD_ITEM, 9 stack args, return unused. `guid2`
// (stack +0x10) is the item instance GUID the builder stores at +0x380.
using BuildItem_t = void(__fastcall *)(void *self, void *edx, uint32_t itemID,
const void *guid, const void *guid2, int a4,
int a5, int a6, int headerFlag, int a8, int a9);
@@ -180,6 +182,7 @@ void __fastcall BuildItem_h(void *self, void *edx, uint32_t itemID, const void *
const void *guid2, int a4, int a5, int a6, int headerFlag,
int a8, int a9) {
g_buildItemOriginal(self, edx, itemID, guid, guid2, a4, a5, a6, headerFlag, a8, a9);
EquipmentSet::Tooltip::AfterItemBuild(self, guid2);
FireScript(self, SK_ITEM);
}