mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Trigger player model visual update when online inventory changes
rebuildOnlineInventory() now sets a dirty flag that GameScreen checks each frame to call updateCharacterGeosets/Textures and loadEquippedWeapons.
This commit is contained in:
parent
a3055267f6
commit
e327344a9b
3 changed files with 5 additions and 1 deletions
|
|
@ -190,6 +190,7 @@ public:
|
||||||
// Inventory
|
// Inventory
|
||||||
Inventory& getInventory() { return inventory; }
|
Inventory& getInventory() { return inventory; }
|
||||||
const Inventory& getInventory() const { return inventory; }
|
const Inventory& getInventory() const { return inventory; }
|
||||||
|
bool consumeOnlineEquipmentDirty() { bool d = onlineEquipDirty_; onlineEquipDirty_ = false; return d; }
|
||||||
|
|
||||||
// Targeting
|
// Targeting
|
||||||
void setTarget(uint64_t guid);
|
void setTarget(uint64_t guid);
|
||||||
|
|
@ -548,6 +549,7 @@ private:
|
||||||
std::unordered_set<uint32_t> pendingItemQueries_;
|
std::unordered_set<uint32_t> pendingItemQueries_;
|
||||||
std::array<uint64_t, 23> equipSlotGuids_{};
|
std::array<uint64_t, 23> equipSlotGuids_{};
|
||||||
std::array<uint64_t, 16> backpackSlotGuids_{};
|
std::array<uint64_t, 16> backpackSlotGuids_{};
|
||||||
|
bool onlineEquipDirty_ = false;
|
||||||
|
|
||||||
// ---- Phase 2: Combat ----
|
// ---- Phase 2: Combat ----
|
||||||
bool autoAttacking = false;
|
bool autoAttacking = false;
|
||||||
|
|
|
||||||
|
|
@ -2936,6 +2936,8 @@ void GameHandler::rebuildOnlineInventory() {
|
||||||
inventory.setBackpackSlot(i, def);
|
inventory.setBackpackSlot(i, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onlineEquipDirty_ = true;
|
||||||
|
|
||||||
LOG_DEBUG("Rebuilt online inventory: equip=", [&](){
|
LOG_DEBUG("Rebuilt online inventory: equip=", [&](){
|
||||||
int c = 0; for (auto g : equipSlotGuids_) if (g) c++; return c;
|
int c = 0; for (auto g : equipSlotGuids_) if (g) c++; return c;
|
||||||
}(), " backpack=", [&](){
|
}(), " backpack=", [&](){
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
||||||
gameHandler.notifyInventoryChanged();
|
gameHandler.notifyInventoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inventoryScreen.consumeEquipmentDirty()) {
|
if (inventoryScreen.consumeEquipmentDirty() || gameHandler.consumeOnlineEquipmentDirty()) {
|
||||||
updateCharacterGeosets(gameHandler.getInventory());
|
updateCharacterGeosets(gameHandler.getInventory());
|
||||||
updateCharacterTextures(gameHandler.getInventory());
|
updateCharacterTextures(gameHandler.getInventory());
|
||||||
core::Application::getInstance().loadEquippedWeapons();
|
core::Application::getInstance().loadEquippedWeapons();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue