@@ -396,20 +396,20 @@ void RotaryEncoderUIUsermod::sortModesAndPalettes() {
396396 modes_alpha_indexes = re_initIndexArray (strip.getModeCount ());
397397 re_sortModes (modes_qstrings, modes_alpha_indexes, strip.getModeCount (), MODE_SORT_SKIP_COUNT);
398398
399- DEBUG_PRINT (F (" Sorting palettes: " )); DEBUG_PRINT (strip. getPaletteCount ()); DEBUG_PRINT (' /' ); DEBUG_PRINTLN (strip.customPalettes .size ());
400- palettes_qstrings = re_findModeStrings (JSON_palette_names, strip. getPaletteCount ());
401- palettes_alpha_indexes = re_initIndexArray (strip. getPaletteCount ());
399+ DEBUG_PRINT (F (" Sorting palettes: " )); DEBUG_PRINT (getPaletteCount ()); DEBUG_PRINT (' /' ); DEBUG_PRINTLN (strip.customPalettes .size ());
400+ palettes_qstrings = re_findModeStrings (JSON_palette_names, getPaletteCount ());
401+ palettes_alpha_indexes = re_initIndexArray (getPaletteCount ());
402402 if (strip.customPalettes .size ()) {
403403 for (int i=0 ; i<strip.customPalettes .size (); i++) {
404- palettes_alpha_indexes[strip. getPaletteCount ()-strip.customPalettes .size ()+i] = 255 -i;
405- palettes_qstrings[strip. getPaletteCount ()-strip.customPalettes .size ()+i] = PSTR (" ~Custom~" );
404+ palettes_alpha_indexes[getPaletteCount ()-strip.customPalettes .size ()+i] = 255 -i;
405+ palettes_qstrings[getPaletteCount ()-strip.customPalettes .size ()+i] = PSTR (" ~Custom~" );
406406 }
407407 }
408408 // How many palette names start with '*' and should not be sorted?
409409 // (Also skipping the first one, 'Default').
410410 int skipPaletteCount = 1 ;
411411 while (pgm_read_byte_near (palettes_qstrings[skipPaletteCount]) == ' *' ) skipPaletteCount++;
412- re_sortModes (palettes_qstrings, palettes_alpha_indexes, strip. getPaletteCount ()-strip.customPalettes .size (), skipPaletteCount);
412+ re_sortModes (palettes_qstrings, palettes_alpha_indexes, getPaletteCount ()-strip.customPalettes .size (), skipPaletteCount);
413413}
414414
415415byte *RotaryEncoderUIUsermod::re_initIndexArray (int numModes) {
@@ -698,7 +698,7 @@ void RotaryEncoderUIUsermod::findCurrentEffectAndPalette() {
698698
699699 effectPaletteIndex = 0 ;
700700 DEBUG_PRINTLN (effectPalette);
701- for (unsigned i = 0 ; i < strip. getPaletteCount ()+strip.customPalettes .size (); i++) {
701+ for (unsigned i = 0 ; i < getPaletteCount ()+strip.customPalettes .size (); i++) {
702702 if (palettes_alpha_indexes[i] == effectPalette) {
703703 effectPaletteIndex = i;
704704 DEBUG_PRINTLN (F (" Found palette." ));
@@ -888,7 +888,7 @@ void RotaryEncoderUIUsermod::changePalette(bool increase) {
888888 }
889889 display->updateRedrawTime ();
890890#endif
891- effectPaletteIndex = max (min ((unsigned )(increase ? effectPaletteIndex+1 : effectPaletteIndex-1 ), strip. getPaletteCount ()+strip.customPalettes .size ()-1 ), 0U );
891+ effectPaletteIndex = max (min ((unsigned )(increase ? effectPaletteIndex+1 : effectPaletteIndex-1 ), getPaletteCount ()+strip.customPalettes .size ()-1 ), 0U );
892892 effectPalette = palettes_alpha_indexes[effectPaletteIndex];
893893 stateChanged = true ;
894894 if (applyToAll) {
0 commit comments