Fix bug if image clock wasn't installed

master
Gordon Williams 2020-06-03 10:40:02 +01:00
parent 6dd3dfb33e
commit f1a65a213c
3 changed files with 3 additions and 12 deletions

View File

@ -1814,7 +1814,7 @@
"name": "Animated Clock",
"shortName":"Anim Clock",
"icon": "app.png",
"version":"0.01",
"version":"0.02",
"description": "An animated clock face using Mark Ferrari's amazing 8 bit game art and palette cycling: http://www.markferrari.com/art/8bit-game-art",
"tags": "clock,animated",
"type": "clock",

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Fix bug if image clock wasn't installed

View File

@ -24,16 +24,6 @@ var cgimg = {width:IW,height:IH,bpp:IBPP,transparent:0,buffer:cg.buffer};
var locale = require("locale");
var lastTime = "";
// store clock background image in bgimg (a file in flash memory)
var bgimg = require("Storage").read("imgclock.face.bg");
// if it doesn't exist, make it
function createBgImg() {
cg.drawImage(img,-IX,-IY,bgoptions);
require("Storage").write("imgclock.face.bg", cg.buffer);
bgimg = require("Storage").read("imgclock.face.bg");
}
if (!bgimg || !bgimg.length) createBgImg();
function drawClock() {
var t = new Date();
var hours = t.getHours();
@ -69,7 +59,7 @@ function drawClock() {
cg.drawString(date,IW*(inf.align+1)/2,IH-8);
}
}
function draw() {
var t = (new Date()).toString();
if (t!=lastTime) {