forked from ppfun/pixelplanet
add makenull CanvasCleaner strategy
This commit is contained in:
parent
51ef4a52cd
commit
f2de50f846
|
@ -191,6 +191,9 @@ function ModCanvastools() {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
descCleanAction = t`Clean spare pixels that are surrounded by a single other color or unset pixels (VERY AGGRESSIVE ON CANVASES THAT ALLOW UNSET PIXELS (where there are two cooldowns)!)`;
|
descCleanAction = t`Clean spare pixels that are surrounded by a single other color or unset pixels (VERY AGGRESSIVE ON CANVASES THAT ALLOW UNSET PIXELS (where there are two cooldowns)!)`;
|
||||||
break;
|
break;
|
||||||
|
case 'makenull':
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
descCleanAction = t`Turn every pixel in area to 0 (YOU REALLY SHOULDN'T DO THAT ON ANY AREA THAT ISN'T ALREADY MOSTLY 0)`;
|
||||||
default:
|
default:
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
|
@ -496,7 +499,7 @@ function ModCanvastools() {
|
||||||
selectCleanAction(sel.options[sel.selectedIndex].value);
|
selectCleanAction(sel.options[sel.selectedIndex].value);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{['spare', 'spareext', 'spareextu'].map((opt) => (
|
{['spare', 'spareext', 'spareextu', 'makenull'].map((opt) => (
|
||||||
<option
|
<option
|
||||||
key={opt}
|
key={opt}
|
||||||
value={opt}
|
value={opt}
|
||||||
|
|
|
@ -120,6 +120,14 @@ const METHODS = {
|
||||||
}
|
}
|
||||||
return finPxl;
|
return finPxl;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
makenull: (xc, yc, clrIgnore, canvasCleaner) => {
|
||||||
|
let pxl = canvasCleaner.getPixelInChunkArea(xc, yc);
|
||||||
|
if (pxl === null || pxl === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
class CanvasCleaner {
|
class CanvasCleaner {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user