Skip to content

Commit

Permalink
Merge branch 'gipy-fix' of https://github.com/atjn/BangleApps
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Aug 19, 2024
2 parents c873bf3 + d40a010 commit f9663e3
Show file tree
Hide file tree
Showing 62 changed files with 1,383 additions and 220 deletions.
Binary file added apps/8ball/8ball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/8ball/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.01: New App!
1 change: 1 addition & 0 deletions apps/8ball/app-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 92 additions & 0 deletions apps/8ball/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
var keyboard = "textinput";
var Name = "";
Bangle.setLCDTimeout(0);
var menuOpen = 1;
var answers = new Array("no", "yes","WHAT????","What do you think", "That was a bad question", "YES!!!", "NOOOOO!!", "nope","100%","yup","why should I answer that?","think for yourself","ask again later, I'm busy", "what Was that horrible question","how dare you?","you wanted to hear yes? okay, yes", "Don't get angry when I say no","you are 100% wrong","totally, for sure","hmmm... I'll ponder it and get back to you later","wow, you really have a lot of questions", "NOPE","is the sky blue, hmmm...","I don't have time to answer","How many more questions before you change my name?","theres this thing called wikipedia","hmm... I don't seem to be able to reach the internet right now","if you phrase it like that, yes","Huh, never thought so hard in my life","The winds of time say no");
var consonants = new Array("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z");
var vowels = new Array("a","e","i","o","u");
try {keyboard = require(keyboard);} catch(e) {keyboard = null;}
function generateName()
{
Name = "";
var nameLength = Math.round(Math.random()*5);
for(var i = 0; i < nameLength; i++){
var cosonant = consonants[Math.round(Math.random()*consonants.length/2)];
var vowel = vowels[Math.round(Math.random()*vowels.length/2)];
Name = Name + cosonant + vowel;
if(Name == "")
{
generateName();
}
}
}
generateName();
function menu()
{
g.clear();
E.showMenu();
menuOpen = 1;
E.showMenu({
"" : { title : Name },
"< Back" : () => menu(),
"Start" : () => {
E.showMenu();
g.clear();
menuOpen = 0;
Drawtext("ask " + Name + " a yes or no question");
},
"regenerate name" : () => {
menu();
generateName();
},
"show answers" : () => {
var menu = new Array([]);
for(var i = 0; i < answers.length; i++){
menu.push({title : answers[i]});
}
E.showMenu(menu);


},

"Add answer" : () => {
E.showMenu();
keyboard.input({}).then(result => {if(result != ""){answers.push(result);} menu();});
},
"Edit name" : () => {
E.showMenu();
keyboard.input({}).then(result => {if(result != ""){Name = result;} menu();});

},
"Exit" : () => load(),
});
}
menu();

var answer;
function Drawtext(text)
{
g.clear();
g.setFont("Vector", 20);
g.drawString(g.wrapString(text, g.getWidth(), -20).join("\n"));
}
function WriteAnswer()
{
if (menuOpen == 0)
{
var randomnumber = Math.round(Math.random()*answers.length);
answer = answers[randomnumber];
Drawtext(answer);
setTimeout(function() {
Drawtext("ask " + Name + " a yes or no question");
}, 3000);

}

}
setWatch(function() {
menu();

}, (process.env.HWVERSION==2) ? BTN1 : BTN2, {repeat:true, edge:"falling"});

Bangle.on('touch', function(button, xy) { WriteAnswer(); });
19 changes: 19 additions & 0 deletions apps/8ball/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ "id": "8ball",
"name": "Magic 8 ball",
"shortName":"8ball",
"icon": "8ball.png",
"version":"0.01",
"screenshots": [
{"url":"screenshot.png"},
{"url":"screenshot-1.png"},
{"url":"screenshot-2.png"}
],
"allow_emulator": true,
"description": "A very sarcastic magic 8ball",
"tags": "game",
"supports": ["BANGLEJS2"],
"storage": [
{"name":"8ball.app.js","url":"app.js"},
{"name":"8ball.img","url":"app-icon.js","evaluate":true}
]
}
Binary file added apps/8ball/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/8ball/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/8ball/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/boxclk/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0.03: Allows showing the month in short or long format by setting `"shortMonth"` to true or false
0.04: Improves touchscreen drag handling for background apps such as Pattern Launcher
0.05: Fixes step count not resetting after a new day starts
0.06 Added clockbackground app functionality
16 changes: 3 additions & 13 deletions apps/boxclk/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* ---------------------------------------------------------------
*/

let background = require("clockbg");
let storage = require("Storage");
let locale = require("locale");
let widgets = require("widget_utils");
let date = new Date();
let bgImage;
let configNumber = (storage.readJSON("boxclk.json", 1) || {}).selectedConfig || 0;
let fileName = 'boxclk' + (configNumber > 0 ? `-${configNumber}` : '') + '.json';
// Add a condition to check if the file exists, if it does not, default to 'boxclk.json'
Expand Down Expand Up @@ -71,14 +71,6 @@
* ---------------------------------------------------------------
*/

for (let key in boxesConfig) {
if (key === 'bg' && boxesConfig[key].img) {
bgImage = storage.read(boxesConfig[key].img);
} else if (key !== 'selectedConfig') {
boxes[key] = Object.assign({}, boxesConfig[key]);
}
}

let boxKeys = Object.keys(boxes);

boxKeys.forEach((key) => {
Expand Down Expand Up @@ -224,9 +216,7 @@
return function(boxes) {
date = new Date();
g.clear();
if (bgImage) {
g.drawImage(bgImage, 0, 0);
}
background.fillRect(Bangle.appRect);
if (boxes.time) {
boxes.time.string = modString(boxes.time, locale.time(date, isBool(boxes.time.short, true) ? 1 : 0));
updatePerMinute = isBool(boxes.time.short, true);
Expand Down Expand Up @@ -412,4 +402,4 @@
widgets.swipeOn();
modSetColor();
setup();
}
}
Binary file removed apps/boxclk/boxclk.space.img
Binary file not shown.
1 change: 1 addition & 0 deletions apps/boxclk/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.05",
"description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background",
"icon": "app.png",
"dependencies" : { "clockbg":"module" },
"screenshots": [
{"url":"screenshot.png"},
{"url":"screenshot-1.png"},
Expand Down
1 change: 1 addition & 0 deletions apps/dedreckon/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.01: attempt to import
20 changes: 20 additions & 0 deletions apps/dedreckon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ded Reckon

Dead Reckoning using compass and step counter.

This allows logging track using "dead reckoning" -- that's logging
angles from compass and distances from step counter. You need to mark
turns, and point watch to direction of the turn. Simultaneously, it
tries to log positions using GPS. You can use it to calibrate your
step length by comparing GPS and step counter data. It can also get
pretty accurate recording of track walked in right circumstances.

Tap bottom part of the screen to select display (text or map for
now). Point watch to new direction, then tap top left part of screen
to indicate a turn.

Map shows blue line for track from dead reckonging, and green line for
track from GPS.

You probably want magnav installed (and calibrated) for useful
results, as it provides library with better compass.
1 change: 1 addition & 0 deletions apps/dedreckon/app-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added apps/dedreckon/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f9663e3

Please sign in to comment.