1
0
Fork 0

Update golf-gps.js

master
jeonlab 2024-07-05 10:24:39 -04:00 committed by GitHub
parent c8ce7539df
commit d1cf0f47db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 20 deletions

View File

@ -17,6 +17,9 @@ var currentHole = 1,
score = Array(19).fill(0),
playON = false;
var fileIndx;
var scoreFiles;
require("Font7x11Numeric7Seg").add(Graphics);
Graphics.prototype.setFontDroidSansMono52 = function() {
@ -106,7 +109,7 @@ function mainMenu() {
}
function browseScore() {
const scoreFiles = require("Storage").list(/^Scorecard-/);
scoreFiles = require("Storage").list(/^Scorecard-/);
if (scoreFiles.length === 0) {
E.showPrompt("No score file found.\n\nYou need to play at least a game.", {
title: `Error`,
@ -117,9 +120,11 @@ function browseScore() {
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 l = browsefile.read(80);
@ -135,8 +140,6 @@ function browseScore() {
else if (choice === 3) load();
browseFiles();
});
}
browseFiles();
}
function fixGPS() {