diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 035d7faa..63a6fbff 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5397,6 +5397,7 @@ FurnaceGUI::FurnaceGUI(): editOptsVisible(false), latchNibble(false), nonLatchNibble(false), + keepLoopAlive(false), curWindow(GUI_WINDOW_NOTHING), nextWindow(GUI_WINDOW_NOTHING), curWindowLast(GUI_WINDOW_NOTHING), diff --git a/src/gui/gui.h b/src/gui/gui.h index 0c0eb564..3337d7dd 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1366,6 +1366,7 @@ class FurnaceGUI { SelectionPoint selStart, selEnd, cursor, cursorDrag, dragStart, dragEnd; bool selecting, selectingFull, dragging, curNibble, orderNibble, followOrders, followPattern, changeAllOrders, mobileUI; bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame, tempoView, waveHex, waveSigned, waveGenVisible, lockLayout, editOptsVisible, latchNibble, nonLatchNibble; + bool keepLoopAlive; FurnaceGUIWindows curWindow, nextWindow, curWindowLast; float peak[2]; float patChanX[DIV_MAX_CHANS+1]; diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index d5543d42..a00c895a 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -121,7 +121,8 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } - if (doLoop) { + if (doLoop || keepLoopAlive) { + keepLoopAlive=false; ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::Text("Loop Mode"); @@ -153,6 +154,9 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } + if (ImGui::IsItemActive()) { + keepLoopAlive=true; + } ImGui::TableNextColumn(); ImGui::Text("Loop End"); ImGui::SameLine(); @@ -166,6 +170,9 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } + if (ImGui::IsItemActive()) { + keepLoopAlive=true; + } } ImGui::EndTable(); } @@ -678,7 +685,8 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } - if (doLoop) { + if (doLoop || keepLoopAlive) { + keepLoopAlive=false; ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::Text("Loop Mode"); @@ -711,6 +719,9 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } + if (ImGui::IsItemActive()) { + keepLoopAlive=true; + } ImGui::TableNextColumn(); ImGui::Text("Loop End"); ImGui::SameLine(); @@ -724,6 +735,9 @@ void FurnaceGUI::drawSampleEdit() { } updateSampleTex=true; } + if (ImGui::IsItemActive()) { + keepLoopAlive=true; + } } ImGui::EndTable(); }