Merge pull request #1311 from ArchieBeepBoop/fallbackjukebox

Makes the Jukebox user friendly for the hosts to add songs
This commit is contained in:
Dahlular
2021-06-22 23:46:59 -06:00
committed by GitHub
3 changed files with 12 additions and 5 deletions
+3 -3
View File
@@ -66,13 +66,13 @@ SUBSYSTEM_DEF(jukeboxes)
/datum/controller/subsystem/jukeboxes/Initialize()
var/list/tracks = flist("config/jukebox_music/sounds/")
var/songID = 1
for(var/S in tracks)
for(var/S in tracks) // Tracks that will not be in the repo, aka, localhost tracks.
var/datum/track/T = new()
T.song_path = file("config/jukebox_music/sounds/[S]")
var/list/L = splittext(S,"+")
T.song_name = L[1]
T.song_length = text2num(L[2])
T.song_beat = text2num(L[3])
T.song_length = text2num(L[2])*10 //We multiply it by ten because the system requires it in deciseconds
T.song_beat = round(text2num(L[3])/6) //We divide it by six because it requires the Beats per seconds value, but in deciseconds. (Result/60) * 10)
T.song_associated_id = songID
songs |= T
songID++