|
|
|
@ -46,6 +46,13 @@ $('.item-content[data-setting=wakelock] .toggle input').on("change", function ()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.item-content[data-setting=alertvolume] .range-slider').on('range:changed', function (e, range) {
|
|
|
|
|
var val = app.range.get(".item-content[data-setting=alertvolume] .range-slider").getValue();
|
|
|
|
|
localStorage.setItem("alertvolume", val);
|
|
|
|
|
setVolume("alert", val);
|
|
|
|
|
playSound("alert");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function pickAlertSound() {
|
|
|
|
|
var currentalertsound = localStorage.getItem("alertsound");
|
|
|
|
|
app.dialog.create({
|
|
|
|
@ -62,12 +69,19 @@ function pickAlertSound() {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Jump' + (currentalertsound == "jump" ? " (current)" : ""),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Cancel',
|
|
|
|
|
color: 'red'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
verticalButtons: true,
|
|
|
|
|
onClick: function (dialog, index) {
|
|
|
|
|
var alertsound = "sonar";
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
alertsound = "sonar";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
alertsound = "robot";
|
|
|
|
|
break;
|
|
|
|
@ -77,9 +91,8 @@ function pickAlertSound() {
|
|
|
|
|
case 3:
|
|
|
|
|
alertsound = "jump";
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
default:
|
|
|
|
|
alertsound = "sonar";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
localStorage.setItem("alertsound", alertsound);
|
|
|
|
|
// Reload sound effect stuff to apply new sound
|
|
|
|
@ -103,24 +116,34 @@ function pickMapSource() {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Terrain' + (currentmapsource == "terrain" ? " (current)" : ""),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Cancel',
|
|
|
|
|
color: 'red'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
verticalButtons: true,
|
|
|
|
|
onClick: function (dialog, index) {
|
|
|
|
|
var mapsource = "offline";
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
mapsource = "offline";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
mapsource = "liberty";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
mapsource = "terrain";
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
default:
|
|
|
|
|
mapsource = "offline";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
localStorage.setItem("mapsource", mapsource);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).open();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatPercentLabel(value) {
|
|
|
|
|
return value + "%";
|
|
|
|
|
}
|