From dab164f09eac087b5727f321d98e5f64fe499fa2 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 7 Apr 2022 02:02:52 -0500 Subject: [PATCH] GUI: add "effect deletion alters value" setting --- src/gui/editing.cpp | 4 ++++ src/gui/gui.h | 2 ++ src/gui/settings.cpp | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 58069528a..9efd436fa 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -211,6 +211,10 @@ void FurnaceGUI::doDelete() { if (selStart.y==selEnd.y) pat->data[j][2]=-1; } pat->data[j][iFine+1]=(iFine<1)?0:-1; + + if (selStart.y==selEnd.y && iFine>2 && iFine&1 && settings.effectDeletionAltersValue) { + pat->data[j][iFine+2]=-1; + } } } iFine=0; diff --git a/src/gui/gui.h b/src/gui/gui.h index 0bc136ca6..9d6f4480b 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -754,6 +754,7 @@ class FurnaceGUI { int titleBarInfo; int titleBarSys; int frameBorders; + int effectDeletionAltersValue; unsigned int maxUndoSteps; String mainFontPath; String patFontPath; @@ -813,6 +814,7 @@ class FurnaceGUI { titleBarInfo(1), titleBarSys(1), frameBorders(0), + effectDeletionAltersValue(1), maxUndoSteps(100), mainFontPath(""), patFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 5089cc432..7c06aaf79 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -240,6 +240,11 @@ void FurnaceGUI::drawSettings() { settings.stepOnDelete=stepOnDeleteB; } + bool effectDeletionAltersValueB=settings.effectDeletionAltersValue; + if (ImGui::Checkbox("Delete effect value when deleting effect",&effectDeletionAltersValueB)) { + settings.effectDeletionAltersValue=effectDeletionAltersValueB; + } + bool stepOnInsertB=settings.stepOnInsert; if (ImGui::Checkbox("Move cursor by edit step on insert (push)",&stepOnInsertB)) { settings.stepOnInsert=stepOnInsertB; @@ -1445,6 +1450,7 @@ void FurnaceGUI::syncSettings() { settings.titleBarInfo=e->getConfInt("titleBarInfo",1); settings.titleBarSys=e->getConfInt("titleBarSys",1); settings.frameBorders=e->getConfInt("frameBorders",0); + settings.effectDeletionAltersValue=e->getConfInt("effectDeletionAltersValue",1); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.patFontSize,2,96); @@ -1496,6 +1502,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.titleBarInfo,0,3); clampSetting(settings.titleBarSys,0,1); clampSetting(settings.frameBorders,0,1); + clampSetting(settings.effectDeletionAltersValue,0,1); // keybinds for (int i=0; isetConf("titleBarInfo",settings.titleBarInfo); e->setConf("titleBarSys",settings.titleBarSys); e->setConf("frameBorders",settings.frameBorders); + e->setConf("effectDeletionAltersValue",settings.effectDeletionAltersValue); // colors for (int i=0; i