mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
Fix quest reward items showing as 'Item {number}' on first frame
Quest reward items (both in details and offer-reward windows) were showing as "Item {itemId}"
placeholders because the window opened immediately after receiving SMSG_QUESTGIVER_QUEST_DETAILS,
before the item query responses from pre-fetched queries had time to arrive.
Solution: Delay opening the quest details window by 100ms to allow item queries to complete
and be cached before the window first renders. Uses std::chrono::steady_clock for timing.
- Add questDetailsOpenTime field to track delayed opening timestamp
- Modify isQuestDetailsOpen() to check timer and open window when time expires
- Reset timer whenever quest details window closes
- Updated comment to clarify pre-fetch benefits both details and offer-reward windows
This commit is contained in:
parent
b5a48729b8
commit
eef269ffb8
2 changed files with 23 additions and 3 deletions
|
|
@ -1068,7 +1068,18 @@ public:
|
|||
void closeGossip();
|
||||
bool isGossipWindowOpen() const { return gossipWindowOpen; }
|
||||
const GossipMessageData& getCurrentGossip() const { return currentGossip; }
|
||||
bool isQuestDetailsOpen() const { return questDetailsOpen; }
|
||||
bool isQuestDetailsOpen() {
|
||||
// Check if delayed opening timer has expired
|
||||
if (questDetailsOpen) return true;
|
||||
if (questDetailsOpenTime != std::chrono::steady_clock::time_point{}) {
|
||||
if (std::chrono::steady_clock::now() >= questDetailsOpenTime) {
|
||||
questDetailsOpen = true;
|
||||
questDetailsOpenTime = std::chrono::steady_clock::time_point{};
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const QuestDetailsData& getQuestDetails() const { return currentQuestDetails; }
|
||||
|
||||
// Gossip / quest map POI markers (SMSG_GOSSIP_POI)
|
||||
|
|
@ -2184,6 +2195,7 @@ private:
|
|||
|
||||
// Quest details
|
||||
bool questDetailsOpen = false;
|
||||
std::chrono::steady_clock::time_point questDetailsOpenTime{}; // Delayed opening to allow item data to load
|
||||
QuestDetailsData currentQuestDetails;
|
||||
|
||||
// Quest turn-in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue