Skip to content

Commit e079d21

Browse files
committed
add aurora effect switch
1 parent 82021fd commit e079d21

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

locales/en/messages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3974,6 +3974,10 @@
39743974
"message": "Larson scanner",
39753975
"description": "Larson effect switch label on LED Strip tab"
39763976
},
3977+
"ledStripAuroraOverlay": {
3978+
"message": "Aurora Effect",
3979+
"description": "Aurora effect switch label on LED Strip tab"
3980+
},
39773981
"ledStripBlinkAlwaysOverlay": {
39783982
"message": "Blink always"
39793983
},

src/js/msp/MSPHelper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { reinitializeConnection } from "../serial_backend";
2121
// Used for LED_STRIP
2222
const ledDirectionLetters = ['n', 'e', 's', 'w', 'u', 'd']; // in LSB bit order
2323
const ledBaseFunctionLetters = ['c', 'f', 'a', 'l', 's', 'g', 'r', 'p', 'e', 'u']; // in LSB bit
24-
let ledOverlayLetters = ['t', 'y', 'o', 'b', 'v', 'i', 'w']; // in LSB bit
24+
let ledOverlayLetters = ['t', 'y', 'o', 'x', 'b', 'v', 'i', 'w']; // in LSB bit
2525

2626
function MspHelper() {
2727
const self = this;
@@ -1220,14 +1220,14 @@ MspHelper.prototype.process_data = function(dataHandler) {
12201220
}
12211221
}
12221222

1223-
const overlayMask = (mask >> 12) & 0x3FF;
1223+
const overlayMask = (mask >> 13) & 0x3FF;
12241224
for (let overlayLetterIndex = 0; overlayLetterIndex < ledOverlayLetters.length; overlayLetterIndex++) {
12251225
if (bit_check(overlayMask, overlayLetterIndex)) {
12261226
functions.push(ledOverlayLetters[overlayLetterIndex]);
12271227
}
12281228
}
12291229

1230-
const directionMask = (mask >> 26) & 0x3F;
1230+
const directionMask = (mask >> 27) & 0x3F;
12311231
const directions = [];
12321232
for (let directionLetterIndex = 0; directionLetterIndex < ledDirectionLetters.length; directionLetterIndex++) {
12331233
if (bit_check(directionMask, directionLetterIndex)) {

src/js/tabs/led_strip.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ led_strip.initialize = function (callback, scrollPosition) {
2020

2121
TABS.led_strip.functions = ['i', 'w', 'f', 'a', 't', 'r', 'c', 'g', 's', 'b', 'l', 'o', 'y'];
2222
TABS.led_strip.baseFuncs = ['c', 'f', 'a', 'l', 's', 'g', 'r', 'p', 'e', 'u'];
23-
TABS.led_strip.overlays = ['t', 'y', 'o', 'b', 'v', 'i', 'w'];
23+
TABS.led_strip.overlays = ['t', 'y', 'o', 'x', 'b', 'v', 'i', 'w'];
2424

2525
if (semver.lt(FC.CONFIG.apiVersion,API_VERSION_1_46)) {
2626
TABS.led_strip.overlays = TABS.led_strip.overlays.filter(x => x !== 'y');
@@ -456,6 +456,7 @@ led_strip.initialize = function (callback, scrollPosition) {
456456
case 't':
457457
case 'y':
458458
case 'o':
459+
case 'x':
459460
case 's':
460461
if (areModifiersActive(`function-${f}`))
461462
p.addClass(`function-${letter}`);
@@ -503,6 +504,13 @@ led_strip.initialize = function (callback, scrollPosition) {
503504
blink.trigger('change');
504505
toggleSwitch(blink, 'b');
505506
}
507+
} else if (that.is('.function-b')) {
508+
const aurora = $('.checkbox .function-x');
509+
if ($('.checkbox .function-x').is(':checked')) {
510+
aurora.prop('checked', false);
511+
aurora.trigger('change');
512+
toggleSwitch(aurora, 'x');
513+
}
506514
} else if (that.is('.function-b')) {
507515
const larson = $('.checkbox .function-o');
508516
if ($('.checkbox .function-o').is(':checked')) {
@@ -827,6 +835,7 @@ led_strip.initialize = function (callback, scrollPosition) {
827835
case "function-r":
828836
case "function-y":
829837
case "function-o":
838+
case "function-x":
830839
case "function-b":
831840
case "function-g":
832841
return true;

src/tabs/led_strip.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
<label> <span i18n="ledStripLarsonOverlay"></span></label>
8484
</div>
8585

86+
<div class="checkbox">
87+
<input type="checkbox" name="Aurora" class="toggle function-x" />
88+
<label> <span i18n="ledStripAuroraOverlay"></span></label>
89+
</div>
90+
8691
<div class="checkbox">
8792
<input type="checkbox" name="blink" class="toggle function-b" />
8893
<label> <span i18n="ledStripBlinkAlwaysOverlay"></span></label>

0 commit comments

Comments
 (0)