From 373529565b0a1c8c4af12631ae9bb581ce47601d Mon Sep 17 00:00:00 2001 From: bertieb Date: Sun, 31 Oct 2021 17:21:37 +0000 Subject: [PATCH] (Oct 2021) Update for BL Cricket 96 Display should be looked at, I did horriblwe things but it looks okay in for 12 teams now --- subs.txt | 5 ++--- teampicker.py | 54 ++++++++++++++++++++++++++------------------------- teams.txt | 46 ++++++++++++------------------------------- 3 files changed, 42 insertions(+), 63 deletions(-) diff --git a/subs.txt b/subs.txt index 6969d48..f5b32dd 100644 --- a/subs.txt +++ b/subs.txt @@ -1,9 +1,8 @@ rarestmonkey costello_ -missgingeramy +pandacat42 mattgamerguy666 ksyme99 -etho8282 +idiotictendencies maothecat burgiuk -idiotictendencies diff --git a/teampicker.py b/teampicker.py index b167496..ffb2713 100644 --- a/teampicker.py +++ b/teampicker.py @@ -31,8 +31,8 @@ SIZE = WIDTH, HEIGHT = 1920, 1080 BGIMG = pygame.image.load("sub_crown_bg_2.png") -FONT = pygame.font.SysFont("Fetamont", 45) -SUBFONTHEIGHT = 35 +FONT = pygame.font.SysFont("Fetamont", 65) +SUBFONTHEIGHT = 45 SUBFONT = pygame.font.SysFont("Fetamont", SUBFONTHEIGHT) OFFWHITE = (224, 224, 224) HIGHLIGHT = (255, 209, 0) @@ -41,7 +41,7 @@ RED = (186, 20, 31) PURPLE = (121, 35, 158) screen = pygame.display.set_mode(SIZE) -pygame.display.set_caption("Sub Crown September 2021 Team Picker") +pygame.display.set_caption("Sub Crown October 2021 Team Picker") # Set up team text positioning references # @@ -49,14 +49,16 @@ pygame.display.set_caption("Sub Crown September 2021 Team Picker") TEAMSFILE = "teams.txt" -TEAMNUMCOLS = 3 +TEAMNUMCOLS = 2 TEAMNUMROWS = 12 -COLSTART = int(WIDTH/TEAMNUMCOLS) +# COLSTART = int(WIDTH/TEAMNUMCOLS) +COLSTART = int(WIDTH/(TEAMNUMCOLS+1)) COLWIDTH = int((WIDTH-COLSTART)/TEAMNUMCOLS) ROWSTART = int(HEIGHT/(TEAMNUMROWS+2)) -ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS) +# ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS) +ROWHEIGHT = int((HEIGHT-ROWSTART)/(TEAMNUMROWS-5)) TEAMCOLS = [] TEAMROWS = [] @@ -139,22 +141,22 @@ class Highlighter(object): # Choosing time self.lastchoice = -1 # # ** Name-specific choices! ** # # - for tsub in SUBS: - if tsub.team == "": - choosing_sub = tsub - break - for j in range(len(TEAMS)): - if "amy" not in choosing_sub.sub: - if TEAMS[j].team.lower( - ).startswith(choosing_sub.sub[0].lower()): - TEAMS[j].choose() - break - else: - if TEAMS[j].team.lower().startswith("a"): - TEAMS[j].choose() - break + # for tsub in SUBS: + # if tsub.team == "": + # choosing_sub = tsub + # break + # for j in range(len(TEAMS)): + # if "amy" not in choosing_sub.sub: + # if TEAMS[j].team.lower( + # ).startswith(choosing_sub.sub[0].lower()): + # TEAMS[j].choose() + # break + # else: + # if TEAMS[j].team.lower().startswith("a"): + # TEAMS[j].choose() + # break # # End Name-specific stuff # # - # TEAMS[-1].choose() + TEAMS[-1].choose() pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice self.iterations = 0 @@ -246,12 +248,12 @@ while True: for sub in SUBS: if sub.team == "": # # Name-specific again # # - for k in range(len(TEAMS)): - if TEAMS[k].colour == RED: - sub.team = TEAMS.pop(k).team - break + # for k in range(len(TEAMS)): + # if TEAMS[k].colour == RED: + # sub.team = TEAMS.pop(k).team + # break # # End name-specific # # - # sub.team = TEAMS.pop().team + sub.team = TEAMS.pop().team pygame.time.set_timer(CLEAREVENT, 100, True) break diff --git a/teams.txt b/teams.txt index e9b2829..e726944 100644 --- a/teams.txt +++ b/teams.txt @@ -1,34 +1,12 @@ -Avengers -Adepts -Awesomes -Admirables -Bashers -Bruisers -Bouncers -Ballers -Cannoneers -Cavaliers -Chargers -Conquerors -Elites -Eagles -Eliminators -Equalisers -Ionisers -Icers -Imps -Iridescents -Killers -Kings -Knights -Knockouts -Manglers -Militants -Majestics -Mighties -Marauders -Macerators -Ravagers -Redoubtables -Reavers -Rampagers +Australia +England +Holland +India +Kenya +New Zealand +Pakistan +South Africa +Sri Lanka +UAE +Zimbabwe +West Indies