From 2fbf3f28e66d3ea526b8cccbe7bcb5d5b946158a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 08:21:52 -0700 Subject: [PATCH] feat: use colored coin display for quest reward money in quest log --- src/ui/quest_log_screen.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ui/quest_log_screen.cpp b/src/ui/quest_log_screen.cpp index 81f8657d..d89f6ab4 100644 --- a/src/ui/quest_log_screen.cpp +++ b/src/ui/quest_log_screen.cpp @@ -205,6 +205,21 @@ std::string cleanQuestTitleForUi(const std::string& raw, uint32_t questId) { if (s.size() > 72) s = s.substr(0, 72) + "..."; return s; } + +void renderCoinsText(uint32_t g, uint32_t s, uint32_t c) { + bool any = false; + if (g > 0) { + ImGui::TextColored(ImVec4(1.00f, 0.82f, 0.00f, 1.0f), "%ug", g); + any = true; + } + if (s > 0 || g > 0) { + if (any) ImGui::SameLine(0, 3); + ImGui::TextColored(ImVec4(0.80f, 0.80f, 0.80f, 1.0f), "%us", s); + any = true; + } + if (any) ImGui::SameLine(0, 3); + ImGui::TextColored(ImVec4(0.72f, 0.45f, 0.20f, 1.0f), "%uc", c); +} } // anonymous namespace void QuestLogScreen::render(game::GameHandler& gameHandler, InventoryScreen& invScreen) { @@ -488,12 +503,7 @@ void QuestLogScreen::render(game::GameHandler& gameHandler, InventoryScreen& inv uint32_t rg = static_cast(sel.rewardMoney) / 10000; uint32_t rs = static_cast(sel.rewardMoney % 10000) / 100; uint32_t rc = static_cast(sel.rewardMoney % 100); - if (rg > 0) - ImGui::Text("%ug %us %uc", rg, rs, rc); - else if (rs > 0) - ImGui::Text("%us %uc", rs, rc); - else - ImGui::Text("%uc", rc); + renderCoinsText(rg, rs, rc); } // Guaranteed reward items