Percent FX use % as index in palette.

FX Checkmark bugfix.
This commit is contained in:
Blaz Kristan 2022-09-21 21:09:01 +02:00
parent ad4870a59b
commit de90e5b753
3 changed files with 508 additions and 501 deletions

View File

@ -3581,10 +3581,13 @@ uint16_t mode_percent(void) {
uint8_t size = (1 + ((SEGMENT.speed * SEGLEN) >> 11)); uint8_t size = (1 + ((SEGMENT.speed * SEGLEN) >> 11));
if (SEGMENT.speed == 255) size = 255; if (SEGMENT.speed == 255) size = 255;
if (percent < 100) { if (percent <= 100) {
for (int i = 0; i < SEGLEN; i++) { for (int i = 0; i < SEGLEN; i++) {
if (i < SEGENV.aux1) { if (i < SEGENV.aux1) {
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); if (SEGMENT.check1)
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(map(percent,0,100,0,255), false, false, 0));
else
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
} }
else { else {
SEGMENT.setPixelColor(i, SEGCOLOR(1)); SEGMENT.setPixelColor(i, SEGCOLOR(1));
@ -3596,7 +3599,10 @@ uint16_t mode_percent(void) {
SEGMENT.setPixelColor(i, SEGCOLOR(1)); SEGMENT.setPixelColor(i, SEGCOLOR(1));
} }
else { else {
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0)); if (SEGMENT.check1)
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(map(percent,100,200,255,0), false, false, 0));
else
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
} }
} }
} }
@ -3611,7 +3617,7 @@ uint16_t mode_percent(void) {
return FRAMETIME; return FRAMETIME;
} }
static const char _data_FX_MODE_PERCENT[] PROGMEM = "Percent@,% of fill;!,!,;!;1d"; static const char _data_FX_MODE_PERCENT[] PROGMEM = "Percent@,% of fill,,,,One color;!,!,;!;1d";
/* /*

View File

@ -1395,7 +1395,7 @@ function setEffectParameters(idx)
if (slOnOff.length>5) { if (slOnOff.length>5) {
gId('fxopt').classList.remove('fade'); gId('fxopt').classList.remove('fade');
for (let i = 0; i<3; i++) { for (let i = 0; i<3; i++) {
if (slOnOff[5+i]!=='') { if (5+i<slOnOff.length && slOnOff[5+i]!=='') {
gId('opt'+i).classList.remove('hide'); gId('opt'+i).classList.remove('hide');
gId('optLabel'+i).innerHTML = slOnOff[5+i]=="!" ? 'Option' : slOnOff[5+i].substr(0,16); gId('optLabel'+i).innerHTML = slOnOff[5+i]=="!" ? 'Option' : slOnOff[5+i].substr(0,16);
} else } else

File diff suppressed because it is too large Load Diff