GUI: find and replace, part 10

find kind of works (only lax mode left to do)
then i'll do replace
This commit is contained in:
tildearrow 2022-06-11 03:53:34 -05:00
parent 7354b1221c
commit 44341d8ccd

View file

@ -112,18 +112,28 @@ void FurnaceGUI::doFind() {
bool notMatched=false; bool notMatched=false;
switch (curQueryEffectPos) { switch (curQueryEffectPos) {
case 0: // no case 0: // no
// TODO
for (int m=0; m<l.effectCount; m++) { for (int m=0; m<l.effectCount; m++) {
bool allGood=false;
for (int n=0; n<e->curPat[k].effectCols; n++) { for (int n=0; n<e->curPat[k].effectCols; n++) {
if (!checkCondition(l.effectMode[m],l.effect[m],l.effectMax[m],p->data[j][4+m*2])) continue; if (!checkCondition(l.effectMode[m],l.effect[m],l.effectMax[m],p->data[j][4+n*2])) continue;
if (!checkCondition(l.effectValMode[m],l.effectVal[m],l.effectValMax[m],p->data[j][5+m*2])) continue; if (!checkCondition(l.effectValMode[m],l.effectVal[m],l.effectValMax[m],p->data[j][5+n*2])) continue;
allGood=true;
break;
}
if (!allGood) {
notMatched=true;
break;
} }
} }
break; break;
case 1: // lax case 1: // lax
break; break;
case 2: // strict case 2: // strict
for (int m=0; m<l.effectCount; m++) { int effectMax=l.effectCount;
if (effectMax>e->curPat[k].effectCols) {
notMatched=true;
} else {
for (int m=0; m<effectMax; m++) {
if (!checkCondition(l.effectMode[m],l.effect[m],l.effectMax[m],p->data[j][4+m*2])) { if (!checkCondition(l.effectMode[m],l.effect[m],l.effectMax[m],p->data[j][4+m*2])) {
notMatched=true; notMatched=true;
break; break;
@ -133,6 +143,7 @@ void FurnaceGUI::doFind() {
break; break;
} }
} }
}
break; break;
} }
if (notMatched) continue; if (notMatched) continue;