source/client/LiverpoolButtons.py
def ButtonDisplay(hand_view):
    """ This updates draw pile and action buttons. It is called in HandView.update each render cycle. 

    It also creates customized buttons for each round of Liverpool (might also be eventually used by
    other shared_board game.  Must wait to create until all players hit OK else you won't have created
    buttons for players who join afterwards.
    """

    if hand_view.need_updated_buttons and not hand_view.controller._state.round == -1:
        hand_view.RuleSetsButtons.newRound(hand_view, hand_view.Meld_Threshold[hand_view.round_index])
        hand_view.need_updated_buttons = False
    loc_xy = (hand_view.draw_pile.x, hand_view.draw_pile.y)
    hand_view.draw_pile.draw(hand_view.display, loc_xy, hand_view.draw_pile.outline_color)
    # update discard info and redraw
    discard_info = hand_view.controller.getDiscardInfo()
    hand_view.top_discard = discard_info[0]
    hand_view.pickup_pile_sz = discard_info[1]
    if hand_view.pickup_pile_sz > 0:
        # pickup_pile needs new clickable image each time any player discards or picks up the pile.
        # Next few lines insure pickup_pile image is up to date.
        hand_view.top_discard_wrapped = UICardWrapper(hand_view.top_discard, (100, 25), UIC.scale)
        hand_view.pickup_pile = hand_view.top_discard_wrapped.img_clickable
        loc_xy = (hand_view.pickup_pile.x, hand_view.pickup_pile.y)
        # UICardWrapper sets outline color to no outline, next line resets outline to proper value.
        hand_view.pickup_pile.outline_color = hand_view.pickup_pile_outline
        hand_view.pickup_pile.draw(hand_view.display, loc_xy, hand_view.pickup_pile.outline_color)
        hand_view.labelMedium(str(hand_view.pickup_pile_sz), 150, 35)
    if hand_view.controller._state.round == -1:
        hand_view.ready_yes_btn.draw(hand_view.display, hand_view.ready_yes_btn.outline_color)
        hand_view.ready_no_btn.draw(hand_view.display, hand_view.ready_no_btn.outline_color)
        hand_view.need_updated_button = True # flags that will need to update assign buttons.
    hand_view.sort_status_btn.draw(hand_view.display, hand_view.sort_status_btn.outline_color)
    hand_view.sort_suit_al_btn.draw(hand_view.display, hand_view.sort_suit_al_btn.outline_color)
    hand_view.sort_al_btn.draw(hand_view.display, hand_view.sort_al_btn.outline_color)
    hand_view.sort_suit_ah_btn.draw(hand_view.display, hand_view.sort_suit_ah_btn.outline_color)
    hand_view.sort_ah_btn.draw(hand_view.display, hand_view.sort_ah_btn.outline_color)
    if not hand_view.need_updated_buttons:
        for idx in range(hand_view.num_players):
            for jdx in range(hand_view.buttons_per_player):
                prepare_card_btn = hand_view.assign_cards_btns[idx][jdx]
                prepare_card_btn.draw(hand_view.display, prepare_card_btn.outline_color)
    hand_view.clear_prepared_cards_btn.draw(hand_view.display, hand_view.clear_prepared_cards_btn.outline_color)
    hand_view.clear_selected_cards_btn.draw(hand_view.display, hand_view.clear_selected_cards_btn.outline_color)
    hand_view.play_prepared_cards_btn.draw(hand_view.display, hand_view.play_prepared_cards_btn.outline_color)
    hand_view.discard_action_btn.draw(hand_view.display, hand_view.discard_action_btn.outline_color)
    hand_view.heart_btn.draw(hand_view.display, hand_view.heart_btn.outline_color)
    return
 This updates draw pile and action buttons. It is called in HandView.update each render cycle. 

    It also creates customized buttons for each round of Liverpool (might also be eventually used by
    other shared_board game.  Must wait to create until all players hit OK else you won't have created
    buttons for players who join afterwards.
    
This updates draw pile and action buttons. It is called in HandView.update each render cycle.
It also creates customized buttons for each round of Liverpool (might also be eventually used by
other shared_board game.  Must wait to create until all players hit OK else you won't have created
buttons for players who join afterwards.
This updates draw pile and action buttons . It is called in HandView . update each render cycle . It also creates customized buttons for each round of Liverpool ( might also be eventually used by other shared_board game . Must wait to create until all players hit OK else you won ' t have created buttons for players who join afterwards .
def ButtonDisplay(hand_view):
    if hand_view.need_updated_buttons and not hand_view.controller._state.round == -1:
        hand_view.RuleSetsButtons.newRound(hand_view, hand_view.Meld_Threshold[hand_view.round_index])
        hand_view.need_updated_buttons = False
    loc_xy = (hand_view.draw_pile.x, hand_view.draw_pile.y)
    hand_view.draw_pile.draw(hand_view.display, loc_xy, hand_view.draw_pile.outline_color)
    discard_info = hand_view.controller.getDiscardInfo()
    hand_view.top_discard = discard_info[0]
    hand_view.pickup_pile_sz = discard_info[1]
    if hand_view.pickup_pile_sz > 0:
        hand_view.top_discard_wrapped = UICardWrapper(hand_view.top_discard, (100, 25), UIC.scale)
        hand_view.pickup_pile = hand_view.top_discard_wrapped.img_clickable
        loc_xy = (hand_view.pickup_pile.x, hand_view.pickup_pile.y)
        hand_view.pickup_pile.outline_color = hand_view.pickup_pile_outline
        hand_view.pickup_pile.draw(hand_view.display, loc_xy, hand_view.pickup_pile.outline_color)
        hand_view.labelMedium(str(hand_view.pickup_pile_sz), 150, 35)
    if hand_view.controller._state.round == -1:
        hand_view.ready_yes_btn.draw(hand_view.display, hand_view.ready_yes_btn.outline_color)
        hand_view.ready_no_btn.draw(hand_view.display, hand_view.ready_no_btn.outline_color)
        hand_view.need_updated_button = True 
    hand_view.sort_status_btn.draw(hand_view.display, hand_view.sort_status_btn.outline_color)
    hand_view.sort_suit_al_btn.draw(hand_view.display, hand_view.sort_suit_al_btn.outline_color)
    hand_view.sort_al_btn.draw(hand_view.display, hand_view.sort_al_btn.outline_color)
    hand_view.sort_suit_ah_btn.draw(hand_view.display, hand_view.sort_suit_ah_btn.outline_color)
    hand_view.sort_ah_btn.draw(hand_view.display, hand_view.sort_ah_btn.outline_color)
    if not hand_view.need_updated_buttons:
        for idx in range(hand_view.num_players):
            for jdx in range(hand_view.buttons_per_player):
                prepare_card_btn = hand_view.assign_cards_btns[idx][jdx]
                prepare_card_btn.draw(hand_view.display, prepare_card_btn.outline_color)
    hand_view.clear_prepared_cards_btn.draw(hand_view.display, hand_view.clear_prepared_cards_btn.outline_color)
    hand_view.clear_selected_cards_btn.draw(hand_view.display, hand_view.clear_selected_cards_btn.outline_color)
    hand_view.play_prepared_cards_btn.draw(hand_view.display, hand_view.play_prepared_cards_btn.outline_color)
    hand_view.discard_action_btn.draw(hand_view.display, hand_view.discard_action_btn.outline_color)
    hand_view.heart_btn.draw(hand_view.display, hand_view.heart_btn.outline_color)
    return
def ButtonDisplay ( hand_view ) : if hand_view . need_updated_buttons and not hand_view . controller . _state . round == - 1 : hand_view . RuleSetsButtons . newRound ( hand_view , hand_view . Meld_Threshold [ hand_view . round_index ] ) hand_view . need_updated_buttons = False loc_xy = ( hand_view . draw_pile . x , hand_view . draw_pile . y ) hand_view . draw_pile . draw ( hand_view . display , loc_xy , hand_view . draw_pile . outline_color ) discard_info = hand_view . controller . getDiscardInfo ( ) hand_view . top_discard = discard_info [ 0 ] hand_view . pickup_pile_sz = discard_info [ 1 ] if hand_view . pickup_pile_sz > 0 : hand_view . top_discard_wrapped = UICardWrapper ( hand_view . top_discard , ( 100 , 25 ) , UIC . scale ) hand_view . pickup_pile = hand_view . top_discard_wrapped . img_clickable loc_xy = ( hand_view . pickup_pile . x , hand_view . pickup_pile . y ) hand_view . pickup_pile . outline_color = hand_view . pickup_pile_outline hand_view . pickup_pile . draw ( hand_view . display , loc_xy , hand_view . pickup_pile . outline_color ) hand_view . labelMedium ( str ( hand_view . pickup_pile_sz ) , 150 , 35 ) if hand_view . controller . _state . round == - 1 : hand_view . ready_yes_btn . draw ( hand_view . display , hand_view . ready_yes_btn . outline_color ) hand_view . ready_no_btn . draw ( hand_view . display , hand_view . ready_no_btn . outline_color ) hand_view . need_updated_button = True hand_view . sort_status_btn . draw ( hand_view . display , hand_view . sort_status_btn . outline_color ) hand_view . sort_suit_al_btn . draw ( hand_view . display , hand_view . sort_suit_al_btn . outline_color ) hand_view . sort_al_btn . draw ( hand_view . display , hand_view . sort_al_btn . outline_color ) hand_view . sort_suit_ah_btn . draw ( hand_view . display , hand_view . sort_suit_ah_btn . outline_color ) hand_view . sort_ah_btn . draw ( hand_view . display , hand_view . sort_ah_btn . outline_color ) if not hand_view . need_updated_buttons : for idx in range ( hand_view . num_players ) : for jdx in range ( hand_view . buttons_per_player ) : prepare_card_btn = hand_view . assign_cards_btns [ idx ] [ jdx ] prepare_card_btn . draw ( hand_view . display , prepare_card_btn . outline_color ) hand_view . clear_prepared_cards_btn . draw ( hand_view . display , hand_view . clear_prepared_cards_btn . outline_color ) hand_view . clear_selected_cards_btn . draw ( hand_view . display , hand_view . clear_selected_cards_btn . outline_color ) hand_view . play_prepared_cards_btn . draw ( hand_view . display , hand_view . play_prepared_cards_btn . outline_color ) hand_view . discard_action_btn . draw ( hand_view . display , hand_view . discard_action_btn . outline_color ) hand_view . heart_btn . draw ( hand_view . display , hand_view . heart_btn . outline_color ) return
This updates draw pile and action buttons.
This updates draw pile and action buttons .
""" This updates draw pile and action buttons. It is called in HandView.update each render cycle. 

    It also creates customized buttons for each round of Liverpool (might also be eventually used by
    other shared_board game.  Must wait to create until all players hit OK else you won't have created
    buttons for players who join afterwards.
    """ # update discard info and redraw # pickup_pile needs new clickable image each time any player discards or picks up the pile. # Next few lines insure pickup_pile image is up to date. # UICardWrapper sets outline color to no outline, next line resets outline to proper value. # flags that will need to update assign buttons.
hand_view