mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: add quest kill objective markers on minimap
Live NPCs that match active tracked quest kill objectives are now shown on the minimap as gold circles with an 'x' mark, making it easier to spot remaining quest targets at a glance without needing to open the map. Only shows targets for incomplete objectives in tracked quests.
This commit is contained in:
parent
92361c37df
commit
b8e7fee9e7
1 changed files with 40 additions and 0 deletions
|
|
@ -12878,6 +12878,46 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) {
|
|||
IM_COL32(0, 0, 0, 255), marker);
|
||||
}
|
||||
|
||||
// Quest kill objective markers — highlight live NPCs matching active quest kill objectives
|
||||
{
|
||||
// Collect NPC entry IDs needed for incomplete kill objectives in tracked quests
|
||||
std::unordered_set<uint32_t> killTargetEntries;
|
||||
const auto& trackedIds = gameHandler.getTrackedQuestIds();
|
||||
for (const auto& quest : gameHandler.getQuestLog()) {
|
||||
if (quest.complete) continue;
|
||||
if (!trackedIds.empty() && !trackedIds.count(quest.questId)) continue;
|
||||
for (const auto& obj : quest.killObjectives) {
|
||||
if (obj.npcOrGoId <= 0 || obj.required == 0) continue;
|
||||
uint32_t npcEntry = static_cast<uint32_t>(obj.npcOrGoId);
|
||||
auto it = quest.killCounts.find(npcEntry);
|
||||
uint32_t current = (it != quest.killCounts.end()) ? it->second.first : 0;
|
||||
if (current < obj.required) killTargetEntries.insert(npcEntry);
|
||||
}
|
||||
}
|
||||
|
||||
if (!killTargetEntries.empty()) {
|
||||
for (const auto& [guid, entity] : gameHandler.getEntityManager().getEntities()) {
|
||||
if (!entity || entity->getType() != game::ObjectType::UNIT) continue;
|
||||
auto unit = std::static_pointer_cast<game::Unit>(entity);
|
||||
if (!unit || unit->getHealth() == 0) continue;
|
||||
if (!killTargetEntries.count(unit->getEntry())) continue;
|
||||
|
||||
glm::vec3 unitRender = core::coords::canonicalToRender(
|
||||
glm::vec3(entity->getX(), entity->getY(), entity->getZ()));
|
||||
float sx = 0.0f, sy = 0.0f;
|
||||
if (!projectToMinimap(unitRender, sx, sy)) continue;
|
||||
|
||||
// Gold circle with a dark "x" mark — indicates a quest kill target
|
||||
drawList->AddCircleFilled(ImVec2(sx, sy), 5.0f, IM_COL32(255, 185, 0, 240));
|
||||
drawList->AddCircle(ImVec2(sx, sy), 5.5f, IM_COL32(0, 0, 0, 180), 12, 1.0f);
|
||||
drawList->AddLine(ImVec2(sx - 2.5f, sy - 2.5f), ImVec2(sx + 2.5f, sy + 2.5f),
|
||||
IM_COL32(20, 20, 20, 230), 1.2f);
|
||||
drawList->AddLine(ImVec2(sx + 2.5f, sy - 2.5f), ImVec2(sx - 2.5f, sy + 2.5f),
|
||||
IM_COL32(20, 20, 20, 230), 1.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gossip POI markers (quest / NPC navigation targets)
|
||||
for (const auto& poi : gameHandler.getGossipPois()) {
|
||||
// Convert WoW canonical coords to render coords for minimap projection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue