Skip to content

Commit

Permalink
Merge branch 'master' into chromadeck
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 27, 2024
2 parents 90d045d + 732cbef commit 3a06d25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
52 changes: 2 additions & 50 deletions VortexEngine/src/Menus/MenuList/PatternSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

PatternSelect::PatternSelect(const RGBColor &col, bool advanced) :
Menu(col, advanced),
m_newPatternID(PATTERN_FIRST),
m_srcLed(LED_FIRST),
m_argIndex(0),
m_started(false)
{
}
Expand All @@ -43,7 +43,7 @@ Menu::MenuAction PatternSelect::run()
// run the current mode
m_previewMode.play();
// show dimmer selections in advanced mode
Menus::showSelection(m_advanced ? RGB_GREEN0 : RGB_WHITE5);
Menus::showSelection(RGB_WHITE5);
return MENU_CONTINUE;
}

Expand All @@ -54,46 +54,6 @@ void PatternSelect::onLedSelected()

void PatternSelect::onShortClickM()
{
if (m_advanced) {
// double click = skip 10
bool doSkip = g_pButtonM->onConsecutivePresses(2);
MAP_FOREACH_LED(m_targetLeds) {
Pattern *pat = m_previewMode.getPattern(pos);
if (!pat || pat->getNumArgs() <= m_argIndex) {
continue;
}
uint8_t &arg = pat->argRef(m_argIndex);
if (doSkip) {
arg += 10 - (arg % 10);
} else {
arg++;
}
// on/off/gap/dash duration max 100
uint8_t max = 100;
if (m_argIndex == 6) {
// blend number of numflips
max = 4;
} else if (m_argIndex > 3) {
// group size, solid index, blendspeed
max = 20;
}
if (arg > max) {
// red flash indicates reaching end
Leds::holdAll(RGB_RED);
arg %= (max + 1);
}
// do not let argument0 be reset to 0
if (!m_argIndex && !arg) {
arg = 1;
}
}
m_previewMode.init();
if (doSkip) {
// hold white for a moment to show they are skipping 25
Leds::holdAll(RGB_YELLOW1);
}
return;
}
nextPattern();
}

Expand Down Expand Up @@ -144,14 +104,6 @@ void PatternSelect::nextPattern()
void PatternSelect::onLongClickM()
{
bool needsSave = false;
if (m_advanced) {
m_argIndex++;
if (m_argIndex < m_previewMode.getPattern(m_srcLed)->getNumArgs()) {
// if we haven't reached number of args yet then just return and kee pgoing
return;
}
Leds::holdAll(m_menuColor);
}
Mode *cur = Modes::curMode();
needsSave = !cur->equals(&m_previewMode);
if (needsSave) {
Expand Down
3 changes: 0 additions & 3 deletions VortexEngine/src/Menus/MenuList/PatternSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class PatternSelect : public Menu
// helpful member
LedPos m_srcLed;

// used for adv pat select
uint8_t m_argIndex;

// the pat select starts by showing the current pattern
// then the first click begin cycling the list of pats
bool m_started;
Expand Down

0 comments on commit 3a06d25

Please sign in to comment.