Skip to content

Commit

Permalink
Add a publicly available addSongEntry method in store.songs
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamscached committed Nov 28, 2024
1 parent f2fdbe0 commit 9ef78a1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 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,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):
"""
Expand Down

0 comments on commit 9ef78a1

Please sign in to comment.