display top 10 or 20 golfer prof

This commit is contained in:
Justin 2023-05-12 16:23:02 +08:00 committed by GitHub
parent f538730758
commit 39ad5ee59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3410,7 +3410,7 @@ class StockTicker():
imgs = [title_img, self.blank]
else:
imgs = []
ten_or_twenty = slice(None)
for league in leagues:
try:
x_offset = 0
@ -3419,10 +3419,25 @@ class StockTicker():
if league == 'PGA':
league_logo = Image.open('logos/sports/league_logos/pga_1.png').convert('RGB')
try:
if all_settings['top20'] == 10:
ten_or_twenty = slice(10)
else:
ten_or_twenty = slice(None)
except:
ten_or_twenty = slice(None)
elif league == 'LPGA':
league_logo = Image.open('logos/sports/league_logos/lpga_1.png').convert('RGB')
try:
if all_settings['top20'] == 10:
ten_or_twenty = slice(10)
else:
ten_or_twenty = slice(None)
except:
ten_or_twenty = slice(None)
else:
league_logo = Image.open('logos/sports/league_logos/{}.png'.format(league)).convert('RGB')
ten_or_twenty = slice(None)
width, height = league_logo.size
league_logo2 = league_logo.resize((int(width/2), int(height/2)))
img.paste(league_logo2, (x_offset,0))
@ -3438,7 +3453,7 @@ class StockTicker():
buff_size = 20
for team in team_info:
for team in team_info[ten_or_twenty]:
if league == 'PGA' or league =='LPGA':
pga_small = ImageFont.load("./fonts/4x6.pil")
try: