Skip to content

Commit 9fbb59c

Browse files
committed
start of col select menu work
1 parent 1e7c5a9 commit 9fbb59c

2 files changed

Lines changed: 59 additions & 24 deletions

File tree

‎VortexEngine/src/Leds/LedTypes.h‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,27 @@ inline LedPos ledmapGetNextLed(LedMap map, LedPos pos)
222222
#define MAP_LINE_4 (MAP_LED(LED_3) | MAP_LED(LED_13) | MAP_LED(LED_18) | MAP_LED(LED_8))
223223
#define MAP_LINE_5 (MAP_LED(LED_4) | MAP_LED(LED_14) | MAP_LED(LED_19) | MAP_LED(LED_9))
224224

225-
//Chromadeck bitmap
226225
#define MAP_OPPOSITES_1 (MAP_LED(LED_0) | MAP_LED(LED_5) | MAP_LED(LED_10) | MAP_LED(LED_15))
227226
#define MAP_OPPOSITES_2 (MAP_LED(LED_1) | MAP_LED(LED_6) | MAP_LED(LED_11) | MAP_LED(LED_16))
228227
#define MAP_OPPOSITES_3 (MAP_LED(LED_2) | MAP_LED(LED_7) | MAP_LED(LED_12) | MAP_LED(LED_17))
229228
#define MAP_OPPOSITES_4 (MAP_LED(LED_3) | MAP_LED(LED_8) | MAP_LED(LED_13) | MAP_LED(LED_18))
230229
#define MAP_OPPOSITES_5 (MAP_LED(LED_4) | MAP_LED(LED_9) | MAP_LED(LED_14) | MAP_LED(LED_19))
231230

231+
// radial led maps around the chromadeck
232+
#define MAP_RADIAL_OUTER(n) (MAP_LED(LED_0 + ((n) % LED_10)))
233+
#define MAP_RADIAL_INNER(n) (MAP_LED(LED_10 + ((n) % LED_10)))
234+
#define MAP_RADIAL(n) (MAP_RADIAL_INNER(n) | MAP_RADIAL_OUTER(n))
235+
#define MAP_RADIAL_0 MAP_RADIAL(0)
236+
#define MAP_RADIAL_1 MAP_RADIAL(1)
237+
#define MAP_RADIAL_2 MAP_RADIAL(2)
238+
#define MAP_RADIAL_3 MAP_RADIAL(3)
239+
#define MAP_RADIAL_4 MAP_RADIAL(4)
240+
#define MAP_RADIAL_5 MAP_RADIAL(5)
241+
#define MAP_RADIAL_6 MAP_RADIAL(6)
242+
#define MAP_RADIAL_7 MAP_RADIAL(7)
243+
#define MAP_RADIAL_8 MAP_RADIAL(8)
244+
#define MAP_RADIAL_9 MAP_RADIAL(9)
245+
232246
// set a single led
233247
inline void ledmapSetLed(LedMap &map, LedPos pos)
234248
{

‎VortexEngine/src/Menus/MenuList/ColorSelect.cpp‎

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,31 +180,52 @@ void ColorSelect::onLongClickM()
180180

181181
void ColorSelect::showSlotSelection()
182182
{
183-
uint8_t exitIndex = m_colorset.numColors();
184-
uint32_t holdDur = g_pButtonM->holdDuration();
185-
bool withinNumColors = m_curSelection < exitIndex;
186-
bool holdDurationCheck = g_pButtonM->isPressed() && holdDur >= DELETE_THRESHOLD_TICKS;
187-
bool holdDurationModCheck = (holdDur % (DELETE_CYCLE_TICKS * 2)) > DELETE_CYCLE_TICKS;
188-
const RGBColor &col = m_colorset[m_curSelection];
189-
if (withinNumColors && holdDurationCheck && holdDurationModCheck) {
190-
// breath red for delete slot
191-
Leds::breatheIndex(LED_ALL, 0, holdDur);
192-
} else if (withinNumColors) {
193-
if (col.empty()) {
194-
Leds::setAll(RGB_WHITE0);
195-
}
196-
// blink the selected slot color
197-
Leds::blinkAll(150, 650, col);
198-
} else if (exitIndex < MAX_COLOR_SLOTS) {
199-
if (m_curSelection == exitIndex) {
200-
// blink both leds and blink faster to indicate 'add' new color
201-
Leds::blinkAll(100, 150, RGB_WHITE2);
183+
// Render the colors on radial indices 0-7
184+
for (uint8_t i = 0; i < 8; ++i) {
185+
RGBColor col;
186+
if (m_colorset.numColors() <= i) {
187+
Leds::setMap(MAP_RADIAL_INNER(i), RGB_WHITE0);
188+
//Leds::blinkMap(MAP_RADIAL(i + 8));
189+
} else {
190+
Leds::setMap(MAP_RADIAL_OUTER(i), m_colorset.get(i));
191+
Leds::setMap(MAP_RADIAL_INNER(i), RGB_WHITE2);
202192
}
203-
exitIndex++;
204-
}
205-
if (m_curSelection == exitIndex) {
206-
showFullSet(50, 100);
207193
}
194+
195+
// Radial index 8: Exit
196+
Leds::setMap(MAP_RADIAL_INNER(8), RGB_WHITE1);
197+
Leds::setMap(MAP_RADIAL_OUTER(8), RGB_RED3);
198+
199+
//Leds::setMap(MAP_RADIAL_INNER(7), HSVColor(Time::getCurtime() / 10, 255, 255));
200+
//Leds::setMap(MAP_RADIAL_OUTER(7), RGB_WHITE4);
201+
//Leds::blinkMap(MAP_RADIAL(6));
202+
203+
204+
//uint8_t exitIndex = m_colorset.numColors();
205+
//uint32_t holdDur = g_pButtonM->holdDuration();
206+
//bool withinNumColors = m_curSelection < exitIndex;
207+
//bool holdDurationCheck = g_pButtonM->isPressed() && holdDur >= DELETE_THRESHOLD_TICKS;
208+
//bool holdDurationModCheck = (holdDur % (DELETE_CYCLE_TICKS * 2)) > DELETE_CYCLE_TICKS;
209+
//const RGBColor &col = m_colorset[m_curSelection];
210+
//if (withinNumColors && holdDurationCheck && holdDurationModCheck) {
211+
// // breath red for delete slot
212+
// Leds::breatheIndex(LED_ALL, 0, holdDur);
213+
//} else if (withinNumColors) {
214+
// if (col.empty()) {
215+
// Leds::setAll(RGB_WHITE0);
216+
// }
217+
// // blink the selected slot color
218+
// Leds::blinkAll(150, 650, col);
219+
//} else if (exitIndex < MAX_COLOR_SLOTS) {
220+
// if (m_curSelection == exitIndex) {
221+
// // blink both leds and blink faster to indicate 'add' new color
222+
// Leds::blinkAll(100, 150, RGB_WHITE2);
223+
// }
224+
// exitIndex++;
225+
//}
226+
//if (m_curSelection == exitIndex) {
227+
// showFullSet(50, 100);
228+
//}
208229
}
209230

210231
void ColorSelect::showSelection(ColorSelectState mode)

0 commit comments

Comments
 (0)