mirror of https://github.com/espruino/BangleApps
Merge pull request #2348 from hughbarney/master
SlopeClock++ README update and debug feature for PrimeTimeLatopull/2358/head
commit
64b002d1c1
|
@ -1,2 +1,3 @@
|
|||
0.01: first release
|
||||
0.02: added option to buzz on prime, with settings
|
||||
0.03: added option to debug settings and test fw 2.15.93 load speed ups
|
||||
|
|
|
@ -2,6 +2,7 @@ const h = g.getHeight();
|
|||
const w = g.getWidth();
|
||||
const SETTINGS_FILE = "primetimelato.json";
|
||||
let settings;
|
||||
let setStr = 'U';
|
||||
|
||||
Graphics.prototype.setFontLato = function(scale) {
|
||||
// Actual height 41 (43 - 3)
|
||||
|
@ -28,6 +29,22 @@ Graphics.prototype.setFontLatoSmall = function(scale) {
|
|||
function loadSettings() {
|
||||
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
|
||||
settings.buzz_on_prime = (settings.buzz_on_prime === undefined ? false : settings.buzz_on_prime);
|
||||
settings.debug = (settings.debug === undefined ? false : settings.debug);
|
||||
|
||||
switch(settings.buzz_on_prime) {
|
||||
case true:
|
||||
setStr = 'T';
|
||||
break;
|
||||
|
||||
case false:
|
||||
setStr = 'F';
|
||||
break;
|
||||
|
||||
case undefined:
|
||||
default:
|
||||
setStr = 'U';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// creates a list of prime factors of n and outputs them as a string, if n is prime outputs "Prime Time!"
|
||||
|
@ -69,9 +86,16 @@ function draw() {
|
|||
g.setColor(0,0,0);
|
||||
g.fillRect(Bangle.appRect);
|
||||
|
||||
g.setColor(100,100,100);
|
||||
|
||||
if (settings.debug) {
|
||||
g.setFontLatoSmall();
|
||||
g.setFontAlign(0, 0);
|
||||
g.drawString(setStr, w/2, h/4);
|
||||
}
|
||||
|
||||
g.setFontLato();
|
||||
g.setFontAlign(0, 0);
|
||||
g.setColor(100,100,100);
|
||||
g.drawString(timeStr, w/2, h/2);
|
||||
|
||||
g.setFontLatoSmall();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "primetimelato",
|
||||
"name": "Prime Time Lato Clock",
|
||||
"version": "0.02",
|
||||
"name": "Prime Time Lato",
|
||||
"version": "0.03",
|
||||
"type": "clock",
|
||||
"description": "A clock that tells you the primes of the time in the Lato font",
|
||||
"icon": "app.png",
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
// initialize with default settings...
|
||||
let s = {
|
||||
'buzz_on_prime': true
|
||||
'buzz_on_prime': true,
|
||||
'debug': false
|
||||
}
|
||||
|
||||
// ...and overwrite them with any saved values
|
||||
|
@ -29,6 +30,16 @@
|
|||
s.buzz_on_prime = v;
|
||||
save();
|
||||
},
|
||||
},
|
||||
|
||||
'Debug': {
|
||||
value: !!s.debug,
|
||||
onchange: v => {
|
||||
s.debug = v;
|
||||
save();
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
|
|
@ -6,3 +6,4 @@
|
|||
Allowed black/white background (as that can look nice too)
|
||||
0.05: Images in clkinfo are optional now
|
||||
0.06: Added support for locale based time
|
||||
0.07: README file update as UI interaction was not easy to understand
|
||||
|
|
|
@ -10,6 +10,8 @@ to change (top right or bottom left). It should change color showing
|
|||
it is selected.
|
||||
|
||||
* Swipe up or down to cycle through the info screens that can be displayed
|
||||
when you have finished tap again towards the centre of the screen to unselect.
|
||||
|
||||
* Swipe left or right to change the type of info screens displayed (by default
|
||||
there is only one type of data so this will have no effect)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "slopeclockpp",
|
||||
"name": "Slope Clock ++",
|
||||
"version":"0.06",
|
||||
"version":"0.07",
|
||||
"description": "A clock where hours and minutes are divided by a sloping line. When the minute changes, the numbers slide off the screen. This is a clone of the original Slope Clock which shows extra information and allows the colors to be selected.",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
|
|
Loading…
Reference in New Issue