added draw state to ufc

This commit is contained in:
Justin 2023-04-25 01:26:08 +08:00 committed by GitHub
parent dc1a471f88
commit 0d5faa7473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2819,6 +2819,8 @@ class StockTicker():
elif time == 'past':
if fight['fighter1win']:
win1_img = self.textImage('WIN', extra_small_font, r=0, g=255, b=0)
elif not fight['fighter1win'] and not fight['fighter2win']:
win1_img = self.textImage('DRAW', extra_small_font, r=80, g=80, b=80)
else:
win1_img = self.textImage('LOSS', extra_small_font, r=0, g=255, b=0)
@ -2848,6 +2850,8 @@ class StockTicker():
elif time == 'past':
if fight['fighter1win']:
draw.text((widest - int(weight_img.size[0]/2) - win1_img.size[0] - 2,0), 'WIN', fill=(0,255,0),font=extra_small_font)
elif not fight['fighter1win'] and not fight['fighter2win']:
draw.text((widest - int(weight_img.size[0]/2) - win1_img.size[0] - 2,0), 'DRAW', fill=(80,80,80),font=extra_small_font)
else:
draw.text((widest - int(weight_img.size[0]/2) - win1_img.size[0] - 2,0), 'LOSS', fill=(255,0,0),font=extra_small_font)
@ -2887,6 +2891,8 @@ class StockTicker():
elif time == 'past':
if fight['fighter2win']:
draw.text((widest + int(weight_img.size[0]/2) + 2,0), 'WIN', fill=(0,255,0),font=extra_small_font)
elif not fight['fighter2win'] and not fight['fighter1win']:
draw.text((widest + int(weight_img.size[0]/2) + 2,0), 'DRAW', fill=(80,80,80),font=extra_small_font)
else:
draw.text((widest + int(weight_img.size[0]/2) + 2,0), 'LOSS', fill=(255,0,0),font=extra_small_font)