Commit d9434724 authored by Chris's avatar Chris
Browse files

fixed option enablement logic for scoring menu

parent a389a044
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -227,19 +227,19 @@ void hold_dice_with_menu(struct die_st *dice, unsigned int num_dice) {

char *get_player_score_selection_with_menu(struct scorecard_st *scorecard) {
    const menu_item scoring_menu[] = {
            {.title = "aces", .command = "aces", .multi_selected = 0, .enabled = scorecard->aces != SCORE_UNSCORED},
            {.title = "twos", .command = "twos", .multi_selected = 0, .enabled = scorecard->twos != SCORE_UNSCORED},
            {.title = "threes", .command = "threes", .multi_selected = 0, .enabled = scorecard->threes != SCORE_UNSCORED},
            {.title = "fours", .command = "fours", .multi_selected = 0, .enabled = scorecard->fours != SCORE_UNSCORED},
            {.title = "fives", .command = "fives", .multi_selected = 0, .enabled = scorecard->fives != SCORE_UNSCORED},
            {.title = "sixes", .command = "sixes", .multi_selected = 0, .enabled = scorecard->sixes != SCORE_UNSCORED},
            {.title = "three of a kind", .command = "three_of_a_kind", .multi_selected = 0, .enabled = scorecard->three_of_a_kind != SCORE_UNSCORED},
            {.title = "four of a kind", .command = "four_of_a_kind", .multi_selected = 0, .enabled = scorecard->four_of_a_kind != SCORE_UNSCORED},
            {.title = "small straight", .command = "small_straight", .multi_selected = 0, .enabled = scorecard->small_straight != SCORE_UNSCORED},
            {.title = "large straight", .command = "large_straight", .multi_selected = 0, .enabled = scorecard->large_straight != SCORE_UNSCORED},
            {.title = "full house", .command = "full_house", .multi_selected = 0, .enabled = scorecard->full_house != SCORE_UNSCORED},
            {.title = "yahtc", .command = "yahtc", .multi_selected = 0, .enabled = scorecard->yahtc != SCORE_UNSCORED},
            {.title = "chance", .command = "chance", .multi_selected = 0, .enabled = scorecard->chance != SCORE_UNSCORED},
            {.title = "aces", .command = "aces", .multi_selected = 0, .enabled = scorecard->aces == SCORE_UNSCORED},
            {.title = "twos", .command = "twos", .multi_selected = 0, .enabled = scorecard->twos == SCORE_UNSCORED},
            {.title = "threes", .command = "threes", .multi_selected = 0, .enabled = scorecard->threes == SCORE_UNSCORED},
            {.title = "fours", .command = "fours", .multi_selected = 0, .enabled = scorecard->fours == SCORE_UNSCORED},
            {.title = "fives", .command = "fives", .multi_selected = 0, .enabled = scorecard->fives == SCORE_UNSCORED},
            {.title = "sixes", .command = "sixes", .multi_selected = 0, .enabled = scorecard->sixes == SCORE_UNSCORED},
            {.title = "three of a kind", .command = "three_of_a_kind", .multi_selected = 0, .enabled = scorecard->three_of_a_kind == SCORE_UNSCORED},
            {.title = "four of a kind", .command = "four_of_a_kind", .multi_selected = 0, .enabled = scorecard->four_of_a_kind == SCORE_UNSCORED},
            {.title = "small straight", .command = "small_straight", .multi_selected = 0, .enabled = scorecard->small_straight == SCORE_UNSCORED},
            {.title = "large straight", .command = "large_straight", .multi_selected = 0, .enabled = scorecard->large_straight == SCORE_UNSCORED},
            {.title = "full house", .command = "full_house", .multi_selected = 0, .enabled = scorecard->full_house == SCORE_UNSCORED},
            {.title = "yahtc", .command = "yahtc", .multi_selected = 0, .enabled = scorecard->yahtc == SCORE_UNSCORED},
            {.title = "chance", .command = "chance", .multi_selected = 0, .enabled = scorecard->chance == SCORE_UNSCORED},
    };
    unsigned int num_menu_items = sizeof(scoring_menu) / sizeof(menu_item);
    return menu_prompt(scoring_menu, num_menu_items);