File tree Expand file tree Collapse file tree 5 files changed +15
-4
lines changed Expand file tree Collapse file tree 5 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ typedef uint64_t LedMap;
106106#define MAP_IS_ONE_LED (map ) (map && !(map & (map-1)))
107107
108108// foreach led macro (only iterates singles)
109- #define MAP_FOREACH_LED (map ) for (LedPos pos = ledmapGetFirstLed(map); pos < LED_COUNT; pos = ledmapGetNextLed(map, pos))
109+ #define MAP_FOREACH_LED (map ) for (LedPos pos = ledmapGetFirstLed(map); pos != LED_COUNT; pos = ledmapGetNextLed(map, pos))
110110
111111// convert a map to the first Led position in the map
112112inline LedPos ledmapGetFirstLed (LedMap map )
Original file line number Diff line number Diff line change @@ -157,6 +157,13 @@ void Menu::nextBulbSelection()
157157 }
158158}
159159
160+ void Menu::bypassLedSelection (LedMap map)
161+ {
162+ m_ledSelected = true ;
163+ m_targetLeds = map;
164+ onLedSelected ();
165+ }
166+
160167void Menu::onLedSelected ()
161168{
162169}
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ class Menu
4444 // iterate to next bulb selection
4545 void nextBulbSelection ();
4646
47+ // skip led selection
48+ void bypassLedSelection (LedMap map);
4749 // an overridable api that allows derived menus to decide which led selections
4850 // should be available before they have actually opened
4951 virtual bool isValidLedSelection (LedMap selection) const { return true ; }
Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ bool ColorSelect::init()
4545 return false ;
4646 }
4747 if (cur->isMultiLed ()) {
48- m_targetLeds = MAP_LED (LED_MULTI);
49- m_ledSelected = true ;
48+ bypassLedSelection (MAP_LED (LED_MULTI));
5049 }
5150 m_state = STATE_INIT;
5251 DEBUG_LOG (" Entered color select" );
Original file line number Diff line number Diff line change @@ -147,11 +147,14 @@ bool Randomizer::reRoll()
147147 if (!reRollMulti ()) {
148148 return false ;
149149 }
150+ } else if (!reRollSingles ()) {
151+ return false ;
150152 }
151- #endif
153+ #else
152154 if (!reRollSingles ()) {
153155 return false ;
154156 }
157+ #endif
155158 // initialize the mode with the new pattern and colorset
156159 m_previewMode.init ();
157160 return true ;
You can’t perform that action at this time.
0 commit comments