Well, unifying the way levels are called didn't seem to fix the requirement, so now using copy for levels in the hook file.
This commit is contained in:
		| @@ -9,7 +9,10 @@ if hasattr(sys, '_MEIPASS'): | ||||
|     internal_dir = sys._MEIPASS | ||||
|  | ||||
|     # Directories to move from _internal to parent | ||||
|     dirs_to_move = ['levels', 'sounds', 'libstormgames'] | ||||
|     dirs_to_move = ['sounds', 'libstormgames'] | ||||
|  | ||||
|     # Directories to copy (keep in both locations) | ||||
|     dirs_to_copy = ['levels'] | ||||
|  | ||||
|     # Files to move from _internal to parent | ||||
|     files_to_move = ['files', 'logo.png'] | ||||
| @@ -27,6 +30,19 @@ if hasattr(sys, '_MEIPASS'): | ||||
|                 # Silently fail if we can't move - game will still work from _internal | ||||
|                 pass | ||||
|  | ||||
|     # Copy directories (keep in both locations) | ||||
|     for dir_name in dirs_to_copy: | ||||
|         internal_path = os.path.join(internal_dir, dir_name) | ||||
|         target_path = os.path.join(bundle_dir, dir_name) | ||||
|  | ||||
|         # Only copy if source exists and target doesn't exist | ||||
|         if os.path.exists(internal_path) and not os.path.exists(target_path): | ||||
|             try: | ||||
|                 shutil.copytree(internal_path, target_path) | ||||
|             except Exception as e: | ||||
|                 # Silently fail if we can't copy - game will still work from _internal | ||||
|                 pass | ||||
|  | ||||
|     # Move files | ||||
|     for file_name in files_to_move: | ||||
|         internal_path = os.path.join(internal_dir, file_name) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user