Merge pull request #2348 from hughbarney/master

SlopeClock++ README update and debug feature for PrimeTimeLato
pull/2358/head
Gordon Williams 2022-12-05 10:11:32 +00:00 committed by GitHub
commit 64b002d1c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 6 deletions

View File

@ -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

View File

@ -2,7 +2,8 @@ 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)
this.setFontCustom(
@ -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();

View File

@ -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",

View File

@ -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();
},
}
})
})

View File

@ -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

View File

@ -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)

View File

@ -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"}],