diff options
author | Alexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com> | 2016-09-23 18:31:48 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <ClusterM@users.noreply.github.com> | 2016-09-23 18:31:48 +0300 |
commit | 076cb61d30e85c65306288f0979f8cfeeac46efb (patch) | |
tree | a13375cea6969b1f9e5348ae5af3836785ef53c4 | |
parent | 4a066157c155b43eb58d741da5c14d8b036efb6a (diff) |
Diorite compatibility
38 files changed, 304 insertions, 255 deletions
diff --git a/appinfo.json b/appinfo.json deleted file mode 100644 index 500a3fd..0000000 --- a/appinfo.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "appKeys": { - "battery_request": 4, - "config_background": 7, - "config_character": 15, - "config_show_battery": 1, - "config_show_no_phone": 0, - "config_show_phone_battery": 6, - "config_show_weather": 8, - "config_temperature_units": 999, - "config_vibe": 2, - "config_vibe_hour": 14, - "weather_icon_id": 10, - "weather_request": 12, - "weather_temperature": 11 - }, - "capabilities": [ - "location", - "configurable" - ], - "companyName": "Cluster", - "longName": "Mario Time", - "projectType": "native", - "resources": { - "media": [ - { - "file": "images/watch_battery.png", - "name": "IMAGE_WATCH_BATTERY", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/luigi-jump.png", - "name": "IMAGE_LUIGI_JUMP", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/luigi-normal.png", - "name": "IMAGE_LUIGI_NORMAL", - "storageFormat": "png", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/mario_bg_day.png", - "name": "IMAGE_BACKGROUND_DAY", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/weather_few_clouds_night.png", - "name": "IMAGE_WEATHER_FEW_CLOUDS_NIGHT", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_rain_night.png", - "name": "IMAGE_WEATHER_RAIN_NIGHT", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_clear_sky_night.png", - "name": "IMAGE_WEATHER_CLEAR_SKY_NIGHT", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_unknown.png", - "name": "IMAGE_WEATHER_UNKNOWN", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_thunderstorm.png", - "name": "IMAGE_WEATHER_THUNDERSTORM", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_snow.png", - "name": "IMAGE_WEATHER_SNOW", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_shower_rain.png", - "name": "IMAGE_WEATHER_SHOWER_RAIN", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_scattered_clouds.png", - "name": "IMAGE_WEATHER_SCATTERED_CLOUDS", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_rain_day.png", - "name": "IMAGE_WEATHER_RAIN_DAY", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/mario-jump-bw.png", - "name": "IMAGE_MARIO_JUMP", - "type": "bitmap" - }, - { - "file": "images/mario-normal-bw.png", - "name": "IMAGE_MARIO_NORMAL", - "type": "bitmap" - }, - { - "file": "images/menuicon.png", - "menuIcon": true, - "name": "IMAGE_MENU_ICON", - "type": "bitmap" - }, - { - "file": "images/mario_bg_underground.png", - "name": "IMAGE_BACKGROUND_UNDERGROUND", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/mario_bg_castle.png", - "name": "IMAGE_BACKGROUND_CASTLE", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/mario_bg_night.png", - "name": "IMAGE_BACKGROUND_NIGHT", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "type": "bitmap" - }, - { - "file": "images/weather_mist.png", - "name": "IMAGE_WEATHER_MIST", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_few_clouds_day.png", - "name": "IMAGE_WEATHER_FEW_CLOUDS_DAY", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_clear_sky_day.png", - "name": "IMAGE_WEATHER_CLEAR_SKY_DAY", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/weather_broken_clouds.png", - "name": "IMAGE_WEATHER_BROKEN_CLOUDS", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/phone_battery.png", - "name": "IMAGE_PHONE_BATTERY", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/no_phone.png", - "name": "IMAGE_NO_PHONE", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/battery_charging.png", - "name": "IMAGE_BATTERY_CHARGING", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "file": "images/phone_battery_unknown.png", - "name": "IMAGE_PHONE_BATTERY_UNKNOWN", - "targetPlatforms": null, - "type": "bitmap" - }, - { - "characterRegex": "[,0-9A-Z]", - "file": "fonts/emulogic.ttf", - "name": "FONT_EMULOGIC_8", - "type": "font" - }, - { - "file": "images/mario_block_48_bw.png", - "name": "IMAGE_BLOCK", - "type": "bitmap" - }, - { - "characterRegex": "[0-9]", - "file": "fonts/Gamegirl.ttf", - "name": "FONT_GAMEGIRL_24", - "type": "font" - } - ] - }, - "sdkVersion": "3", - "shortName": "Mario Time", - "targetPlatforms": [ - "aplite", - "basalt", - "chalk" - ], - "uuid": "43caa750-2896-4f46-94dc-1adbd4bc1ff3", - "versionLabel": "3.32", - "watchapp": { - "watchface": true - } -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a50c8bc --- /dev/null +++ b/package.json @@ -0,0 +1,265 @@ +{ + "author": "Cluster", + "dependencies": {}, + "keywords": [], + "name": "mario-time", + "pebble": { + "capabilities": [ + "location", + "configurable" + ], + "displayName": "Mario Time", + "enableMultiJS": true, + "messageKeys": { + "battery_request": 4, + "config_background": 7, + "config_character": 15, + "config_show_battery": 1, + "config_show_no_phone": 0, + "config_show_phone_battery": 6, + "config_show_weather": 8, + "config_temperature_units": 999, + "config_vibe": 2, + "config_vibe_hour": 14, + "weather_icon_id": 10, + "weather_request": 12, + "weather_temperature": 11 + }, + "projectType": "native", + "resources": { + "media": [ + { + "file": "images/bowser-jump", + "name": "IMAGE_BOWSER_JUMP", + "targetPlatforms": [ + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/bowser-normal", + "name": "IMAGE_BOWSER_NORMAL", + "targetPlatforms": [ + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/watch_battery.png", + "name": "IMAGE_WATCH_BATTERY", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/luigi-jump.png", + "name": "IMAGE_LUIGI_JUMP", + "targetPlatforms": [ + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/luigi-normal.png", + "name": "IMAGE_LUIGI_NORMAL", + "storageFormat": "png", + "targetPlatforms": [ + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/mario_bg_day.png", + "name": "IMAGE_BACKGROUND_DAY", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk", + "diorite" + ], + "type": "bitmap" + }, + { + "file": "images/weather_few_clouds_night.png", + "name": "IMAGE_WEATHER_FEW_CLOUDS_NIGHT", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_rain_night.png", + "name": "IMAGE_WEATHER_RAIN_NIGHT", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_clear_sky_night.png", + "name": "IMAGE_WEATHER_CLEAR_SKY_NIGHT", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_unknown.png", + "name": "IMAGE_WEATHER_UNKNOWN", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_thunderstorm.png", + "name": "IMAGE_WEATHER_THUNDERSTORM", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_snow.png", + "name": "IMAGE_WEATHER_SNOW", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_shower_rain.png", + "name": "IMAGE_WEATHER_SHOWER_RAIN", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_scattered_clouds.png", + "name": "IMAGE_WEATHER_SCATTERED_CLOUDS", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_rain_day.png", + "name": "IMAGE_WEATHER_RAIN_DAY", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/mario-jump-bw.png", + "name": "IMAGE_MARIO_JUMP", + "type": "bitmap" + }, + { + "file": "images/mario-normal-bw.png", + "name": "IMAGE_MARIO_NORMAL", + "type": "bitmap" + }, + { + "file": "images/menuicon.png", + "menuIcon": true, + "name": "IMAGE_MENU_ICON", + "type": "bitmap" + }, + { + "file": "images/mario_bg_underground.png", + "name": "IMAGE_BACKGROUND_UNDERGROUND", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/mario_bg_castle.png", + "name": "IMAGE_BACKGROUND_CASTLE", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/mario_bg_night.png", + "name": "IMAGE_BACKGROUND_NIGHT", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk" + ], + "type": "bitmap" + }, + { + "file": "images/weather_mist.png", + "name": "IMAGE_WEATHER_MIST", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_few_clouds_day.png", + "name": "IMAGE_WEATHER_FEW_CLOUDS_DAY", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_clear_sky_day.png", + "name": "IMAGE_WEATHER_CLEAR_SKY_DAY", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/weather_broken_clouds.png", + "name": "IMAGE_WEATHER_BROKEN_CLOUDS", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/phone_battery.png", + "name": "IMAGE_PHONE_BATTERY", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/no_phone.png", + "name": "IMAGE_NO_PHONE", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/battery_charging.png", + "name": "IMAGE_BATTERY_CHARGING", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "file": "images/phone_battery_unknown.png", + "name": "IMAGE_PHONE_BATTERY_UNKNOWN", + "targetPlatforms": null, + "type": "bitmap" + }, + { + "characterRegex": "[,0-9A-Z]", + "file": "fonts/emulogic.ttf", + "name": "FONT_EMULOGIC_8", + "type": "font" + }, + { + "file": "images/mario_block_48_bw.png", + "name": "IMAGE_BLOCK", + "type": "bitmap" + }, + { + "characterRegex": "[0-9]", + "file": "fonts/Gamegirl.ttf", + "name": "FONT_GAMEGIRL_24", + "type": "font" + } + ] + }, + "sdkVersion": "3", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk", + "diorite" + ], + "uuid": "43caa750-2896-4f46-94dc-1adbd4bc1ff3", + "watchapp": { + "watchface": true + } + }, + "version": "3.34.0" +} diff --git a/resources/images/battery-charging~color.png b/resources/images/battery-charging~color.png Binary files differdeleted file mode 100644 index 3c91e15..0000000 --- a/resources/images/battery-charging~color.png +++ /dev/null diff --git a/resources/images/battery_charging.png b/resources/images/battery_charging.png Binary files differdeleted file mode 100644 index 3c91e15..0000000 --- a/resources/images/battery_charging.png +++ /dev/null diff --git a/resources/images/bowser-jump~color b/resources/images/bowser-jump~color Binary files differnew file mode 100644 index 0000000..4a35115 --- /dev/null +++ b/resources/images/bowser-jump~color diff --git a/resources/images/bowser-normal~color b/resources/images/bowser-normal~color Binary files differnew file mode 100644 index 0000000..cb609ee --- /dev/null +++ b/resources/images/bowser-normal~color diff --git a/resources/images/luigi-jump~bw.png b/resources/images/luigi-jump~bw.png Binary files differdeleted file mode 100644 index 8f34832..0000000 --- a/resources/images/luigi-jump~bw.png +++ /dev/null diff --git a/resources/images/luigi-normal~bw.png b/resources/images/luigi-normal~bw.png Binary files differdeleted file mode 100644 index 9153b66..0000000 --- a/resources/images/luigi-normal~bw.png +++ /dev/null diff --git a/resources/images/mario-jump~color.png b/resources/images/mario-jump~color.png Binary files differdeleted file mode 100644 index dcb8745..0000000 --- a/resources/images/mario-jump~color.png +++ /dev/null diff --git a/resources/images/mario-normal~color.png b/resources/images/mario-normal~color.png Binary files differdeleted file mode 100644 index 215affd..0000000 --- a/resources/images/mario-normal~color.png +++ /dev/null diff --git a/resources/images/mario_bg_castle_color~color.png b/resources/images/mario_bg_castle_color~color.png Binary files differdeleted file mode 100644 index cd33b3c..0000000 --- a/resources/images/mario_bg_castle_color~color.png +++ /dev/null diff --git a/resources/images/mario_bg_day_bw (2)~color.png b/resources/images/mario_bg_day_bw (2)~color.png Binary files differdeleted file mode 100644 index 499738a..0000000 --- a/resources/images/mario_bg_day_bw (2)~color.png +++ /dev/null diff --git a/resources/images/mario_bg_day_bw~color.png b/resources/images/mario_bg_day_bw~color.png Binary files differdeleted file mode 100644 index 1dd72d4..0000000 --- a/resources/images/mario_bg_day_bw~color.png +++ /dev/null diff --git a/resources/images/mario_bg_day~color.png b/resources/images/mario_bg_day~color.png Binary files differdeleted file mode 100644 index 499738a..0000000 --- a/resources/images/mario_bg_day~color.png +++ /dev/null diff --git a/resources/images/mario_bg_night_color~color.png b/resources/images/mario_bg_night_color~color.png Binary files differdeleted file mode 100644 index 874c797..0000000 --- a/resources/images/mario_bg_night_color~color.png +++ /dev/null diff --git a/resources/images/mario_bg_underground_color~color.png b/resources/images/mario_bg_underground_color~color.png Binary files differdeleted file mode 100644 index cbc61f2..0000000 --- a/resources/images/mario_bg_underground_color~color.png +++ /dev/null diff --git a/resources/images/no-phone~color.png b/resources/images/no-phone~color.png Binary files differdeleted file mode 100644 index 5feb1a8..0000000 --- a/resources/images/no-phone~color.png +++ /dev/null diff --git a/resources/images/no_phone.png b/resources/images/no_phone.png Binary files differdeleted file mode 100644 index 5feb1a8..0000000 --- a/resources/images/no_phone.png +++ /dev/null diff --git a/resources/images/phone_battery.png b/resources/images/phone_battery.png Binary files differdeleted file mode 100644 index 31f7300..0000000 --- a/resources/images/phone_battery.png +++ /dev/null diff --git a/resources/images/phone_battery_unknown.png b/resources/images/phone_battery_unknown.png Binary files differdeleted file mode 100644 index 84b71ae..0000000 --- a/resources/images/phone_battery_unknown.png +++ /dev/null diff --git a/resources/images/phone_icon~color.png b/resources/images/phone_icon~color.png Binary files differdeleted file mode 100644 index 31f7300..0000000 --- a/resources/images/phone_icon~color.png +++ /dev/null diff --git a/resources/images/watch_battery.png b/resources/images/watch_battery.png Binary files differdeleted file mode 100644 index bcdf0f9..0000000 --- a/resources/images/watch_battery.png +++ /dev/null diff --git a/resources/images/watch_icon~color.png b/resources/images/watch_icon~color.png Binary files differdeleted file mode 100644 index bcdf0f9..0000000 --- a/resources/images/watch_icon~color.png +++ /dev/null diff --git a/resources/images/weather_broken_clouds.png b/resources/images/weather_broken_clouds.png Binary files differdeleted file mode 100644 index a0f0475..0000000 --- a/resources/images/weather_broken_clouds.png +++ /dev/null diff --git a/resources/images/weather_clear_sky_day.png b/resources/images/weather_clear_sky_day.png Binary files differdeleted file mode 100644 index d4750ae..0000000 --- a/resources/images/weather_clear_sky_day.png +++ /dev/null diff --git a/resources/images/weather_clear_sky_night.png b/resources/images/weather_clear_sky_night.png Binary files differdeleted file mode 100644 index 8d3e85f..0000000 --- a/resources/images/weather_clear_sky_night.png +++ /dev/null diff --git a/resources/images/weather_few_clouds_day.png b/resources/images/weather_few_clouds_day.png Binary files differdeleted file mode 100644 index 129170e..0000000 --- a/resources/images/weather_few_clouds_day.png +++ /dev/null diff --git a/resources/images/weather_few_clouds_night.png b/resources/images/weather_few_clouds_night.png Binary files differdeleted file mode 100644 index fada714..0000000 --- a/resources/images/weather_few_clouds_night.png +++ /dev/null diff --git a/resources/images/weather_mist.png b/resources/images/weather_mist.png Binary files differdeleted file mode 100644 index f7bf175..0000000 --- a/resources/images/weather_mist.png +++ /dev/null diff --git a/resources/images/weather_rain_day.png b/resources/images/weather_rain_day.png Binary files differdeleted file mode 100644 index a4ee928..0000000 --- a/resources/images/weather_rain_day.png +++ /dev/null diff --git a/resources/images/weather_rain_night.png b/resources/images/weather_rain_night.png Binary files differdeleted file mode 100644 index fada714..0000000 --- a/resources/images/weather_rain_night.png +++ /dev/null diff --git a/resources/images/weather_scattered_clouds.png b/resources/images/weather_scattered_clouds.png Binary files differdeleted file mode 100644 index 3d7302e..0000000 --- a/resources/images/weather_scattered_clouds.png +++ /dev/null diff --git a/resources/images/weather_shower_rain.png b/resources/images/weather_shower_rain.png Binary files differdeleted file mode 100644 index b30be7a..0000000 --- a/resources/images/weather_shower_rain.png +++ /dev/null diff --git a/resources/images/weather_snow.png b/resources/images/weather_snow.png Binary files differdeleted file mode 100644 index 2f4e292..0000000 --- a/resources/images/weather_snow.png +++ /dev/null diff --git a/resources/images/weather_thunderstorm.png b/resources/images/weather_thunderstorm.png Binary files differdeleted file mode 100644 index 6b29cb6..0000000 --- a/resources/images/weather_thunderstorm.png +++ /dev/null diff --git a/resources/images/weather_unknown.png b/resources/images/weather_unknown.png Binary files differdeleted file mode 100644 index 90b1763..0000000 --- a/resources/images/weather_unknown.png +++ /dev/null diff --git a/src/pebble-mario.c b/src/c/pebble-mario.c index 8bfe04e..a34c950 100644 --- a/src/pebble-mario.c +++ b/src/c/pebble-mario.c @@ -110,8 +110,8 @@ static char digits[10][15] = {{1,1,1,1,0,1,1,0,1,1,0,1,1,1,1},{0,0,1,0,0,1,0,0,1 #endif #define GROUND_HEIGHT 26 -#define WEATHER_MAX_AGE 60*60*5 -#define WEATHER_UPDATE_INTERVAL 60*60*3 +#define WEATHER_MAX_AGE 60*60*3 +#define WEATHER_UPDATE_INTERVAL 60*60*1 #define MSG_SHOW_NO_PHONE 0 #define MSG_SHOW_BATTERY 1 @@ -167,6 +167,11 @@ static void request_all() } } +static void request_all_on_connect(void* data) +{ + request_all(); +} + static void request_all_on_start(void* data) { tick_timer_service_subscribe(MARIO_TIME_UNIT, handle_tick); @@ -273,7 +278,8 @@ void mario_update_callback(Layer *layer, GContext *ctx) GBitmap *bmp; bmp = mario_is_down ? mario_normal_bmp : mario_jump_bmp; - destination = GRect(0, 0, gbitmap_get_bounds(bmp).size.w, gbitmap_get_bounds(bmp).size.h); + GRect bounds = gbitmap_get_bounds(bmp); + destination = GRect(40-bounds.size.w/2, 80-bounds.size.h, bounds.size.w, bounds.size.h); graphics_context_set_compositing_mode(ctx, GCompOpSet); graphics_draw_bitmap_in_rect(ctx, bmp, destination); @@ -328,12 +334,12 @@ void bluetooth_connection_callback(bool connected) VibePattern pat = { .durations = segments, .num_segments = ARRAY_LENGTH(segments), - }; + }; vibes_enqueue_custom_pattern(pat); } if (connected) - request_all(); + app_timer_register(5000, request_all_on_connect, NULL); else phone_battery_level = -1; layer_mark_dirty(phone_battery_layer); } @@ -451,12 +457,27 @@ void update_character() gbitmap_destroy(mario_normal_bmp); if (mario_jump_bmp) gbitmap_destroy(mario_jump_bmp); - switch (config_character) + + int character = config_character; + + // 1st April joke :) + time_t t; + time(&t); + struct tm * tick_time = localtime(&t); + if (tick_time->tm_year == 116 && tick_time->tm_mon == 3 && tick_time->tm_mday == 1) character = 2; + + switch (character) { +#if PBL_COLOR case 1: mario_normal_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_LUIGI_NORMAL); mario_jump_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_LUIGI_JUMP); break; + case 2: + mario_normal_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BOWSER_NORMAL); + mario_jump_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BOWSER_JUMP); + break; +#endif default: mario_normal_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_MARIO_NORMAL); mario_jump_bmp = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_MARIO_JUMP); @@ -535,6 +556,13 @@ void load_bitmaps() void load_weather_icon() { + int weather_age = time(NULL)-weather_last_update; + if ((weather_age > WEATHER_MAX_AGE) && (weather_icon_id >= 0)) + { + weather_icon_id = -1; + weather_temperature = -100; + } + #ifdef DEMO weather_icon_id = 9; weather_temperature = -23; @@ -728,11 +756,11 @@ void handle_init() blocks_up_rect = GRect(22+offset_x, -10, BLOCK_SIZE*2, BLOCK_SIZE + 4); #if PBL_COLOR - mario_down_rect = GRect(32 + 15 + offset_x, 168-GROUND_HEIGHT-76 + 28 + 10 + offset_y, 80, 80); - mario_up_rect = GRect(32 + 15 + offset_x, BLOCK_SIZE + 4 + 10 + offset_y, 80, 80); + mario_down_rect = GRect(32 + offset_x, 168 - GROUND_HEIGHT-76 + 28 + 10 + offset_y - 32, 80, 80); + mario_up_rect = GRect(32 + offset_x, BLOCK_SIZE + 4 + 10 + offset_y - 32, 80, 80); blocks_down_rect = GRect(22 + offset_x, 25 + offset_y, BLOCK_SIZE*2, BLOCK_SIZE + 4); #else - mario_down_rect = GRect(32, 168-GROUND_HEIGHT-80 + 10, 80, 80); + mario_down_rect = GRect(32, 168 - GROUND_HEIGHT - 80 + 10, 80, 80); mario_up_rect = GRect(32, BLOCK_SIZE + 4, 80, 80); blocks_down_rect = GRect(22, 16, BLOCK_SIZE*2, BLOCK_SIZE + 4); #endif @@ -784,7 +812,6 @@ void handle_init() accel_tap_service_subscribe(accel_tap_handler); app_timer_register(1000, request_all_on_start, NULL); - //request_all(); load_bitmaps(); load_weather_icon(); @@ -985,8 +1012,6 @@ void handle_tick(struct tm *tick_time, TimeUnits units_changed) } if ((weather_age > WEATHER_MAX_AGE) && (weather_icon_id >= 0)) { - weather_icon_id = -1; - weather_temperature = -100; load_weather_icon(); if (config_show_weather) layer_mark_dirty(phone_battery_layer); @@ -995,6 +1020,7 @@ void handle_tick(struct tm *tick_time, TimeUnits units_changed) if (units_changed & HOUR_UNIT) { need_update_background = 1; + update_character(); // for 1st April if (config_vibe_hour) { static const uint32_t const segments[] = { 50, 100, 50, 100, 50, 100, 50, 100, 50 }; diff --git a/src/js/pebble-js-app.js b/src/pkjs/app.js index 0b0823e..6d32da7 100644 --- a/src/js/pebble-js-app.js +++ b/src/pkjs/app.js @@ -84,7 +84,7 @@ Pebble.addEventListener("showConfiguration", function() { var watch = null; } var platform = "&platform=" + ((watch != null) ? watch.platform : "unknown"); - var config_version = "&v=3"; + var config_version = "&v=4"; console.log("Showing configuration"); Pebble.openURL("http://clusterrr.com/pebble_configs/mario_w.php" + cfg + platform + config_version); }); |