From d72cea7223db3ccbe19dd3e6e546c9896b88507e Mon Sep 17 00:00:00 2001 From: zig-for Date: Sun, 3 Dec 2023 12:24:35 -0800 Subject: [PATCH] LADX: Fix bug with Webhost usage (#2556) We were using data created in init when we never called init --- worlds/ladx/Options.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/worlds/ladx/Options.py b/worlds/ladx/Options.py index f1d5c5130168..691891c0b350 100644 --- a/worlds/ladx/Options.py +++ b/worlds/ladx/Options.py @@ -349,18 +349,19 @@ class GfxMod(FreeText, LADXROption): normal = '' default = 'Link' + __spriteDir: str = Utils.local_path(os.path.join('data', 'sprites','ladx')) __spriteFiles: typing.DefaultDict[str, typing.List[str]] = defaultdict(list) - __spriteDir: str = None extensions = [".bin", ".bdiff", ".png", ".bmp"] + + for file in os.listdir(__spriteDir): + name, extension = os.path.splitext(file) + if extension in extensions: + __spriteFiles[name].append(file) + def __init__(self, value: str): super().__init__(value) - if not GfxMod.__spriteDir: - GfxMod.__spriteDir = Utils.local_path(os.path.join('data', 'sprites','ladx')) - for file in os.listdir(GfxMod.__spriteDir): - name, extension = os.path.splitext(file) - if extension in self.extensions: - GfxMod.__spriteFiles[name].append(file) + def verify(self, world, player_name: str, plando_options) -> None: if self.value == "Link" or self.value in GfxMod.__spriteFiles: