From d243bafc6f796f1e50ea26a0ff42d6e6c32e992a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 23 Jun 2025 19:02:19 -0500 Subject: [PATCH] GUI: don't warn while loop start/end focused very ugly workaround to #2587 --- src/gui/gui.cpp | 2 ++ src/gui/gui.h | 1 + src/gui/sampleEdit.cpp | 14 ++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 22223a350..fa0f7d543 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -8867,6 +8867,8 @@ FurnaceGUI::FurnaceGUI(): sampleDragMode(false), sampleDrag16(false), sampleZoomAuto(true), + sampleCheckLoopStart(true), + sampleCheckLoopEnd(true), sampleSelTarget(0), sampleDragTarget(NULL), sampleDragStart(0,0), diff --git a/src/gui/gui.h b/src/gui/gui.h index a7547f47e..81e4a8383 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2583,6 +2583,7 @@ class FurnaceGUI { int sampleSelStart, sampleSelEnd; bool sampleInfo, sampleCompatRate; bool sampleDragActive, sampleDragMode, sampleDrag16, sampleZoomAuto; + bool sampleCheckLoopStart, sampleCheckLoopEnd; // 0: start // 1: end unsigned char sampleSelTarget; diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 39a84a242..85634fc89 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -733,7 +733,7 @@ void FurnaceGUI::drawSampleEdit() { } popWarningColor(); - pushWarningColor(!warnLoopPos.empty() || !warnLoopStart.empty()); + pushWarningColor(!warnLoopPos.empty() || (!warnLoopStart.empty() && sampleCheckLoopStart)); ImGui::AlignTextToFramePadding(); ImGui::Text(_("Start")); ImGui::SameLine(); @@ -752,8 +752,11 @@ void FurnaceGUI::drawSampleEdit() { } if (ImGui::IsItemActive()) { keepLoopAlive=true; + sampleCheckLoopStart=false; + } else { + sampleCheckLoopStart=true; } - if (ImGui::IsItemHovered() && (!warnLoopPos.empty() || !warnLoopStart.empty() || sample->depth==DIV_SAMPLE_DEPTH_BRR)) { + if (ImGui::IsItemHovered() && (!warnLoopPos.empty() || (!warnLoopStart.empty() && sampleCheckLoopStart) || sample->depth==DIV_SAMPLE_DEPTH_BRR)) { if (ImGui::BeginTooltip()) { if (sample->depth==DIV_SAMPLE_DEPTH_BRR) { ImGui::Text(_("changing the loop in a BRR sample may result in glitches!")); @@ -769,7 +772,7 @@ void FurnaceGUI::drawSampleEdit() { } popWarningColor(); - pushWarningColor(!warnLoopPos.empty() || !warnLoopEnd.empty()); + pushWarningColor(!warnLoopPos.empty() || (!warnLoopEnd.empty() && sampleCheckLoopEnd)); ImGui::AlignTextToFramePadding(); ImGui::Text(_("End")); ImGui::SameLine(); @@ -788,8 +791,11 @@ void FurnaceGUI::drawSampleEdit() { } if (ImGui::IsItemActive()) { keepLoopAlive=true; + sampleCheckLoopEnd=false; + } else { + sampleCheckLoopEnd=true; } - if (ImGui::IsItemHovered() && (!warnLoopPos.empty() || !warnLoopEnd.empty() || sample->depth==DIV_SAMPLE_DEPTH_BRR)) { + if (ImGui::IsItemHovered() && (!warnLoopPos.empty() || (!warnLoopEnd.empty() && sampleCheckLoopEnd) || sample->depth==DIV_SAMPLE_DEPTH_BRR)) { if (ImGui::BeginTooltip()) { if (sample->depth==DIV_SAMPLE_DEPTH_BRR) { ImGui::Text(_("changing the loop in a BRR sample may result in glitches!"));