/tg/ Station 13 - Modules - TypesVar Details - Proc Details

jukebox

Jukebox datum

Plays music to nearby mobs when hosted in a movable or a turf.

Vars

active_song_soundCurrent song datum playing
listenersAssoc list of all mobs listening to the jukebox to their sound status.
parentAtom that hosts the jukebox. Can be a turf or a movable.
requires_range_checkWhether the jukebox requires a connect_range component to check for new listeners
selectionCurrent song track selected
songsList of /datum/tracks we can play. Set via get_songs().
sound_loopsWhether the music loops when done. If FALSE, you must handle ending music yourself.
sound_rangeRange at which the sound plays to players, can also be a view "XxY" string
volumeVolume of the songs played. Also serves as the max volume. Do not set directly, use set_new_volume() instead.
x_cutoffHow far away horizontally from the jukebox can you be before you stop hearing it
z_cutoffHow far away vertically from the jukebox can you be before you stop hearing it

Procs

check_new_listenerCheck for new mobs entering the jukebox's range.
deregister_listenerDeregisters the passed mob as a listener to the jukebox, stopping the music.
get_active_listenersHelper to get all mobs currently, ACTIVELY listening to the jukebox.
get_ui_dataReturns a set of general data relating to the jukebox for use in TGUI.
init_songsInitializes the track list.
listener_deafUpdates the sound's mute status when the mob's deafness updates.
listener_deletedDeregisters mobs on deletion.
listener_loginAllows mobs who are clientless when the music starts to hear it when they log in.
listener_movedUpdates the sound's position on mob movement.
load_songs_from_configLoads the config sounds once, and returns a copy of them.
on_enter_areaWhen the jukebox enters a new area entirely, we need to update the environment to the new area's.
on_movedWhen the jukebox moves, we need to update all listeners.
parent_deleteWhen our parent is deleted, we should go too.
register_listenerRegisters the passed mob as a new listener to the jukebox.
set_new_environmentSets the sound's environment to a new value. Then updates any mobs listening to it.
set_new_volumeSets the sound's volume to a new value. Then updates any mobs listening to it.
set_sound_rangeSets the sound's range to a new value. This can be a number or a view size string "XxY". Then updates any mobs listening to it.
set_volume_to_maxSets volume to the maximum possible value, the initial volume value.
start_musicHelper to kickstart the music for all mobs in hearing range of the jukebox.
unlisten_allHelper to stop the music for all mobs listening to the music.
unmute_listenerUnmutes the passed mob's sound from the passed reason.
update_allHelper to update all mobs currently listening to the music.
update_listenerUpdates the passed mob's sound in according to their position and status.

Var Details

active_song_sound

Current song datum playing

listeners

Assoc list of all mobs listening to the jukebox to their sound status.

parent

Atom that hosts the jukebox. Can be a turf or a movable.

requires_range_check

Whether the jukebox requires a connect_range component to check for new listeners

selection

Current song track selected

songs

List of /datum/tracks we can play. Set via get_songs().

sound_loops

Whether the music loops when done. If FALSE, you must handle ending music yourself.

sound_range

Range at which the sound plays to players, can also be a view "XxY" string

volume

Volume of the songs played. Also serves as the max volume. Do not set directly, use set_new_volume() instead.

x_cutoff

How far away horizontally from the jukebox can you be before you stop hearing it

z_cutoff

How far away vertically from the jukebox can you be before you stop hearing it

Proc Details

check_new_listener

Check for new mobs entering the jukebox's range.

deregister_listener

Deregisters the passed mob as a listener to the jukebox, stopping the music.

get_active_listeners

Helper to get all mobs currently, ACTIVELY listening to the jukebox.

get_ui_data

Returns a set of general data relating to the jukebox for use in TGUI.

Returns

init_songs

Initializes the track list.

By default, this loads all tracks from the config datum.

Returns

listener_deaf

Updates the sound's mute status when the mob's deafness updates.

listener_deleted

Deregisters mobs on deletion.

listener_login

Allows mobs who are clientless when the music starts to hear it when they log in.

listener_moved

Updates the sound's position on mob movement.

load_songs_from_config

Loads the config sounds once, and returns a copy of them.

on_enter_area

When the jukebox enters a new area entirely, we need to update the environment to the new area's.

on_moved

When the jukebox moves, we need to update all listeners.

parent_delete

When our parent is deleted, we should go too.

register_listener

Registers the passed mob as a new listener to the jukebox.

set_new_environment

Sets the sound's environment to a new value. Then updates any mobs listening to it.

set_new_volume

Sets the sound's volume to a new value. Then updates any mobs listening to it.

set_sound_range

Sets the sound's range to a new value. This can be a number or a view size string "XxY". Then updates any mobs listening to it.

set_volume_to_max

Sets volume to the maximum possible value, the initial volume value.

start_music

Helper to kickstart the music for all mobs in hearing range of the jukebox.

unlisten_all

Helper to stop the music for all mobs listening to the music.

unmute_listener

Unmutes the passed mob's sound from the passed reason.

Arguments

update_all

Helper to update all mobs currently listening to the music.

update_listener

Updates the passed mob's sound in according to their position and status.