Fix shutdown hangs, bank bag icons/drag-drop, loading screen progress, and login spawn

- Fix shutdown hang: skip vmaDestroyAllocator (walked thousands of allocations),
  replace unsafe pthread_timedjoin_np with plain join + early-exit checks in workers
- Bank window: full icon rendering, click-and-hold pickup (0.10s), drag-drop for
  all bank slots including bank bag equip slots, same-slot drop detection
- Loading screen: process one tile per frame for live progress updates
- Camera reset: trust server position in online mode to avoid spawning under WMOs
- Fix PLAYER_BYTES/PLAYER_BYTES_2 field indices, preserve purchasedBankBagSlots
  across inventory rebuilds, fix bank slot purchase result codes
This commit is contained in:
Kelsi 2026-02-26 13:38:29 -08:00
parent 804b947203
commit a559d5944b
14 changed files with 489 additions and 146 deletions

View file

@ -118,11 +118,14 @@ private:
// Drag-and-drop held item state
bool holdingItem = false;
game::ItemDef heldItem;
enum class HeldSource { NONE, BACKPACK, BAG, EQUIPMENT };
enum class HeldSource { NONE, BACKPACK, BAG, EQUIPMENT, BANK, BANK_BAG, BANK_BAG_EQUIP };
HeldSource heldSource = HeldSource::NONE;
int heldBackpackIndex = -1;
int heldBagIndex = -1;
int heldBagSlotIndex = -1;
int heldBankIndex = -1;
int heldBankBagIndex = -1;
int heldBankBagSlotIndex = -1;
game::EquipSlot heldEquipSlot = game::EquipSlot::NUM_SLOTS;
// Slot rendering with interaction support
@ -136,7 +139,7 @@ private:
int pickupBagIndex_ = -1;
int pickupBagSlotIndex_ = -1;
game::EquipSlot pickupEquipSlot_ = game::EquipSlot::NUM_SLOTS;
static constexpr float kPickupHoldThreshold = 0.12f; // seconds
static constexpr float kPickupHoldThreshold = 0.10f; // seconds
void renderSeparateBags(game::Inventory& inventory, uint64_t moneyCopper);
void renderAggregateBags(game::Inventory& inventory, uint64_t moneyCopper);
@ -186,6 +189,12 @@ public:
bool dropHeldItemToEquipSlot(game::Inventory& inv, game::EquipSlot slot);
/// Drop the currently held item into a bank slot via CMSG_SWAP_ITEM.
void dropIntoBankSlot(game::GameHandler& gh, uint8_t dstBag, uint8_t dstSlot);
/// Pick up an item from main bank slot (click-and-hold from bank window).
void pickupFromBank(game::Inventory& inv, int bankIndex);
/// Pick up an item from a bank bag slot (click-and-hold from bank window).
void pickupFromBankBag(game::Inventory& inv, int bagIndex, int slotIndex);
/// Pick up a bag from a bank bag equip slot (click-and-hold from bank window).
void pickupFromBankBagEquip(game::Inventory& inv, int bagIndex);
};
} // namespace ui