Don't change bar colors till doors are closed
This commit is contained in:
1 parent
2c6f189ebe
commit
9269ff738d
1 file changed
+8
-5
+8
-5
@@ -114,7 +114,8 @@ static GRect s_top_door_starting_grect = GRect(0, -(PBL_DISPLAY_HEIGHT / 2), PBL
|
|||||||
static GRect s_top_door_target_grect = GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
static GRect s_top_door_target_grect = GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
||||||
static GRect s_bottom_door_starting_grect = GRect(0, PBL_DISPLAY_HEIGHT * (3 / 2), PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
static GRect s_bottom_door_starting_grect = GRect(0, PBL_DISPLAY_HEIGHT * (3 / 2), PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
||||||
static GRect s_bottom_door_target_grect = GRect(0, PBL_DISPLAY_HEIGHT / 2, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
static GRect s_bottom_door_target_grect = GRect(0, PBL_DISPLAY_HEIGHT / 2, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT / 2);
|
||||||
static bool s_door_correct = true;
|
static bool s_door_correct;
|
||||||
|
static bool s_bar_correct;
|
||||||
static Animation *s_door_anim;
|
static Animation *s_door_anim;
|
||||||
|
|
||||||
// alarm drop menu options
|
// alarm drop menu options
|
||||||
@@ -287,12 +288,12 @@ static bool schedule_alarm(WakeupReason schedule_reason) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void top_bar_layer_update_proc(Layer *layer, GContext *ctx) {
|
static void top_bar_layer_update_proc(Layer *layer, GContext *ctx) {
|
||||||
graphics_context_set_fill_color(ctx, s_top_door_layer == NULL ? COLOR_PRIMARY : (s_door_correct ? COLOR_PRIMARY : COLOR_FAIL));
|
graphics_context_set_fill_color(ctx, s_top_door_layer == NULL ? COLOR_PRIMARY : (s_bar_correct ? COLOR_PRIMARY : COLOR_FAIL));
|
||||||
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
|
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bottom_bar_layer_update_proc(Layer *layer, GContext *ctx) {
|
static void bottom_bar_layer_update_proc(Layer *layer, GContext *ctx) {
|
||||||
graphics_context_set_fill_color(ctx, (s_top_door_layer == NULL ? (s_highlight_pos == 2 ? COLOR_SETTER_HIGHLIGHT : COLOR_PRIMARY) : (s_door_correct ? COLOR_PRIMARY : COLOR_FAIL)));
|
graphics_context_set_fill_color(ctx, (s_top_door_layer == NULL ? (s_highlight_pos == 2 ? COLOR_SETTER_HIGHLIGHT : COLOR_PRIMARY) : (s_bar_correct ? COLOR_PRIMARY : COLOR_FAIL)));
|
||||||
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
|
graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,6 +527,7 @@ static void door_closed_animation_stopped_handler(Animation *a, bool finished, v
|
|||||||
s_current_triangle_num--;
|
s_current_triangle_num--;
|
||||||
right_triangle_layer_regen(s_triangle_layer);
|
right_triangle_layer_regen(s_triangle_layer);
|
||||||
update_for_new_triangle();
|
update_for_new_triangle();
|
||||||
|
s_bar_correct = s_door_correct;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void door_animation_stopped_handler(Animation *a, bool finished, void *ctx) {
|
static void door_animation_stopped_handler(Animation *a, bool finished, void *ctx) {
|
||||||
@@ -781,6 +783,7 @@ static void alarm_window_load() {
|
|||||||
layer_add_child(window_layer, s_graph_layer);
|
layer_add_child(window_layer, s_graph_layer);
|
||||||
|
|
||||||
// top&bottom bars
|
// top&bottom bars
|
||||||
|
s_bar_correct = true;
|
||||||
add_bar_layers_to_window(window_layer, true);
|
add_bar_layers_to_window(window_layer, true);
|
||||||
|
|
||||||
// theta text
|
// theta text
|
||||||
@@ -911,6 +914,7 @@ static void alarm_window_load() {
|
|||||||
// door layers
|
// door layers
|
||||||
s_top_door_layer = layer_create(s_top_door_starting_grect);
|
s_top_door_layer = layer_create(s_top_door_starting_grect);
|
||||||
s_bottom_door_layer = layer_create(s_bottom_door_starting_grect);
|
s_bottom_door_layer = layer_create(s_bottom_door_starting_grect);
|
||||||
|
s_door_correct = true;
|
||||||
layer_add_child(window_layer, s_top_door_layer);
|
layer_add_child(window_layer, s_top_door_layer);
|
||||||
layer_add_child(window_layer, s_bottom_door_layer);
|
layer_add_child(window_layer, s_bottom_door_layer);
|
||||||
|
|
||||||
@@ -938,8 +942,7 @@ static void alarm_window_unload() {
|
|||||||
}
|
}
|
||||||
layer_destroy(s_bottom_door_layer);
|
layer_destroy(s_bottom_door_layer);
|
||||||
layer_destroy(s_top_door_layer);
|
layer_destroy(s_top_door_layer);
|
||||||
s_bottom_door_layer = NULL; // checked to determine if in alarm or setter
|
s_top_door_layer = NULL; // checked to determine if in alarm or setter
|
||||||
s_top_door_layer = NULL;
|
|
||||||
text_layer_destroy(s_progress_txt_layer);
|
text_layer_destroy(s_progress_txt_layer);
|
||||||
text_layer_destroy(s_countdown_txt_layer);
|
text_layer_destroy(s_countdown_txt_layer);
|
||||||
window_destroy(s_drop_window);
|
window_destroy(s_drop_window);
|
||||||
|
|||||||
Reference in new issue
Block a user