mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 03:26:31 +01:00
Fixes headphones not updating icons properly when a song starts & stops playing (#75322)
🆑 ShizCalev fix: Headphones now properly update to display musical notes when a song starts & stops playing while worn! /🆑 Fixes #74965 REQUIRES #75324
This commit is contained in:
@@ -33,24 +33,17 @@
|
||||
/obj/item/instrument/piano_synth/headphones/Initialize(mapload)
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
RegisterSignal(src, COMSIG_INSTRUMENT_START, PROC_REF(start_playing))
|
||||
RegisterSignal(src, COMSIG_INSTRUMENT_END, PROC_REF(stop_playing))
|
||||
RegisterSignal(src, COMSIG_INSTRUMENT_START, PROC_REF(update_icon_for_playing_music))
|
||||
RegisterSignal(src, COMSIG_INSTRUMENT_END, PROC_REF(update_icon_for_playing_music))
|
||||
|
||||
/**
|
||||
* Called by a component signal when our song starts playing.
|
||||
*/
|
||||
/obj/item/instrument/piano_synth/headphones/proc/start_playing()
|
||||
// Called by a component signal to update musical note VFX for songs playing while worn.
|
||||
/obj/item/instrument/piano_synth/headphones/proc/update_icon_for_playing_music()
|
||||
SIGNAL_HANDLER
|
||||
icon_state = "[initial(icon_state)]_on"
|
||||
update_appearance()
|
||||
|
||||
/**
|
||||
* Called by a component signal when our song stops playing.
|
||||
*/
|
||||
/obj/item/instrument/piano_synth/headphones/proc/stop_playing()
|
||||
SIGNAL_HANDLER
|
||||
icon_state = "[initial(icon_state)]"
|
||||
update_appearance()
|
||||
/obj/item/instrument/piano_synth/headphones/update_icon_state()
|
||||
. = ..()
|
||||
icon_state = "[initial(icon_state)][song?.playing ? "_on" : null]"
|
||||
|
||||
/obj/item/instrument/piano_synth/headphones/spacepods
|
||||
name = "\improper Nanotrasen space pods"
|
||||
|
||||
Reference in New Issue
Block a user