From e99e99109db6e4c9ef76b6411781c2723beeb647 Mon Sep 17 00:00:00 2001 From: tposejank <81495861+tposejank@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:03:07 -0400 Subject: [PATCH] some fixes and stuff for 0.3 --- psychtobase/src/Constants.py | 2 +- psychtobase/src/FileContents.py | 5 ++++- psychtobase/src/Utils.py | 5 +++-- psychtobase/src/files.py | 4 ---- psychtobase/src/log.py | 2 -- psychtobase/src/tools/CharacterTools.py | 3 ++- psychtobase/src/tools/StageLuaParse.py | 1 + psychtobase/src/window.py | 15 +++------------ 8 files changed, 14 insertions(+), 23 deletions(-) diff --git a/psychtobase/src/Constants.py b/psychtobase/src/Constants.py index 262a455..ac7f3e4 100644 --- a/psychtobase/src/Constants.py +++ b/psychtobase/src/Constants.py @@ -425,4 +425,4 @@ ['/scripts/', '/scripts/'] # Do we need this? YES! } -VERSION = "0.2" \ No newline at end of file +VERSION = "0.3" \ No newline at end of file diff --git a/psychtobase/src/FileContents.py b/psychtobase/src/FileContents.py index 4c01fa1..73daf30 100644 --- a/psychtobase/src/FileContents.py +++ b/psychtobase/src/FileContents.py @@ -192,4 +192,7 @@ class ChangeCharacterHandler extends Module { # https://youtu.be/eB6txyhHFG4 # VocalFan, you are officially removed from the dev team! I hate this song. 😡 -# https://youtu.be/22tVWwmTie8?si=2TNmHTDoT7UgQvZ- \ No newline at end of file +# https://youtu.be/22tVWwmTie8?si=2TNmHTDoT7UgQvZ- + +# Calm down, dude! This song is better! +# https://youtu.be/VMp55KH_3wo \ No newline at end of file diff --git a/psychtobase/src/Utils.py b/psychtobase/src/Utils.py index d7b7018..558cb1b 100644 --- a/psychtobase/src/Utils.py +++ b/psychtobase/src/Utils.py @@ -7,9 +7,10 @@ from . import Constants from re import sub -# modPath = "" - def getRuntime(start:float) -> float: + """ + Small function to keep track of runtime + """ return start - time.time() def character(name:str) -> str: diff --git a/psychtobase/src/files.py b/psychtobase/src/files.py index a6c0835..3579c8a 100644 --- a/psychtobase/src/files.py +++ b/psychtobase/src/files.py @@ -7,10 +7,6 @@ def removeTrail(filename): return filename.replace('.json', '') def findAll(folder): - # return all files inside of a directory - # currently only used by the main - # update this! - logging.info(f'Finding all files or directories with glob: {folder}') return glob(folder) diff --git a/psychtobase/src/log.py b/psychtobase/src/log.py index 706d55e..150974a 100644 --- a/psychtobase/src/log.py +++ b/psychtobase/src/log.py @@ -43,8 +43,6 @@ def setup() -> logging.RootLogger: console_handler = CustomHandler() console_handler.setFormatter(log_format) - _GB_ToolID = '' - logger.handlers.clear() logger.addHandler(file_handler) logger.addHandler(console_handler) diff --git a/psychtobase/src/tools/CharacterTools.py b/psychtobase/src/tools/CharacterTools.py index 4a2df65..adb675a 100644 --- a/psychtobase/src/tools/CharacterTools.py +++ b/psychtobase/src/tools/CharacterTools.py @@ -50,9 +50,10 @@ def convert(self): Use ShadowFi's XML Resizer app: https://drive.google.com/file/d/1GoROyQKnMxiM6I0JUZ2_WKM5Aim6nY2o/view Eg: If the scale of your sprite was 0.6, you want to resize both Sprite Sheet and the XML to 60% of their original size. + """ + ## It is fixed! character['scale'] = psychCharacter['scale'] - """ character['isPixel'] = psychCharacter['scale'] >= 6 character['healthIcon']['id'] = psychCharacter['healthicon'] diff --git a/psychtobase/src/tools/StageLuaParse.py b/psychtobase/src/tools/StageLuaParse.py index 9a0735b..99562a9 100644 --- a/psychtobase/src/tools/StageLuaParse.py +++ b/psychtobase/src/tools/StageLuaParse.py @@ -39,6 +39,7 @@ def parseStage(lua_script_path): for arg in node.args: #Me and the boys HATE Lua <3 + # true.... better keep testing this!!!!! :imp: try: logging.info(f'Starting conversion of lua type: {type(arg)}') match(type(arg)): diff --git a/psychtobase/src/window.py b/psychtobase/src/window.py index e3e4fad..2a98cdf 100644 --- a/psychtobase/src/window.py +++ b/psychtobase/src/window.py @@ -538,18 +538,14 @@ def convertCallback(self, what): try: optionsParsed = '' - for key in options.keys(): - if type(options[key]) == bool: - optionsParsed += '\n ' + key + ': ' + 'Yes' if options[key] else 'No' - elif type(options[key]) == dict: - optionsParsed += '\n ' + key + ':' - for subkey in options[key].keys(): - optionsParsed += '\n ' + subkey + ': ' + 'Yes' if bool(options[key][subkey]) else 'No' + for key in options: + optionsParsed += f'\n {key = }' # Now writing the last log file, which we can query to the user open(_defaultsFile, 'w').write(f'{psych_mod_folder_path}\n{result_path}\n\nLAST LOG: {log.logMemory.current_log_file}\n======================\nOPTIONS:{optionsParsed}') except Exception as e: logging.error(f'Problems with your save file: {e}') + self.throwError(f'Problems on your save file! {e}') if psych_mod_folder_path != None and result_path != None: # try: @@ -609,12 +605,7 @@ def init(): try: window.show() except Exception as e: - #why does this never fire logging.critical(f'Window could not show! {e}') - - #work in progress - #Window.throwError(self=QDialog, text='d', actual_error_text='poooop') - # print('pooop') app.exec()