mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Delay quest reward window opening to load item icons/names
Add 100ms delay before opening the quest offer reward dialog, giving item info queries time to complete. Prevents "Item X" placeholders where players can't see item names or icons needed to choose rewards. Reuses the existing questDetailsOpenTime mechanism with delayed flag check in isQuestOfferRewardOpen().
This commit is contained in:
parent
9b9d56543c
commit
510370dc7b
2 changed files with 14 additions and 3 deletions
|
|
@ -1099,7 +1099,16 @@ public:
|
|||
void completeQuest(); // Send CMSG_QUESTGIVER_COMPLETE_QUEST
|
||||
void closeQuestRequestItems();
|
||||
|
||||
bool isQuestOfferRewardOpen() const { return questOfferRewardOpen_; }
|
||||
bool isQuestOfferRewardOpen() {
|
||||
if (questOfferRewardOpen_) return true;
|
||||
if (questDetailsOpenTime != std::chrono::steady_clock::time_point{}) {
|
||||
if (std::chrono::steady_clock::now() >= questDetailsOpenTime) {
|
||||
questOfferRewardOpen_ = true;
|
||||
questDetailsOpenTime = std::chrono::steady_clock::time_point{};
|
||||
}
|
||||
}
|
||||
return questOfferRewardOpen_;
|
||||
}
|
||||
const QuestOfferRewardData& getQuestOfferReward() const { return currentQuestOfferReward_; }
|
||||
void chooseQuestReward(uint32_t rewardIndex); // Send CMSG_QUESTGIVER_CHOOSE_REWARD
|
||||
void closeQuestOfferReward();
|
||||
|
|
|
|||
|
|
@ -15770,17 +15770,19 @@ void GameHandler::handleQuestOfferReward(network::Packet& packet) {
|
|||
pendingTurnInRewardRequest_ = false;
|
||||
}
|
||||
currentQuestOfferReward_ = data;
|
||||
questOfferRewardOpen_ = true;
|
||||
questRequestItemsOpen_ = false;
|
||||
gossipWindowOpen = false;
|
||||
questDetailsOpen = false;
|
||||
questDetailsOpenTime = std::chrono::steady_clock::time_point{};
|
||||
|
||||
// Query item names for reward items
|
||||
for (const auto& item : data.choiceRewards)
|
||||
queryItemInfo(item.itemId, 0);
|
||||
for (const auto& item : data.fixedRewards)
|
||||
queryItemInfo(item.itemId, 0);
|
||||
|
||||
// Delay opening window by 100ms to allow item queries to complete (avoids "Item X" placeholders)
|
||||
questOfferRewardOpen_ = false;
|
||||
questDetailsOpenTime = std::chrono::steady_clock::now() + std::chrono::milliseconds(100);
|
||||
}
|
||||
|
||||
void GameHandler::completeQuest() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue