Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VortexEngine/src/Leds/LedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ typedef uint64_t LedMap;
#define MAP_IS_ONE_LED(map) (map && !(map & (map-1)))

// foreach led macro (only iterates singles)
#define MAP_FOREACH_LED(map) for (LedPos pos = ledmapGetFirstLed(map); pos < LED_COUNT; pos = ledmapGetNextLed(map, pos))
#define MAP_FOREACH_LED(map) for (LedPos pos = ledmapGetFirstLed(map); pos != LED_COUNT; pos = ledmapGetNextLed(map, pos))

// convert a map to the first Led position in the map
inline LedPos ledmapGetFirstLed(LedMap map)
Expand Down
7 changes: 7 additions & 0 deletions VortexEngine/src/Menus/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ void Menu::showExit()
Leds::setIndex(THUMB_TOP, RGB_WHITE0);
}

void Menu::bypassLedSelection(LedMap map)
{
m_ledSelected = true;
m_targetLeds = map;
onLedSelected();
}

void Menu::onLedSelected()
{
}
Expand Down
2 changes: 2 additions & 0 deletions VortexEngine/src/Menus/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Menu
// blink the selected finger
virtual void blinkSelection(uint32_t offMs = 250, uint32_t onMs = 500);

// skip led selection
void bypassLedSelection(LedMap map);
// an overridable api that allows derived menus to decide which led selections
// should be available before they have actually opened
virtual bool isValidLedSelection(LedMap selection) const { return true; }
Expand Down
3 changes: 1 addition & 2 deletions VortexEngine/src/Menus/MenuList/ColorSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ bool ColorSelect::init()
return false;
}
if (cur->isMultiLed()) {
m_targetLeds = MAP_LED(LED_MULTI);
m_ledSelected = true;
bypassLedSelection(MAP_LED(LED_MULTI));
}
m_state = STATE_INIT;
DEBUG_LOG("Entered color select");
Expand Down
5 changes: 4 additions & 1 deletion VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,14 @@ bool Randomizer::reRoll()
if (!reRollMulti()) {
return false;
}
} else if (!reRollSingles()) {
return false;
}
#endif
#else
if (!reRollSingles()) {
return false;
}
#endif
// initialize the mode with the new pattern and colorset
m_previewMode.init();
return true;
Expand Down