From 9ef78a188ff26de933ee84ec3c3d47c23691d9af Mon Sep 17 00:00:00 2001 From: "Herman S." Date: Thu, 28 Nov 2024 17:33:07 +0100 Subject: [PATCH] Add a publicly available addSongEntry method in store.songs --- Monika After Story/game/zz_music_selector.rpy | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Monika After Story/game/zz_music_selector.rpy b/Monika After Story/game/zz_music_selector.rpy index 2ff92b6e04..51d7c3ac38 100644 --- a/Monika After Story/game/zz_music_selector.rpy +++ b/Monika After Story/game/zz_music_selector.rpy @@ -213,6 +213,23 @@ 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. + + 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) + """ + + music_choices.append((cleanGUIText(display_name), path)) + music_pages = __paginate(music_choices) + def _sanitizeVolume(value): """