impr: Added event logging in debug mode

This commit is contained in:
WerWolv
2023-05-02 20:35:30 +02:00
parent 0c8b3e31e7
commit bec655a8c6
3 changed files with 31 additions and 10 deletions

View File

@@ -51,6 +51,8 @@ namespace hex::plugin::builtin {
#endif
ContentRegistry::Interface::addFooterItem([] {
static bool shouldResetProgress = false;
auto taskCount = TaskManager::getRunningTaskCount();
if (taskCount > 0) {
const auto &tasks = TaskManager::getRunningTasks();
@@ -103,8 +105,13 @@ namespace hex::plugin::builtin {
if (ImGui::ToolBarButton(ICON_VS_DEBUG_STOP, ImGui::GetStyleColorVec4(ImGuiCol_Text)))
frontTask->interrupt();
ImGui::PopStyleVar();
shouldResetProgress = true;
} else {
ImHexApi::System::setTaskBarProgress(ImHexApi::System::TaskProgressState::Reset, ImHexApi::System::TaskProgressType::Normal, 0);
if (shouldResetProgress) {
ImHexApi::System::setTaskBarProgress(ImHexApi::System::TaskProgressState::Reset, ImHexApi::System::TaskProgressType::Normal, 0);
shouldResetProgress = false;
}
}
});
}