Radio sfx option is in the radio instead of settings (#90598)

## About The Pull Request

Opinions aren't too strong about taking it out of the settings page, I
only did it cause settings doesn't auto update with the pref updating,
so I can put it back if wanted.

Adds a volume slider in radios which you can use to edit your own blip
volume, which then plays a blip back at you so you know what it sounds
like.

## Why It's Good For The Game

You now change the volume using the in-game item instead of having to
scroll through a bunch of settings and find it, and you get instant
feedback so you know exactly what it's gonna sound like.


https://github.com/user-attachments/assets/fe936ed8-9620-4e81-8782-e6fa99de100a

## Changelog

🆑
qol: Radios/headsets now have a slider to change the volume from radio
noises.
/🆑
This commit is contained in:
John Willard
2025-04-16 17:59:15 -07:00
committed by GitHub
parent 3dd7d2f65b
commit d8ccd8c63f
4 changed files with 47 additions and 11 deletions
@@ -477,6 +477,7 @@
data["subspace"] = subspace_transmission
data["subspaceSwitchable"] = subspace_switchable
data["headset"] = FALSE
data["radio_noises"] = (user.client?.prefs.read_preference(/datum/preference/numeric/volume/sound_radio_noise))
return data
@@ -484,6 +485,8 @@
. = ..()
if(.)
return
var/mob/user = ui.user
switch(action)
if("frequency")
if(freqlock != RADIO_FREQENCY_UNLOCKED)
@@ -524,6 +527,15 @@
else
recalculateChannels()
. = TRUE
if("set_radio_volume")
if(!user.client)
return
user.client.prefs.write_preference(GLOB.preference_entries[/datum/preference/numeric/volume/sound_radio_noise], params["volume"])
//let them know what it'll sound like
//we get their read prefs instead of just taking the params beacuse write_preference is what handles ensuring
//there's no href exploits.
var/volume_modifier = (user.client.prefs.read_preference(/datum/preference/numeric/volume/sound_radio_noise))
SEND_SOUND(user, sound('sound/items/radio/radio_receive.ogg', volume = volume_modifier))
/obj/item/radio/examine(mob/user)
. = ..()