diff --git a/include/ui/quest_log_screen.hpp b/include/ui/quest_log_screen.hpp index d86abedc..eef78289 100644 --- a/include/ui/quest_log_screen.hpp +++ b/include/ui/quest_log_screen.hpp @@ -7,9 +7,11 @@ namespace wowee { namespace ui { +class InventoryScreen; + class QuestLogScreen { public: - void render(game::GameHandler& gameHandler); + void render(game::GameHandler& gameHandler, InventoryScreen& invScreen); bool isOpen() const { return open; } void toggle() { open = !open; } void setOpen(bool o) { open = o; } diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 4c454a9a..9f8b8fa8 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -460,7 +460,7 @@ void GameScreen::render(game::GameHandler& gameHandler) { renderWorldMap(gameHandler); // Quest Log (L key toggle handled inside) - questLogScreen.render(gameHandler); + questLogScreen.render(gameHandler, inventoryScreen); // Spellbook (P key toggle handled inside) spellbookScreen.render(gameHandler, core::Application::getInstance().getAssetManager()); diff --git a/src/ui/quest_log_screen.cpp b/src/ui/quest_log_screen.cpp index a5dc4945..ef54d6fc 100644 --- a/src/ui/quest_log_screen.cpp +++ b/src/ui/quest_log_screen.cpp @@ -1,4 +1,5 @@ #include "ui/quest_log_screen.hpp" +#include "ui/inventory_screen.hpp" #include "ui/keybinding_manager.hpp" #include "core/application.hpp" #include "core/input.hpp" @@ -206,7 +207,7 @@ std::string cleanQuestTitleForUi(const std::string& raw, uint32_t questId) { } } // anonymous namespace -void QuestLogScreen::render(game::GameHandler& gameHandler) { +void QuestLogScreen::render(game::GameHandler& gameHandler, InventoryScreen& invScreen) { // Quests toggle via keybinding (edge-triggered) // Customizable key (default: L) from KeybindingManager bool questsDown = KeybindingManager::getInstance().isActionPressed( @@ -392,13 +393,24 @@ void QuestLogScreen::render(game::GameHandler& gameHandler) { } for (const auto& [itemId, count] : sel.itemCounts) { std::string itemLabel = "Item " + std::to_string(itemId); + uint32_t dispId = 0; if (const auto* info = gameHandler.getItemInfo(itemId)) { if (!info->name.empty()) itemLabel = info->name; + dispId = info->displayInfoId; + } else { + gameHandler.ensureItemInfo(itemId); } 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); + VkDescriptorSet iconTex = dispId ? invScreen.getItemIcon(dispId) : VK_NULL_HANDLE; + if (iconTex) { + ImGui::Image((ImTextureID)(uintptr_t)iconTex, ImVec2(14, 14)); + ImGui::SameLine(); + ImGui::Text("%s: %u/%u", itemLabel.c_str(), count, required); + } else { + ImGui::BulletText("%s: %u/%u", itemLabel.c_str(), count, required); + } } }