score: toggle the menu using the physical button on Bangle2 (Bangle1 should still work as before), add the Correction mode menu item and reorder menu
parent
7fbfcea116
commit
41bffb341c
|
|
@ -96,28 +96,33 @@ function setupMatch() {
|
||||||
|
|
||||||
function showSettingsMenu() {
|
function showSettingsMenu() {
|
||||||
settingsMenuOpened = getSecondsTime();
|
settingsMenuOpened = getSecondsTime();
|
||||||
settingsMenu(function (s, reset) {
|
settingsMenu(function (s, reset, back) {
|
||||||
|
// console.log('reset:', reset, 'back:', back);
|
||||||
|
if (isBangle1) {
|
||||||
E.showMenu();
|
E.showMenu();
|
||||||
|
}
|
||||||
|
|
||||||
settings = s;
|
settings = s;
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
setupMatch();
|
setupMatch();
|
||||||
} else if (getSecondsTime() - settingsMenuOpened < 500 || correctionMode) {
|
|
||||||
correctionMode = !correctionMode;
|
|
||||||
}
|
}
|
||||||
|
if (isBangle1 || (!isBangle1 && back)) {
|
||||||
settingsMenuOpened = null;
|
settingsMenuOpened = null;
|
||||||
|
|
||||||
draw();
|
draw();
|
||||||
|
|
||||||
setupDisplay();
|
setupDisplay();
|
||||||
setupInputWatchers();
|
setupInputWatchers();
|
||||||
|
}
|
||||||
}, function (msg) {
|
}, function (msg) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case 'end_set':
|
case 'end_set':
|
||||||
updateCurrentSet(1);
|
updateCurrentSet(1);
|
||||||
break;
|
break;
|
||||||
|
case 'correct_mode':
|
||||||
|
correctionMode = !correctionMode;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -304,7 +309,22 @@ function score(player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleInput(button) {
|
function handleInput(button) {
|
||||||
|
// console.log('button:', button);
|
||||||
if (settingsMenuOpened) {
|
if (settingsMenuOpened) {
|
||||||
|
|
||||||
|
if (!isBangle1 && button == 2) {
|
||||||
|
E.showMenu();
|
||||||
|
|
||||||
|
settingsMenuOpened = null;
|
||||||
|
|
||||||
|
draw();
|
||||||
|
|
||||||
|
setupDisplay();
|
||||||
|
setupInputWatchers();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
if (selected != null) {
|
if (selected != null) {
|
||||||
m[''].selected = selected;
|
m[''].selected = selected;
|
||||||
}
|
}
|
||||||
m['< Back'] = function () { back(settings, changed); };
|
m['< Back'] = function () { back(settings, changed, true); };
|
||||||
m['Presets'] = function () { E.showMenu(presetMenu(back)); };
|
m['Presets'] = function () { E.showMenu(presetMenu(back)); };
|
||||||
if (isBangle1) {
|
if (isBangle1) {
|
||||||
m['Mirror Buttons'] = {
|
m['Mirror Buttons'] = {
|
||||||
|
|
@ -198,9 +198,10 @@
|
||||||
const inAppMenu = function () {
|
const inAppMenu = function () {
|
||||||
let m = {
|
let m = {
|
||||||
'': {'title': 'Score Menu'},
|
'': {'title': 'Score Menu'},
|
||||||
'< Back': function () { back(settings, changed); },
|
'< Back': function () { back(settings, changed, false); },
|
||||||
'Reset match': function () { back(settings, true); },
|
'Correct mode': function () { inApp('correct_mode'); back(settings, false, true); },
|
||||||
'End current set': function () { inApp('end_set'); back(settings, changed); },
|
'Reset match': function () { back(settings, true, true); },
|
||||||
|
'End current set': function () { inApp('end_set'); back(settings, changed, true); },
|
||||||
'Configuration': function () { E.showMenu(appMenu(function () {
|
'Configuration': function () { E.showMenu(appMenu(function () {
|
||||||
E.showMenu(inAppMenu());
|
E.showMenu(inAppMenu());
|
||||||
})); },
|
})); },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue