Skip to content

Commit

Permalink
LADX: Fix bug with Webhost usage (#2556)
Browse files Browse the repository at this point in the history
We were using data created in init when we never called init
  • Loading branch information
zig-for authored Dec 3, 2023
1 parent e8ceb12 commit a83bf2f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions worlds/ladx/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a83bf2f

Please sign in to comment.