Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Preserve user-default-mods.json when updating the game
Browse files Browse the repository at this point in the history
  • Loading branch information
remyroy committed Jan 2, 2016
1 parent ff3fb8f commit 869cf44
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cddagl/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,21 @@ def post_extraction(self):
if not self.in_post_extraction:
return

# Copy user-default-mods.json if present
user_default_mods_file = os.path.join(mods_dir,
'user-default-mods.json')
previous_user_default_mods_file = os.path.join(previous_mods_dir,
'user-default-mods.json')

if (not os.path.exists(user_default_mods_file)
and os.path.isfile(previous_user_default_mods_file)):
status_bar.showMessage('Restoring user-default-mods.json')

shutil.copy2(previous_user_default_mods_file,
user_default_mods_file)

status_bar.clearMessage()

main_tab = self.get_main_tab()
game_dir_group_box = main_tab.game_dir_group_box

Expand Down

0 comments on commit 869cf44

Please sign in to comment.