Chance setting

This commit is contained in:
Dejvino
2026-03-07 21:31:17 +01:00
parent 99add4e2ac
commit f34f960358
7 changed files with 70 additions and 2 deletions
+15
View File
@@ -103,6 +103,9 @@ void UIManager::draw(UIState currentState, int menuSelection,
case UI_EDIT_INTENSITY:
drawNumberEditor("SET INTENSITY", trackIntensities[randomizeTrack], 1, 10);
break;
case UI_EDIT_CHANCE:
drawNumberEditor("SET CHANCE %", trackChance[randomizeTrack], 0, 100);
break;
case UI_RANDOMIZE_TRACK_EDIT:
drawEditScreen("SET TRACK", "TRK: ", randomizeTrack + 1);
break;
@@ -261,6 +264,18 @@ void UIManager::drawMenu(int selection, UIState currentState, int midiChannel, i
display.drawRect(barX, barY, maxW + 2, h, color);
display.fillRect(barX + 1, barY + 1, (val * maxW) / 10, h - 2, color);
}
else if (id == MENU_ID_CHANCE) {
display.print(F(": "));
display.print(trackChance[randomizeTrack]);
int val = trackChance[randomizeTrack];
int barX = display.getCursorX() + 3;
int barY = y + 2;
int maxW = 20;
int h = 5;
uint16_t color = (i == selection) ? SSD1306_BLACK : SSD1306_WHITE;
display.drawRect(barX, barY, maxW + 2, h, color);
display.fillRect(barX + 1, barY + 1, (val * maxW) / 100, h - 2, color);
}
else if (id == MENU_ID_MUTATION) { display.print(F(": ")); display.print(mutationEnabled ? F("ON") : F("OFF")); }
else if (id == MENU_ID_PROTECTED_MODE) { display.print(F(": ")); display.print(protectedMode ? F("ON") : F("OFF")); }