mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-16 10:27:34 +01:00
Jukeboxes Finally Work
This commit is contained in:
@@ -65,6 +65,7 @@ SUBSYSTEM_DEF(jukeboxes)
|
||||
|
||||
/datum/controller/subsystem/jukeboxes/Initialize()
|
||||
var/list/tracks = flist("config/jukebox_music/sounds/")
|
||||
var/songID = 1
|
||||
for(var/S in tracks)
|
||||
var/datum/track/T = new()
|
||||
T.song_path = file("config/jukebox_music/sounds/[S]")
|
||||
@@ -72,8 +73,9 @@ SUBSYSTEM_DEF(jukeboxes)
|
||||
T.song_name = L[1]
|
||||
T.song_length = text2num(L[2])
|
||||
T.song_beat = text2num(L[3])
|
||||
T.song_associated_id = L[4]
|
||||
T.song_associated_id = songID
|
||||
songs |= T
|
||||
songID++
|
||||
for(var/i in CHANNEL_JUKEBOX_START to CHANNEL_JUKEBOX)
|
||||
freejukeboxchannels |= i
|
||||
return ..()
|
||||
@@ -83,15 +85,15 @@ SUBSYSTEM_DEF(jukeboxes)
|
||||
return
|
||||
for(var/list/jukeinfo in activejukeboxes)
|
||||
if(!jukeinfo.len)
|
||||
EXCEPTION("Active jukebox without any associated metadata.")
|
||||
stack_trace("Active jukebox without any associated metadata.")
|
||||
continue
|
||||
var/datum/track/juketrack = jukeinfo[1]
|
||||
if(!istype(juketrack))
|
||||
EXCEPTION("Invalid jukebox track datum.")
|
||||
stack_trace("Invalid jukebox track datum.")
|
||||
continue
|
||||
var/obj/jukebox = jukeinfo[3]
|
||||
if(!istype(jukebox))
|
||||
EXCEPTION("Nonexistant or invalid object associated with jukebox.")
|
||||
stack_trace("Nonexistant or invalid object associated with jukebox.")
|
||||
continue
|
||||
var/sound/song_played = sound(juketrack.song_path)
|
||||
var/area/currentarea = get_area(jukebox)
|
||||
|
||||
Reference in New Issue
Block a user