score: allow user to mirror score buttons on b1
parent
23ec132b4d
commit
f6f1a1c352
|
|
@ -33,9 +33,10 @@ function setupInputWatchers(init) {
|
||||||
Bangle.setUI('updown', v => {
|
Bangle.setUI('updown', v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
if (isBangle1) {
|
if (isBangle1) {
|
||||||
handleInput(Math.floor(((v*-1)+2)/2))
|
let i = settings.mirrorScoreButtons ? v * -1 : v;
|
||||||
|
handleInput(Math.floor((i+2)/2));
|
||||||
} else {
|
} else {
|
||||||
handleInput(Math.floor((v+2)/2)+3)
|
handleInput(Math.floor((v+2)/2)+3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,13 @@
|
||||||
(function () {
|
(function () {
|
||||||
return (function (back, inApp, ret) {
|
return (function (back, inApp, ret) {
|
||||||
|
const isBangle1 = process.env.BOARD === 'BANGLEJS'
|
||||||
|
|
||||||
function fillSettingsWithDefaults(settings) {
|
function fillSettingsWithDefaults(settings) {
|
||||||
|
if (isBangle1) {
|
||||||
|
if (settings.mirrorScoreButtons == null) {
|
||||||
|
settings.mirrorScoreButtons = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (settings.winSets == null) {
|
if (settings.winSets == null) {
|
||||||
settings.winSets = 2;
|
settings.winSets = 2;
|
||||||
}
|
}
|
||||||
|
|
@ -100,6 +107,13 @@
|
||||||
}
|
}
|
||||||
m['< Back'] = function () { back(settings, changed); };
|
m['< Back'] = function () { back(settings, changed); };
|
||||||
m['Presets'] = function () { E.showMenu(presetMenu(back)); };
|
m['Presets'] = function () { E.showMenu(presetMenu(back)); };
|
||||||
|
if (isBangle1) {
|
||||||
|
m['Mirror Buttons'] = {
|
||||||
|
value: settings.mirrorScoreButtons,
|
||||||
|
format: m => offon[~~m],
|
||||||
|
onchange: m => setAndSave('mirrorScoreButtons', m),
|
||||||
|
};
|
||||||
|
}
|
||||||
m['Sets to win'] = {
|
m['Sets to win'] = {
|
||||||
value: settings.winSets,
|
value: settings.winSets,
|
||||||
min:1,
|
min:1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue