Code: Select all
init python:
playerList = {
"bgm/M01.ogg":["images/bgm/M01.png"],
"bgm/M02.ogg":["images/bgm/M02.png"],
"bgm/M03.ogg":["images/bgm/M03.png"],
"bgm/M04.ogg":["images/bgm/M04.png"],
"bgm/M05.ogg":["images/bgm/M05.png"],
"bgm/M06.ogg":["images/bgm/M06.png"],
"bgm/M07.ogg":["images/bgm/M07.png"],
"bgm/M08.ogg":["images/bgm/M08.png"],
"bgm/M09.ogg":["images/bgm/M09.png"],
"bgm/M10.ogg":["images/bgm/M10.png"],
"bgm/M11.ogg":["images/bgm/M11.png"],
"bgm/M12.ogg":["images/bgm/M12.png"],
"bgm/M13.ogg":["images/bgm/M13.png"],
"bgm/M14.ogg":["images/bgm/M14.png"],
"bgm/M15.ogg":["images/bgm/M15.png"],
"bgm/M16.ogg":["images/bgm/M16.png"],
"bgm/M17.ogg":["images/bgm/M17.png"],
"bgm/M18.ogg":["images/bgm/M18.png"],
"bgm/M19.ogg":["images/bgm/M19.png"],
"bgm/M20.ogg":["images/bgm/M20.png"],
"bgm/M21.ogg":["images/bgm/M21.png"]
}
mr = MusicRoom(fadeout=0.5, shuffle=False)
for track in playerList:
mr.add(track, always_unlocked=True)
Code: Select all
screen extra:
tag menu
add "images/gui/menu_ground.png"
modal True
default extra_gallery = "cg"
default cg_page = 1
default memories_page = 1
imagemap:
ground "images/gui/extra_ground.png"
idle "images/gui/extra_idle.png"
hover "images/gui/extra_hover.png"
selected_idle "images/gui/extra_selected_idle.png"
selected_hover "images/gui/extra_selected_hover.png"
alpha False
hotspot(302,53,31,27) action mr.Previous()
hotspot(358,53,25,27) action mr.Play() selected renpy.music.is_playing()
hotspot(406,53,27,27) action mr.Stop()
hotspot(454,53,32,27) action mr.Next()
hotspot(25,534,149,40) action Return()
if renpy.music.get_playing() is not None:
$ currentTrack = playerList[renpy.music.get_playing()]
image (currentTrack[0]) pos(509,43)
on "replaced" action Play("music", "bgm/M01.ogg")
1. I'm showing song name with image. When song is changed it's name isn't until I press one of the buttons in that screen that are using "SetScreenVariable()". Refresh? (They aren't shown in code above but they are there.)
2. When I use next or previous button they pick somewhat randomish song. I even wrote "shuffle=False" but still the same. What I found is they are played in this order: "1,6,12,18,8,7,14,15,21,19,3,2,16,20,11,4,17,9,13,10,5". No idea why.
3. When I press stop button and than play last song from numbers above is played (5th in whole list).
Any ideas how any of those can be fixed? 1st and 3rd point is probably the most important for me. I don't have list of all songs in game so users won't know what order they are played.
(I don't know python.)