diff --git a/Monika After Story/game/zz_music_selector.rpy b/Monika After Story/game/zz_music_selector.rpy index 2ff92b6e04..f510377a26 100644 --- a/Monika After Story/game/zz_music_selector.rpy +++ b/Monika After Story/game/zz_music_selector.rpy @@ -213,6 +213,36 @@ init -1 python in songs: if chan.mixer in renpy.game.preferences.volumes: renpy.game.preferences.volumes[chan.mixer] = _sanitizeVolume(value) + def addSongEntry(path, display_name, by_user=False): + """ + Adds song entry to selection list. Automatically paginates and cleans + 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 + display_name - title of the song to show in music selector + by_user (default False) - whether this is an action user has done + (sets the corresponding PM variable) + + OUT: + True if path exists and song entry was created, False otherwise. + """ + + filepath = path.split(">")[:-1] + if not os.path.exists(filepath): + return False + + music_choices.append((cleanGUIText(display_name), path)) + music_pages = __paginate(music_choices) + + if by_user: + store.persistent._mas_pm_added_custom_bgm = True + + return True + def _sanitizeVolume(value): """