mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: color-code quest tracker objectives green when complete
Completed kill/item objectives now display in green instead of gray, giving an immediate visual cue about which objectives are done vs. still in progress on the on-screen quest tracker.
This commit is contained in:
parent
271518ee08
commit
fb6e7c7b57
1 changed files with 13 additions and 8 deletions
|
|
@ -5831,28 +5831,33 @@ void GameScreen::renderQuestObjectiveTracker(game::GameHandler& gameHandler) {
|
||||||
if (q.complete) {
|
if (q.complete) {
|
||||||
ImGui::TextColored(ImVec4(0.5f, 1.0f, 0.5f, 1.0f), " (Complete)");
|
ImGui::TextColored(ImVec4(0.5f, 1.0f, 0.5f, 1.0f), " (Complete)");
|
||||||
} else {
|
} else {
|
||||||
// Kill counts
|
// Kill counts — green when complete, gray when in progress
|
||||||
for (const auto& [entry, progress] : q.killCounts) {
|
for (const auto& [entry, progress] : q.killCounts) {
|
||||||
|
bool objDone = (progress.first >= progress.second && progress.second > 0);
|
||||||
|
ImVec4 objColor = objDone ? ImVec4(0.4f, 1.0f, 0.4f, 1.0f)
|
||||||
|
: ImVec4(0.75f, 0.75f, 0.75f, 1.0f);
|
||||||
std::string name = gameHandler.getCachedCreatureName(entry);
|
std::string name = gameHandler.getCachedCreatureName(entry);
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
// May be a game object objective; fall back to GO name cache.
|
|
||||||
const auto* goInfo = gameHandler.getCachedGameObjectInfo(entry);
|
const auto* goInfo = gameHandler.getCachedGameObjectInfo(entry);
|
||||||
if (goInfo && !goInfo->name.empty()) name = goInfo->name;
|
if (goInfo && !goInfo->name.empty()) name = goInfo->name;
|
||||||
}
|
}
|
||||||
if (!name.empty()) {
|
if (!name.empty()) {
|
||||||
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f),
|
ImGui::TextColored(objColor,
|
||||||
" %s: %u/%u", name.c_str(),
|
" %s: %u/%u", name.c_str(),
|
||||||
progress.first, progress.second);
|
progress.first, progress.second);
|
||||||
} else {
|
} else {
|
||||||
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f),
|
ImGui::TextColored(objColor,
|
||||||
" %u/%u", progress.first, progress.second);
|
" %u/%u", progress.first, progress.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Item counts
|
// Item counts — green when complete, gray when in progress
|
||||||
for (const auto& [itemId, count] : q.itemCounts) {
|
for (const auto& [itemId, count] : q.itemCounts) {
|
||||||
uint32_t required = 1;
|
uint32_t required = 1;
|
||||||
auto reqIt = q.requiredItemCounts.find(itemId);
|
auto reqIt = q.requiredItemCounts.find(itemId);
|
||||||
if (reqIt != q.requiredItemCounts.end()) required = reqIt->second;
|
if (reqIt != q.requiredItemCounts.end()) required = reqIt->second;
|
||||||
|
bool objDone = (count >= required);
|
||||||
|
ImVec4 objColor = objDone ? ImVec4(0.4f, 1.0f, 0.4f, 1.0f)
|
||||||
|
: ImVec4(0.75f, 0.75f, 0.75f, 1.0f);
|
||||||
const auto* info = gameHandler.getItemInfo(itemId);
|
const auto* info = gameHandler.getItemInfo(itemId);
|
||||||
const char* itemName = (info && !info->name.empty()) ? info->name.c_str() : nullptr;
|
const char* itemName = (info && !info->name.empty()) ? info->name.c_str() : nullptr;
|
||||||
|
|
||||||
|
|
@ -5862,13 +5867,13 @@ void GameScreen::renderQuestObjectiveTracker(game::GameHandler& gameHandler) {
|
||||||
if (iconTex) {
|
if (iconTex) {
|
||||||
ImGui::Image((ImTextureID)(uintptr_t)iconTex, ImVec2(12, 12));
|
ImGui::Image((ImTextureID)(uintptr_t)iconTex, ImVec2(12, 12));
|
||||||
ImGui::SameLine(0, 3);
|
ImGui::SameLine(0, 3);
|
||||||
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f),
|
ImGui::TextColored(objColor,
|
||||||
"%s: %u/%u", itemName ? itemName : "Item", count, required);
|
"%s: %u/%u", itemName ? itemName : "Item", count, required);
|
||||||
} else if (itemName) {
|
} else if (itemName) {
|
||||||
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f),
|
ImGui::TextColored(objColor,
|
||||||
" %s: %u/%u", itemName, count, required);
|
" %s: %u/%u", itemName, count, required);
|
||||||
} else {
|
} else {
|
||||||
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f),
|
ImGui::TextColored(objColor,
|
||||||
" Item: %u/%u", count, required);
|
" Item: %u/%u", count, required);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue