Change to menu defaults if files not found on open
When opening an old devede project, if the background picture or music files aren't there, an exception would happen. This can happen even with the defaults, because in the last version, they were migrated into a different folder. Now, if the files aren't found, the new defaults will be used.
This commit is contained in:
parent
4143d9dd49
commit
9bd6d94c6c
1 changed files with 6 additions and 0 deletions
|
|
@ -673,4 +673,10 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
||||||
|
|
||||||
def restore_menu(self, data):
|
def restore_menu(self, data):
|
||||||
|
|
||||||
|
# check that the menu's background picture and music are there
|
||||||
|
if ('background_picture' in data) and (not os.path.exists(data['background_picture'])):
|
||||||
|
data['background_picture'] = self.default_background
|
||||||
|
if ('background_music' in data) and (not os.path.exists(data['background_music'])):
|
||||||
|
data['background_music'] = self.default_sound
|
||||||
|
|
||||||
self.unserialize(data)
|
self.unserialize(data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue