Skip to content

Commit 1de871b

Browse files
committed
support collected transparency too
1 parent b3243a4 commit 1de871b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

JakTracker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import io
66
import time
7-
import PySimpleGUI as PSG
7+
import FreeSimpleGUI as PSG
88

99
# takes in a PIL.Image and returns the raw bytes for use in PySimpleGui
1010
def pil_to_bytes_with_alpha(img, alpha: int):
@@ -161,7 +161,7 @@ def __init__(self):
161161
# update icon for this boolean
162162
img = Image.open('icons/' + field_info['icons'][0]).convert('RGBA')
163163
if icon.metadata['value']:
164-
self.window[event].update(source=pil_to_bytes_with_alpha(img, 255), subsample=self.prefs['icon_shrink_factor'])
164+
self.window[event].update(source=pil_to_bytes_with_alpha(img, self.prefs['collected_transparency']), subsample=self.prefs['icon_shrink_factor'])
165165
else:
166166
# use low opacity if not collected
167167
self.window[event].update(source=pil_to_bytes_with_alpha(img, self.prefs['uncollected_transparency']), subsample=self.prefs['icon_shrink_factor'])
@@ -227,7 +227,7 @@ def __init__(self):
227227
# use low opacity if not collected
228228
self.window[key].update(source=pil_to_bytes_with_alpha(img, self.prefs['uncollected_transparency']), subsample=self.prefs['icon_shrink_factor'])
229229
else:
230-
self.window[key].update(source=pil_to_bytes_with_alpha(img, 255), subsample=self.prefs['icon_shrink_factor'])
230+
self.window[key].update(source=pil_to_bytes_with_alpha(img, self.prefs['collected_transparency']), subsample=self.prefs['icon_shrink_factor'])
231231
elif field_info['field_type'] == 'counter':
232232
# update counter value
233233
self.window[key+'_counter'].update(values[key])

prefs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ counter_font_size: 30
2323
# integer factor to shrink icons by 2=1/2, 3=1/3, etc (bigger number -> smaller icon)
2424
icon_shrink_factor: 1
2525

26-
# transparency of icons when cell has not been collected (0 = invisible, 255 = fully opaque)
27-
uncollected_transparency: 47
26+
# transparency of icons when cell has/hasn't been collected (0 = invisible, 255 = fully opaque)
27+
collected_transparency: 15
28+
uncollected_transparency: 255

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ pyinstaller=5.3
22
Pillow=9.3.0
33
python-dotenv=0.20.0
44
ahk=0.14.1
5-
asyncio=3.4.3
5+
asyncio=3.4.3
6+
FreeSimpleGUI=5.2

0 commit comments

Comments
 (0)