mirror of https://github.com/espruino/BangleApps
Update golf-gps.js
parent
c8ce7539df
commit
d1cf0f47db
|
@ -17,6 +17,9 @@ var currentHole = 1,
|
||||||
score = Array(19).fill(0),
|
score = Array(19).fill(0),
|
||||||
playON = false;
|
playON = false;
|
||||||
|
|
||||||
|
var fileIndx;
|
||||||
|
var scoreFiles;
|
||||||
|
|
||||||
require("Font7x11Numeric7Seg").add(Graphics);
|
require("Font7x11Numeric7Seg").add(Graphics);
|
||||||
|
|
||||||
Graphics.prototype.setFontDroidSansMono52 = function() {
|
Graphics.prototype.setFontDroidSansMono52 = function() {
|
||||||
|
@ -106,7 +109,7 @@ function mainMenu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function browseScore() {
|
function browseScore() {
|
||||||
const scoreFiles = require("Storage").list(/^Scorecard-/);
|
scoreFiles = require("Storage").list(/^Scorecard-/);
|
||||||
if (scoreFiles.length === 0) {
|
if (scoreFiles.length === 0) {
|
||||||
E.showPrompt("No score file found.\n\nYou need to play at least a game.", {
|
E.showPrompt("No score file found.\n\nYou need to play at least a game.", {
|
||||||
title: `Error`,
|
title: `Error`,
|
||||||
|
@ -117,7 +120,9 @@ function browseScore() {
|
||||||
if (choice === 1) load();
|
if (choice === 1) load();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let fileIndx = scoreFiles.length - 1;
|
fileIndx = scoreFiles.length - 1;
|
||||||
|
browseFiles();
|
||||||
|
}
|
||||||
|
|
||||||
function browseFiles() {
|
function browseFiles() {
|
||||||
const browsefile = require("Storage").open(scoreFiles[fileIndx].substring(0, 18), "r");
|
const browsefile = require("Storage").open(scoreFiles[fileIndx].substring(0, 18), "r");
|
||||||
|
@ -136,8 +141,6 @@ function browseScore() {
|
||||||
browseFiles();
|
browseFiles();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
browseFiles();
|
|
||||||
}
|
|
||||||
|
|
||||||
function fixGPS() {
|
function fixGPS() {
|
||||||
Bangle.on('GPS', onGPS);
|
Bangle.on('GPS', onGPS);
|
||||||
|
|
Loading…
Reference in New Issue