From 4557c1ae796fdfae53307bf3c5ed8d1a70d8fabe Mon Sep 17 00:00:00 2001 From: "Herman S." Date: Thu, 28 Nov 2024 17:40:58 +0100 Subject: [PATCH] Add path check, set PM variable --- Monika After Story/game/zz_music_selector.rpy | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Monika After Story/game/zz_music_selector.rpy b/Monika After Story/game/zz_music_selector.rpy index 51d7c3ac38..de38c4bcdc 100644 --- a/Monika After Story/game/zz_music_selector.rpy +++ b/Monika After Story/game/zz_music_selector.rpy @@ -219,6 +219,7 @@ init -1 python in songs: title text. NOTE: Does not perform loop/metadata prefix scan. Path will be added as-is. + NOTE: Checks if the path exists (loop prefix is ignored for this check.) IN: path - path to the music file @@ -227,9 +228,16 @@ init -1 python in songs: (sets the corresponding PM variable) """ + filepath = path.split(">")[:-1] + if not os.path.exists(filepath): + raise ValueError("{0} does not exist.".format(filepath)) + music_choices.append((cleanGUIText(display_name), path)) music_pages = __paginate(music_choices) + if by_user: + store.persistent._mas_pm_added_custom_bgm = True + def _sanitizeVolume(value): """