|
@@ -31,8 +31,8 @@ SIZE = WIDTH, HEIGHT = 1920, 1080 |
|
|
|
|
|
|
|
|
BGIMG = pygame.image.load("sub_crown_bg_2.png") |
|
|
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) |
|
|
SUBFONT = pygame.font.SysFont("Fetamont", SUBFONTHEIGHT) |
|
|
OFFWHITE = (224, 224, 224) |
|
|
OFFWHITE = (224, 224, 224) |
|
|
HIGHLIGHT = (255, 209, 0) |
|
|
HIGHLIGHT = (255, 209, 0) |
|
@@ -41,7 +41,7 @@ RED = (186, 20, 31) |
|
|
PURPLE = (121, 35, 158) |
|
|
PURPLE = (121, 35, 158) |
|
|
|
|
|
|
|
|
screen = pygame.display.set_mode(SIZE) |
|
|
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 |
|
|
# Set up team text positioning references |
|
|
# |
|
|
# |
|
@@ -49,14 +49,16 @@ pygame.display.set_caption("Sub Crown September 2021 Team Picker") |
|
|
|
|
|
|
|
|
TEAMSFILE = "teams.txt" |
|
|
TEAMSFILE = "teams.txt" |
|
|
|
|
|
|
|
|
TEAMNUMCOLS = 3 |
|
|
|
|
|
|
|
|
TEAMNUMCOLS = 2 |
|
|
TEAMNUMROWS = 12 |
|
|
TEAMNUMROWS = 12 |
|
|
|
|
|
|
|
|
COLSTART = int(WIDTH/TEAMNUMCOLS) |
|
|
|
|
|
|
|
|
# COLSTART = int(WIDTH/TEAMNUMCOLS) |
|
|
|
|
|
COLSTART = int(WIDTH/(TEAMNUMCOLS+1)) |
|
|
COLWIDTH = int((WIDTH-COLSTART)/TEAMNUMCOLS) |
|
|
COLWIDTH = int((WIDTH-COLSTART)/TEAMNUMCOLS) |
|
|
|
|
|
|
|
|
ROWSTART = int(HEIGHT/(TEAMNUMROWS+2)) |
|
|
ROWSTART = int(HEIGHT/(TEAMNUMROWS+2)) |
|
|
ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS) |
|
|
|
|
|
|
|
|
# ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS) |
|
|
|
|
|
ROWHEIGHT = int((HEIGHT-ROWSTART)/(TEAMNUMROWS-5)) |
|
|
|
|
|
|
|
|
TEAMCOLS = [] |
|
|
TEAMCOLS = [] |
|
|
TEAMROWS = [] |
|
|
TEAMROWS = [] |
|
@@ -139,22 +141,22 @@ class Highlighter(object): |
|
|
# Choosing time |
|
|
# Choosing time |
|
|
self.lastchoice = -1 |
|
|
self.lastchoice = -1 |
|
|
# # ** Name-specific choices! ** # # |
|
|
# # ** 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 # # |
|
|
# # End Name-specific stuff # # |
|
|
# TEAMS[-1].choose() |
|
|
|
|
|
|
|
|
TEAMS[-1].choose() |
|
|
pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight |
|
|
pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight |
|
|
pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice |
|
|
pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice |
|
|
self.iterations = 0 |
|
|
self.iterations = 0 |
|
@@ -246,12 +248,12 @@ while True: |
|
|
for sub in SUBS: |
|
|
for sub in SUBS: |
|
|
if sub.team == "": |
|
|
if sub.team == "": |
|
|
# # Name-specific again # # |
|
|
# # 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 # # |
|
|
# # End name-specific # # |
|
|
# sub.team = TEAMS.pop().team |
|
|
|
|
|
|
|
|
sub.team = TEAMS.pop().team |
|
|
pygame.time.set_timer(CLEAREVENT, 100, True) |
|
|
pygame.time.set_timer(CLEAREVENT, 100, True) |
|
|
break |
|
|
break |
|
|
|
|
|
|
|
|