diff --git a/pc_software/ds3/duckypad_config.py b/pc_software/ds3/duckypad_config.py index f9de2e13..fdae05be 100644 --- a/pc_software/ds3/duckypad_config.py +++ b/pc_software/ds3/duckypad_config.py @@ -585,6 +585,9 @@ def compile_all_scripts(): for this_key in this_profile.keylist: if this_key is not None: this_key.binary_array = make_bytecode.make_dsb(this_key.script.split('\n')) + if len(this_key.binary_array) >= 2250: + messagebox.showerror("Error", f'Script size too large!\n\nProfile: {this_profile.name}\nKey: {this_key.name}') + return False return True except Exception as e: error_msg = "Code contains error!\n" @@ -637,9 +640,6 @@ def save_everything(save_path): pre, ext = os.path.splitext(dsb_path) dsb_path = pre + '.dsb' - if len(this_key.binary_array) >= 2250: - messagebox.showerror("Error", f'Profile {this_profile.name}\nKey {this_key.name}\n\nScript size too large') - with open(dsb_path, 'wb') as dsb_file: dsb_file.write(this_key.binary_array) if this_key.color is not None: diff --git a/pc_software/ds3/duckypad_config_latest_source.zip b/pc_software/ds3/duckypad_config_latest_source.zip index a5989062..589dede8 100644 Binary files a/pc_software/ds3/duckypad_config_latest_source.zip and b/pc_software/ds3/duckypad_config_latest_source.zip differ