From dc53f6cca78e14ae7b7fa2247d983bf9ecc4f1df Mon Sep 17 00:00:00 2001 From: bertieb Date: Mon, 30 Nov 2020 16:06:19 +0000 Subject: [PATCH] Set title, only show sub name when picking team --- teampicker.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/teampicker.py b/teampicker.py index 7e3a5bb..56a0327 100644 --- a/teampicker.py +++ b/teampicker.py @@ -41,6 +41,7 @@ RED = (186, 20, 31) PURPLE = (121, 35, 158) screen = pygame.display.set_mode(SIZE) +pygame.display.set_caption("Sub Crown Nov 2020 Team Picker") # Set up team text positioning references # @@ -108,12 +109,14 @@ class Sub(object): def __init__(self, sub): self.sub = sub + self._sub = "" self.team = "" self.x = 20 self.y = 0 def draw(self): - draw_text(self.sub, SUBFONT, BLUE, self.x, self.y) + if self._sub != "": + draw_text(self.sub, SUBFONT, BLUE, self.x, self.y) if self.team != "": draw_text(self.team, SUBFONT, PURPLE, self.x, int(self.y+SUBFONTHEIGHT)) @@ -200,6 +203,12 @@ while True: if sub.team == "": sub.team = TEAMS.pop().team elif event.key == 32: + # Display who we're choosing for + for sub in SUBS: + if sub._sub == "": + sub._sub = sub.sub + break + # Start the "who's it going to pick?" animation pygame.time.set_timer(HIGHLIGHTEVENT, 100) # every 100ms print(event.key) elif event.type == HIGHLIGHTEVENT: