Skip to content

Commit 4557c1a

Browse files
committed
Add path check, set PM variable
1 parent 9ef78a1 commit 4557c1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Monika After Story/game/zz_music_selector.rpy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ init -1 python in songs:
219219
title text.
220220
221221
NOTE: Does not perform loop/metadata prefix scan. Path will be added as-is.
222+
NOTE: Checks if the path exists (loop prefix is ignored for this check.)
222223
223224
IN:
224225
path - path to the music file
@@ -227,9 +228,16 @@ init -1 python in songs:
227228
(sets the corresponding PM variable)
228229
"""
229230

231+
filepath = path.split(">")[:-1]
232+
if not os.path.exists(filepath):
233+
raise ValueError("{0} does not exist.".format(filepath))
234+
230235
music_choices.append((cleanGUIText(display_name), path))
231236
music_pages = __paginate(music_choices)
232237

238+
if by_user:
239+
store.persistent._mas_pm_added_custom_bgm = True
240+
233241

234242
def _sanitizeVolume(value):
235243
"""

0 commit comments

Comments
 (0)