Add separate draggable bag windows, fix dismount and player equipment

Bags are now individual draggable ImGui windows (backpack + each equipped
bag) with per-bag toggle from the bag bar. B key opens/closes all. A
settings toggle under Gameplay lets users switch back to the original
aggregate single-window mode. Window width adapts to bag item name length.

Fix dismount by clearing local mount state immediately (optimistic) instead
of waiting for server confirmation, and allow buff bar right-click dismount
regardless of the aura's buff flag.

Fix other players appearing naked by queuing them for auto-inspect when
the visible item field layout hasn't been detected yet.
This commit is contained in:
Kelsi 2026-02-13 22:51:49 -08:00
parent 89ccb0720a
commit 85864ab05b
5 changed files with 264 additions and 62 deletions

View file

@ -82,6 +82,7 @@ private:
int pendingUiOpacity = 65;
bool pendingMinimapRotate = false;
bool pendingMinimapSquare = false;
bool pendingSeparateBags = true;
// UI element transparency (0.0 = fully transparent, 1.0 = fully opaque)
float uiOpacity_ = 0.65f;

View file

@ -5,6 +5,7 @@
#include "game/world_packets.hpp"
#include <GL/glew.h>
#include <imgui.h>
#include <array>
#include <functional>
#include <memory>
#include <unordered_map>
@ -29,6 +30,14 @@ public:
void toggle() { open = !open; }
void setOpen(bool o) { open = o; }
// Separate bag window controls
void toggleBackpack();
void toggleBag(int idx);
void openAllBags();
void closeAllBags();
void setSeparateBags(bool sep) { separateBags_ = sep; }
bool isSeparateBags() const { return separateBags_; }
bool isCharacterOpen() const { return characterOpen; }
void toggleCharacter() { characterOpen = !characterOpen; }
void setCharacterOpen(bool o) { characterOpen = o; }
@ -64,6 +73,9 @@ private:
bool open = false;
bool characterOpen = false;
bool bKeyWasDown = false;
bool separateBags_ = true;
bool backpackOpen_ = false;
std::array<bool, 4> bagOpen_{};
bool cKeyWasDown = false;
bool equipmentDirty = false;
bool inventoryDirty = false;
@ -106,6 +118,10 @@ private:
int heldBackpackIndex = -1;
game::EquipSlot heldEquipSlot = game::EquipSlot::NUM_SLOTS;
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,
int bagIndex, float defaultX, float defaultY, uint64_t moneyCopper);
void renderEquipmentPanel(game::Inventory& inventory);
void renderBackpackPanel(game::Inventory& inventory);
void renderStatsPanel(game::Inventory& inventory, uint32_t playerLevel);