GUI: and now for backspace too

This commit is contained in:
tildearrow 2023-06-10 15:50:08 -05:00
parent 02f6a0f217
commit accec6d865
3 changed files with 24 additions and 6 deletions

View file

@ -245,14 +245,22 @@ void FurnaceGUI::doPullDelete() {
updateScroll(cursor.y); updateScroll(cursor.y);
} }
int iCoarse=selStart.xCoarse; SelectionPoint sStart=selStart;
int iFine=selStart.xFine; SelectionPoint sEnd=selEnd;
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y && settings.pullDeleteRow) {
sStart.xFine=0;
sEnd.xFine=2+e->curPat[sEnd.xCoarse].effectCols*2;
}
int iCoarse=sStart.xCoarse;
int iFine=sStart.xFine;
for (; iCoarse<=sEnd.xCoarse; iCoarse++) {
if (!e->curSubSong->chanShow[iCoarse]) continue; if (!e->curSubSong->chanShow[iCoarse]) continue;
DivPattern* pat=e->curPat[iCoarse].getPattern(e->curOrders->ord[iCoarse][curOrder],true); DivPattern* pat=e->curPat[iCoarse].getPattern(e->curOrders->ord[iCoarse][curOrder],true);
for (; iFine<3+e->curPat[iCoarse].effectCols*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) { for (; iFine<3+e->curPat[iCoarse].effectCols*2 && (iCoarse<sEnd.xCoarse || iFine<=sEnd.xFine); iFine++) {
maskOut(opMaskPullDelete,iFine); maskOut(opMaskPullDelete,iFine);
for (int j=selStart.y; j<e->curSubSong->patLen; j++) { for (int j=sStart.y; j<e->curSubSong->patLen; j++) {
if (j<e->curSubSong->patLen-1) { if (j<e->curSubSong->patLen-1) {
if (iFine==0) { if (iFine==0) {
pat->data[j][iFine]=pat->data[j+1][iFine]; pat->data[j][iFine]=pat->data[j+1][iFine];
@ -280,7 +288,7 @@ void FurnaceGUI::doInsert() {
SelectionPoint sStart=selStart; SelectionPoint sStart=selStart;
SelectionPoint sEnd=selEnd; SelectionPoint sEnd=selEnd;
if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y) { if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y && settings.insertBehavior) {
sStart.xFine=0; sStart.xFine=0;
sEnd.xFine=2+e->curPat[sEnd.xCoarse].effectCols*2; sEnd.xFine=2+e->curPat[sEnd.xCoarse].effectCols*2;
} }

View file

@ -1497,6 +1497,7 @@ class FurnaceGUI {
int newPatternFormat; int newPatternFormat;
int renderClearPos; int renderClearPos;
int insertBehavior; int insertBehavior;
int pullDeleteRow;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String patFontPath; String patFontPath;
@ -1647,6 +1648,7 @@ class FurnaceGUI {
newPatternFormat(1), newPatternFormat(1),
renderClearPos(0), renderClearPos(0),
insertBehavior(1), insertBehavior(1),
pullDeleteRow(1),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
patFontPath(""), patFontPath(""),

View file

@ -548,6 +548,11 @@ void FurnaceGUI::drawSettings() {
settings.insertBehavior=insertBehaviorB; settings.insertBehavior=insertBehaviorB;
} }
bool pullDeleteRowB=settings.pullDeleteRow;
if (ImGui::Checkbox("Pull delete affects entire channel row",&pullDeleteRowB)) {
settings.pullDeleteRow=pullDeleteRowB;
}
bool absorbInsInputB=settings.absorbInsInput; bool absorbInsInputB=settings.absorbInsInput;
if (ImGui::Checkbox("Change current instrument when changing instrument column (absorb)",&absorbInsInputB)) { if (ImGui::Checkbox("Change current instrument when changing instrument column (absorb)",&absorbInsInputB)) {
settings.absorbInsInput=absorbInsInputB; settings.absorbInsInput=absorbInsInputB;
@ -2743,6 +2748,7 @@ void FurnaceGUI::syncSettings() {
settings.renderBackend=e->getConfString("renderBackend","SDL"); settings.renderBackend=e->getConfString("renderBackend","SDL");
settings.renderClearPos=e->getConfInt("renderClearPos",0); settings.renderClearPos=e->getConfInt("renderClearPos",0);
settings.insertBehavior=e->getConfInt("insertBehavior",1); settings.insertBehavior=e->getConfInt("insertBehavior",1);
settings.pullDeleteRow=e->getConfInt("pullDeleteRow",1);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
@ -2867,6 +2873,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.newPatternFormat,0,1); clampSetting(settings.newPatternFormat,0,1);
clampSetting(settings.renderClearPos,0,1); clampSetting(settings.renderClearPos,0,1);
clampSetting(settings.insertBehavior,0,1); clampSetting(settings.insertBehavior,0,1);
clampSetting(settings.pullDeleteRow,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -3087,6 +3094,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("renderBackend",settings.renderBackend); e->setConf("renderBackend",settings.renderBackend);
e->setConf("renderClearPos",settings.renderClearPos); e->setConf("renderClearPos",settings.renderClearPos);
e->setConf("insertBehavior",settings.insertBehavior); e->setConf("insertBehavior",settings.insertBehavior);
e->setConf("pullDeleteRow",settings.pullDeleteRow);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {