added feature titles to place image

This commit is contained in:
Justin 2023-08-17 15:59:20 +08:00 committed by GitHub
parent 31d8ad027b
commit 0abad58446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5602,21 +5602,28 @@ class StockTicker():
f.close() f.close()
imgs = [] imgs = []
feature_title = False
for place in all_settings['places']: for place in all_settings['places']:
if "2017" in place: if "2017" in place:
try: try:
img = self.openImage('logos/r_place/r_place 2017.png') img = self.openImage('logos/r_place/r_place 2017.png')
if all_settings['title']:
feature_title = self.openImage('feature_titles/place2017.png')
except: except:
pass pass
elif "2022" in place: elif "2022" in place:
try: try:
img = self.openImage('logos/r_place/r_place 2022.png') img = self.openImage('logos/r_place/r_place 2022.png')
if all_settings['title']:
feature_title = self.openImage('feature_titles/place2022.png')
except: except:
pass pass
elif "2023" in place: elif "2023" in place:
try: try:
img = self.openImage('logos/r_place/r_place 2023.png') img = self.openImage('logos/r_place/r_place 2023.png')
if all_settings['title']:
feature_title = self.openImage('feature_titles/place2023.png')
except: except:
pass pass
try: try:
@ -5625,8 +5632,16 @@ class StockTicker():
x = random.randint(0, max_x) x = random.randint(0, max_x)
y = random.randint(0, max_y) y = random.randint(0, max_y)
snapshot = img.crop((x, y, x + int(all_settings['width']), y + 32)) snapshot = img.crop((x, y, x + int(all_settings['width']), y + 32))
imgs.append(snapshot)
try:
imgs.append(self.stitchImage([feature_title,snapshot]))
except:
imgs.append(snapshot)
img.close() img.close()
try:
feature_title.close()
except:
pass
except: except:
pass pass