Skip to content

Commit

Permalink
fixed multi led patterns in pattern select
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 17, 2023
1 parent 1f6df3e commit bc96d49
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions VortexEngine/src/Menus/MenuList/PatternSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
PatternSelect::PatternSelect(const RGBColor &col, bool advanced) :
Menu(col, advanced),
m_state(STATE_PICK_LIST),
m_newPatternID(PATTERN_FIRST),
m_started(false)
m_newPatternID(PATTERN_FIRST)
{
}

Expand Down Expand Up @@ -132,15 +131,13 @@ void PatternSelect::nextPattern()
if (newID > endList || newID < beginList) {
newID = beginList;
}
if (!m_started) {
m_started = true;
m_newPatternID = PATTERN_FIRST;
}
// set the new pattern id
if (isMultiLedPatternID(newID)) {
m_previewMode.setPattern(newID);
} else {
// TODO: clear multi a better way
m_previewMode.setPatternMap(m_targetLeds, newID);
m_previewMode.clearPattern(LED_MULTI);
}
m_previewMode.init();
DEBUG_LOGF("Iterated to pattern id %d", newID);
Expand All @@ -166,15 +163,13 @@ void PatternSelect::previousPattern()
if (newID > endList || newID < beginList) {
newID = endList;
}
if (!m_started) {
m_started = true;
m_newPatternID = PATTERN_FIRST;
}
// set the new pattern id
if (isMultiLedPatternID(newID)) {
m_previewMode.setPattern(newID);
} else {
// TODO: clear multi a better way
m_previewMode.setPatternMap(m_targetLeds, newID);
m_previewMode.clearPattern(LED_MULTI);
}
m_previewMode.init();
DEBUG_LOGF("Iterated to pattern id %d", newID);
Expand Down

0 comments on commit bc96d49

Please sign in to comment.