1
0
mirror of synced 2025-01-18 17:14:13 +01:00

impr: Make task progress not display -100% when in no progress state

This commit is contained in:
WerWolv 2024-01-27 11:02:14 +01:00
parent 6a1a991c08
commit 44510b5b64

View File

@ -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) {