fix: correct TBC quest objective parsing and show creature names in quest log

SMSG_QUEST_QUERY_RESPONSE uses 40 fixed uint32 fields + 4 strings for both
Classic/Turtle and TBC, but the isClassicLayout flag was only set for stride-3
expansions (Classic/Turtle). TBC (stride 4) was incorrectly using the WotLK
55-field path, causing objective parsing to fail.

- Extend isClassicLayout to cover stride <= 4 (includes TBC)
- Refactor extractQuestQueryObjectives to try both layouts with fallback,
  matching the robustness of pickBestQuestQueryTexts
- Pre-fetch creature/GO/item name queries when quest objectives are parsed
  so names are ready before the player opens the quest log
- Quest log detail view: show creature names instead of raw entry IDs for
  kill objectives, and show required count (x/y) for item objectives
This commit is contained in:
Kelsi 2026-03-11 00:05:05 -07:00
parent 73439a4457
commit e64b566d72
2 changed files with 52 additions and 16 deletions

View file

@ -379,14 +379,19 @@ void QuestLogScreen::render(game::GameHandler& gameHandler) {
ImGui::Separator();
ImGui::TextColored(ImVec4(0.8f, 0.9f, 1.0f, 1.0f), "Tracked Progress");
for (const auto& [entry, progress] : sel.killCounts) {
ImGui::BulletText("Kill %u: %u/%u", entry, progress.first, progress.second);
std::string name = gameHandler.getCachedCreatureName(entry);
if (name.empty()) name = "Unknown (" + std::to_string(entry) + ")";
ImGui::BulletText("%s: %u/%u", name.c_str(), progress.first, progress.second);
}
for (const auto& [itemId, count] : sel.itemCounts) {
std::string itemLabel = "Item " + std::to_string(itemId);
if (const auto* info = gameHandler.getItemInfo(itemId)) {
if (!info->name.empty()) itemLabel = info->name;
}
ImGui::BulletText("%s: %u", itemLabel.c_str(), count);
uint32_t required = 1;
auto reqIt = sel.requiredItemCounts.find(itemId);
if (reqIt != sel.requiredItemCounts.end()) required = reqIt->second;
ImGui::BulletText("%s: %u/%u", itemLabel.c_str(), count, required);
}
}