diff options
Diffstat (limited to 'src/sliceitoff/images/images.py')
-rw-r--r-- | src/sliceitoff/images/images.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sliceitoff/images/images.py b/src/sliceitoff/images/images.py index 999d92b..07a8bcd 100644 --- a/src/sliceitoff/images/images.py +++ b/src/sliceitoff/images/images.py @@ -9,12 +9,13 @@ class Images: surfaces = {} @staticmethod - def reload_images(): + def reload_images(base_path): __class__.surfaces = {} - with open("assets/images.lst") as image_list_file: - for line in image_list_file: + filename_imagelist = os.path.join(base_path, "assets", "images.lst") + with open( filename_imagelist ) as imagelist_file: + for line in imagelist_file: name, *path = line.strip().split() - filename = os.path.join(*path) + filename = os.path.join(base_path, *path) if DEBUG: print(f"Loading images {name = }, {filename = }") image = pygame.image.load(filename) @@ -24,8 +25,8 @@ class Images: return True @staticmethod - def load_images(): + def load_images(base_path): if __class__.surfaces: return False - return __class__.reload_images() + return __class__.reload_images(base_path)
\ No newline at end of file |