mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
feat: add item tooltips to quest objective item tracking
This commit is contained in:
parent
0ffcf001a5
commit
fe4fc714c3
1 changed files with 16 additions and 0 deletions
|
|
@ -485,12 +485,28 @@ void QuestLogScreen::render(game::GameHandler& gameHandler, InventoryScreen& inv
|
||||||
auto reqIt = sel.requiredItemCounts.find(itemId);
|
auto reqIt = sel.requiredItemCounts.find(itemId);
|
||||||
if (reqIt != sel.requiredItemCounts.end()) required = reqIt->second;
|
if (reqIt != sel.requiredItemCounts.end()) required = reqIt->second;
|
||||||
VkDescriptorSet iconTex = dispId ? invScreen.getItemIcon(dispId) : VK_NULL_HANDLE;
|
VkDescriptorSet iconTex = dispId ? invScreen.getItemIcon(dispId) : VK_NULL_HANDLE;
|
||||||
|
const auto* objInfo = gameHandler.getItemInfo(itemId);
|
||||||
if (iconTex) {
|
if (iconTex) {
|
||||||
ImGui::Image((ImTextureID)(uintptr_t)iconTex, ImVec2(14, 14));
|
ImGui::Image((ImTextureID)(uintptr_t)iconTex, ImVec2(14, 14));
|
||||||
|
if (objInfo && objInfo->valid && ImGui::IsItemHovered()) {
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
invScreen.renderItemTooltip(*objInfo);
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text("%s: %u/%u", itemLabel.c_str(), count, required);
|
ImGui::Text("%s: %u/%u", itemLabel.c_str(), count, required);
|
||||||
|
if (objInfo && objInfo->valid && ImGui::IsItemHovered()) {
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
invScreen.renderItemTooltip(*objInfo);
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ImGui::BulletText("%s: %u/%u", itemLabel.c_str(), count, required);
|
ImGui::BulletText("%s: %u/%u", itemLabel.c_str(), count, required);
|
||||||
|
if (objInfo && objInfo->valid && ImGui::IsItemHovered()) {
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
invScreen.renderItemTooltip(*objInfo);
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue