mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Fix item use (CMSG_USE_ITEM), mount tab, and inventory right-click
- Fix SMSG_ITEM_QUERY_SINGLE_RESPONSE parsing: read statsCount stat pairs instead of always 10, use 2 damage entries (MAX_ITEM_PROTO_DAMAGES), and parse item spell data (spellId + spellTrigger per slot) - Pass item spell ID in CMSG_USE_ITEM packet so server processes item use requests (spellId=0 caused silent server rejection) - Add spellId parameter to buildUseItem interface across all expansions - Fix spellbook mount tab to use SkillLine 777 (Mounts) instead of 762 (Riding), so known mount summon spells appear correctly - Fix inventory right-click: use IsItemHovered+IsMouseClicked instead of IsItemClicked for InvisibleButton (which only tracks left-clicks) - Fix SlotKind enum declaration order in inventory_screen.hpp
This commit is contained in:
parent
7982815a67
commit
c919477e74
9 changed files with 233 additions and 152 deletions
|
|
@ -125,6 +125,19 @@ private:
|
|||
int heldBagSlotIndex = -1;
|
||||
game::EquipSlot heldEquipSlot = game::EquipSlot::NUM_SLOTS;
|
||||
|
||||
// Slot rendering with interaction support
|
||||
enum class SlotKind { BACKPACK, EQUIPMENT };
|
||||
|
||||
// Click-and-hold pickup tracking
|
||||
bool pickupPending_ = false;
|
||||
float pickupPressTime_ = 0.0f;
|
||||
SlotKind pickupSlotKind_ = SlotKind::BACKPACK;
|
||||
int pickupBackpackIndex_ = -1;
|
||||
int pickupBagIndex_ = -1;
|
||||
int pickupBagSlotIndex_ = -1;
|
||||
game::EquipSlot pickupEquipSlot_ = game::EquipSlot::NUM_SLOTS;
|
||||
static constexpr float kPickupHoldThreshold = 0.12f; // seconds
|
||||
|
||||
void renderSeparateBags(game::Inventory& inventory, uint64_t moneyCopper);
|
||||
void renderAggregateBags(game::Inventory& inventory, uint64_t moneyCopper);
|
||||
void renderBagWindow(const char* title, bool& isOpen, game::Inventory& inventory,
|
||||
|
|
@ -133,8 +146,6 @@ private:
|
|||
void renderBackpackPanel(game::Inventory& inventory, bool collapseEmptySections = false);
|
||||
void renderStatsPanel(game::Inventory& inventory, uint32_t playerLevel, int32_t serverArmor = 0);
|
||||
|
||||
// Slot rendering with interaction support
|
||||
enum class SlotKind { BACKPACK, EQUIPMENT };
|
||||
void renderItemSlot(game::Inventory& inventory, const game::ItemSlot& slot,
|
||||
float size, const char* label,
|
||||
SlotKind kind, int backpackIndex,
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ private:
|
|||
bool skillLineDbLoaded = false;
|
||||
std::unordered_map<uint32_t, std::string> skillLineNames;
|
||||
std::unordered_map<uint32_t, uint32_t> skillLineCategories;
|
||||
std::unordered_map<uint32_t, uint32_t> spellToSkillLine;
|
||||
std::unordered_multimap<uint32_t, uint32_t> spellToSkillLine;
|
||||
|
||||
// Categorized spell tabs
|
||||
std::vector<SpellTabInfo> spellTabs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue