Create settings.js

Settings
pull/796/head
Ronin0000 2021-08-31 17:10:29 -07:00 committed by GitHub
parent 470273a5e6
commit 5b26f339e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

17
apps/carcrazy/settings.js Normal file
View File

@ -0,0 +1,17 @@
// make sure to enclose the function in parentheses
(function(back) {
let settings = require('Storage').readJSON('app.json',1)||{};
function save(key, value) {
settings[key] = value;
require('Storage').write('app.json',settings);
}
const appMenu = {
'': {'title': 'App Settings'},
'< Back': back,
'High Score Reset': {
value: settings.monkeys||12,
onchange: (m) => {save('monkeys', m)}
}
};
E.showMenu(appMenu)
})