Skip to content

Commit

Permalink
Fix stuff up... A little.
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffyOMC committed May 28, 2024
1 parent 68aafbd commit e0f1cad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions psychtobase/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,26 +454,26 @@ def convert(psych_mod_folder, result_folder, options):
psychWeeks = f'{modName}{dir[0]}'
baseLevels = dir[1]

if Path(psychWeeks).exists(follow_symlinks=False):
allPng = files.findAll(f'{psychWeeks}*.png')
for asset in allPng:
logging.info(f'Copying week: {asset}')
try:
folderMake(f'{result_folder}/{modFoldername}{baseLevels}')
fileCopy(asset,
f'{result_folder}/{modFoldername}{baseLevels}{Path(asset).name}')
except Exception as e:
logging.error(f'Could not copy asset {asset}: {e}')
else:
logging.info(f'A week for {modName} has no story menu image, replacing with a default.')
with open(f'week{modName}.png', 'wb') as fh:
#id be surprised if this works
try:
folderMake(f'{result_folder}/{modFoldername}{baseLevels}')
Image.open(base64.b64decode(data[Constants.BASE64_IMAGES.get('missingWeek')]))
Image.save(f'{result_folder}/{modFoldername}{baseLevels}')
except Exception as e:
logging.error(f"Couldn't generate week image to {modFoldername}/{baseLevels}: {e}")
#if Path(psychWeeks).exists(follow_symlinks=False):
# allPng = files.findAll(f'{psychWeeks}*.png')
# for asset in allPng:
# logging.info(f'Copying week: {asset}')
# try:
# folderMake(f'{result_folder}/{modFoldername}{baseLevels}')
# fileCopy(asset,
# f'{result_folder}/{modFoldername}{baseLevels}{Path(asset).name}')
# except Exception as e:
# logging.error(f'Could not copy asset {asset}: {e}')
#else:
# logging.info(f'A week for {modName} has no story menu image, replacing with a default.')
# with open(f'week{modName}.png', 'wb') as fh:
# #id be surprised if this works
# try:
# folderMake(f'{result_folder}/{modFoldername}{baseLevels}')
# Image.open(base64.b64decode(data[Constants.BASE64_IMAGES.get('missingWeek')]))
# Image.save(f'{result_folder}/{modFoldername}{baseLevels}')
# except Exception as e:
# logging.error(f"Couldn't generate week image to {modFoldername}/{baseLevels}: {e}")

if options.get('stages', False):
logging.info('Converting stages...')
Expand Down
2 changes: 1 addition & 1 deletion psychtobase/src/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def note(data:int, length:float, time:str) -> dict:
"""
Function created for faster creation of note data.
"""
if length == 0:
if length == 0 or isinstance(length, str): # String check for more modified Psych Engines
return {"d": data, "t": time} # This is how the base game charts handle it so...
return {"d": data, "l": length, "t": time}

Expand Down

0 comments on commit e0f1cad

Please sign in to comment.