From 44510b5b6492135858547e37e84f0312d13d917d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 27 Jan 2024 11:02:14 +0100 Subject: [PATCH] impr: Make task progress not display -100% when in no progress state --- plugins/builtin/source/content/ui_items.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/ui_items.cpp b/plugins/builtin/source/content/ui_items.cpp index 20d8536f5..d134505e9 100644 --- a/plugins/builtin/source/content/ui_items.cpp +++ b/plugins/builtin/source/content/ui_items.cpp @@ -183,7 +183,13 @@ namespace hex::plugin::builtin { ImGui::InvisibleButton("RestTasks", ImVec2(widgetEnd.x - widgetStart.x, ImGui::GetCurrentWindowRead()->MenuBarHeight())); ImGui::SetCursorPos(widgetEnd); - ImGuiExt::InfoTooltip(hex::format("[{:.1f}%] {}", progress * 100.0F, Lang(frontTask->getUnlocalizedName())).c_str()); + std::string progressString; + if (progress < 0) + progressString = ""; + else + progressString = hex::format("[ {}/{} ({:.1f}%) ] ", frontTask->getValue() / frontTask->getMaxValue(), progress * 100.0F); + + ImGuiExt::InfoTooltip(hex::format("{}{}", progressString, Lang(frontTask->getUnlocalizedName())).c_str()); if (ImGui::BeginPopupContextItem("RestTasks", ImGuiPopupFlags_MouseButtonLeft)) { for (const auto &task : tasks) {