LAP indicator now dispalys on all screens

This commit is contained in:
David Volovskiy 2024-08-25 12:23:35 -04:00
parent 733318c036
commit c87e814140

View File

@ -166,8 +166,8 @@ static bool check_word(wordle_state_t *state) {
return false;
}
static void show_skip_wrong_letter_indicator(bool skipping, WordleScreen curr_screen) {
if (skipping && curr_screen <= SCREEN_CONTINUE)
static void show_skip_wrong_letter_indicator(bool skipping) {
if (skipping)
watch_set_indicator(WATCH_INDICATOR_LAP);
else
watch_clear_indicator(WATCH_INDICATOR_LAP);
@ -192,7 +192,6 @@ static void display_attempt(uint8_t attempt) {
static void display_playing(wordle_state_t *state) {
state->curr_screen = SCREEN_PLAYING;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
display_attempt(state->attempt);
display_all_letters(state);
}
@ -235,7 +234,6 @@ static void reset_board(wordle_state_t *state) {
static void display_title(wordle_state_t *state) {
state->curr_screen = SCREEN_TITLE;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
watch_display_string("WO WordLE", 0);
}
@ -246,7 +244,6 @@ static void display_continue_result(bool continuing) {
static void display_continue(wordle_state_t *state) {
state->curr_screen = SCREEN_CONTINUE;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
watch_display_string("Cont ", 4);
display_continue_result(state->continuing);
}
@ -255,7 +252,6 @@ static void display_continue(wordle_state_t *state) {
static void display_streak(wordle_state_t *state) {
char buf[12];
state->curr_screen = SCREEN_STREAK;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
#if WORDLE_USE_DAILY_STREAK
if (state->streak > 99)
sprintf(buf, "WO St--dy");
@ -271,7 +267,6 @@ static void display_streak(wordle_state_t *state) {
#if WORDLE_USE_DAILY_STREAK
static void display_wait(wordle_state_t *state) {
state->curr_screen = SCREEN_WAIT;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
if (state->streak < 40) {
char buf[13];
sprintf(buf,"WO%2d WaIt ", state->streak);
@ -291,7 +286,6 @@ static uint32_t get_day_unix_time(void) {
static void display_lose(wordle_state_t *state, uint8_t subsecond) {
char buf[WORDLE_LENGTH + 6];
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
sprintf(buf," L %s", subsecond % 2 ? _valid_words[state->curr_answer] : " ");
watch_display_string(buf, 0);
}
@ -299,7 +293,6 @@ static void display_lose(wordle_state_t *state, uint8_t subsecond) {
static void display_win(wordle_state_t *state, uint8_t subsecond) {
(void) state;
char buf[13];
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
sprintf(buf," W %s ", subsecond % 2 ? "NICE" : "JOb ");
watch_display_string(buf, 0);
}
@ -334,7 +327,6 @@ static void display_result(wordle_state_t *state, uint8_t subsecond) {
break;
}
}
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
watch_display_string(buf, 5);
}
@ -497,6 +489,7 @@ void wordle_face_activate(movement_settings_t *settings, void *context) {
state->position = get_first_pos(state->word_elements_result);
}
movement_request_tick_frequency(2);
show_skip_wrong_letter_indicator(state->skip_wrong_letter);
display_title(state);
}
@ -535,7 +528,7 @@ bool wordle_face_loop(movement_event_t event, movement_settings_t *settings, voi
case EVENT_LIGHT_LONG_PRESS:
if (state->curr_screen <= SCREEN_CONTINUE) {
state->skip_wrong_letter = !state->skip_wrong_letter;
show_skip_wrong_letter_indicator(state->skip_wrong_letter, state->curr_screen);
show_skip_wrong_letter_indicator(state->skip_wrong_letter);
}
if (state->curr_screen != SCREEN_PLAYING) break;
get_prev_letter(state->position, state->word_elements, state->known_wrong_letters, state->skip_wrong_letter);