Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Monika After Story/game/zz_music_selector.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down