mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
7d058fc613
V2 of [previous music playing PR](https://github.com/Aurorastation/Aurora.3/pull/21466). TLDR no longer uses the connect_range component for implementation because it turned out a bit too inflexible for overlapping music players. Removes a NanoUI template for the [TGUI update](https://github.com/Aurorastation/Aurora.3/pull/21046). New changelog: - refactor: "Ported Jukebox's NanoUI interface to TGUI." - refactor: "Ported Jukebox audio playing functionality to a component." - refactor: "Sound keys refactored from singletons to datums, along with larger breakout of sound.dm to allow for easier SFX updates in future." - code_imp: "Expanded track datums to include track lengths." - code_imp: "Reorganized music file folders for more intuitive access." - rscadd: "Earphone status feedback text now includes track length." - rscadd: "Added autoplay functionality to earphones." - bugfix: "Fixed earphones' 'Previous Song' verb not sending you to the end of the playlist when used while the first track is selected." - bugfix: "Fixed gain adjustment for 'Konyang-1' (-23 dB -> standard -9.8 dB)." - bugfix: "Fixed y-offset of audioconsole-running overlay animation to line up with the actual screen." --------- Co-authored-by: VMSolidus <evilexecutive@gmail.com>
46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
// -- Spark Datum --
|
|
/datum/effect_system/sparks
|
|
var/amount = 1 // How many sparks should we make
|
|
var/list/spread = list() // Which directions we should create sparks.
|
|
|
|
// Using the spark procs is preferred to directly instancing this.
|
|
/datum/effect_system/sparks/New(var/atom/movable/loc, var/start_immediately = TRUE, var/amt = 1, var/list/spread_dirs = list())
|
|
if(QDELETED(loc))
|
|
return
|
|
|
|
set_loc(loc)
|
|
|
|
if (amt)
|
|
amount = amt
|
|
|
|
if (spread_dirs)
|
|
spread = spread_dirs
|
|
else
|
|
spread = list()
|
|
|
|
..(start_immediately)
|
|
|
|
/datum/effect_system/sparks/process()
|
|
. = ..()
|
|
|
|
var/total_sparks = 1
|
|
if (location)
|
|
var/obj/effect/visual/sparks/S = new(location, src, 0) //Trigger one on the tile it's on
|
|
S.start()
|
|
playsound(location, SFX_SPARKS, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
|
|
QUEUE_VISUAL(S) // Queue it.
|
|
|
|
while (total_sparks <= src.amount)
|
|
playsound(location, SFX_SPARKS, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
|
|
var/direction = 0
|
|
|
|
if (LAZYLEN(src.spread))
|
|
direction = pick(src.spread)
|
|
else
|
|
direction = 0
|
|
|
|
S = new /obj/effect/visual/sparks(location, src)
|
|
S.start(direction)
|
|
QUEUE_VISUAL(S)
|
|
total_sparks++
|