From debf932e4c93fb817de875bb335a82d9d1ff3b16 Mon Sep 17 00:00:00 2001
From: XeonMations <62395746+XeonMations@users.noreply.github.com>
Date: Sat, 4 Jul 2026 00:54:41 +0300
Subject: [PATCH] Re-Adds the radio noise volume slider (#96602)
## About The Pull Request
As the title said, re-adds the radio noise volume slider in the
preferences menu.
Images
Before:
After:
## Why It's Good For The Game
People should be able to adjust the volume of radio beeps, since it can
be overwhelmingly loud when radio is really going off.
## Changelog
:cl:
fix: Fixed the radio volume slider being missing in game preferences
/:cl:
---------
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
---
.../game/objects/items/devices/radio/radio.dm | 11 ----------
code/modules/client/preferences/sounds.dm | 1 +
.../features/game_preferences/sounds.tsx | 7 +++++++
tgui/packages/tgui/interfaces/Radio.test.tsx | 1 -
tgui/packages/tgui/interfaces/Radio.tsx | 21 ++-----------------
5 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index aca496a9667..9faf6b8469b 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -497,7 +497,6 @@
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
@@ -506,7 +505,6 @@
if(.)
return
- var/mob/user = ui.user
switch(action)
if("frequency")
if(freqlock != RADIO_FREQENCY_UNLOCKED)
@@ -557,15 +555,6 @@
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)
. = ..()
diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm
index 4add02eedba..5363334462b 100644
--- a/code/modules/client/preferences/sounds.dm
+++ b/code/modules/client/preferences/sounds.dm
@@ -150,6 +150,7 @@
/// Controls radio noise volume
/datum/preference/numeric/volume/sound_radio_noise
+ category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_radio_noise"
savefile_identifier = PREFERENCE_PLAYER
diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx
index 541de5a5a96..dcd3370c8d0 100644
--- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx
+++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx
@@ -135,6 +135,13 @@ export const sound_achievement: FeatureChoiced = {
component: FeatureDropdownInput,
};
+export const sound_radio_noise: Feature = {
+ name: 'Radio sound volume',
+ category: 'SOUND',
+ description: 'Volume of the bloops that play when a radio message is said or received.',
+ component: FeatureSliderInput,
+};
+
export const sound_ai_vox: Feature = {
name: 'AI VOX announcements volume',
category: 'SOUND',
diff --git a/tgui/packages/tgui/interfaces/Radio.test.tsx b/tgui/packages/tgui/interfaces/Radio.test.tsx
index f547dbf750c..da20a899621 100644
--- a/tgui/packages/tgui/interfaces/Radio.test.tsx
+++ b/tgui/packages/tgui/interfaces/Radio.test.tsx
@@ -18,7 +18,6 @@ store.set(gameDataAtom, {
subspace: 0,
subspaceSwitchable: 1,
channels: {},
- radio_noises: 0,
});
describe('Radio tests', () => {
diff --git a/tgui/packages/tgui/interfaces/Radio.tsx b/tgui/packages/tgui/interfaces/Radio.tsx
index a99c34e69e0..7d97865387b 100644
--- a/tgui/packages/tgui/interfaces/Radio.tsx
+++ b/tgui/packages/tgui/interfaces/Radio.tsx
@@ -5,7 +5,6 @@ import {
LabeledList,
NumberInput,
Section,
- Slider,
Stack,
} from 'tgui-core/components';
import { toFixed } from 'tgui-core/math';
@@ -27,7 +26,6 @@ type RadioData = {
subspace: BooleanLike;
subspaceSwitchable: BooleanLike;
channels: Record;
- radio_noises: number;
};
export const Radio = (props) => {
@@ -43,7 +41,6 @@ export const Radio = (props) => {
useCommand,
subspace,
subspaceSwitchable,
- radio_noises,
} = data;
const tunedChannel = RADIO_CHANNELS.find(
(channel) => channel.freq === frequency,
@@ -53,14 +50,14 @@ export const Radio = (props) => {
status: !!value,
}));
// Calculate window height
- let height = 133;
+ let height = 105;
if (channels.length > 0) {
height += channels.length * 25 + 8;
} else if (subspace) {
height += 24;
}
return (
-
+
@@ -127,20 +124,6 @@ export const Radio = (props) => {
/>
)}
-
- {
- act('set_radio_volume', {
- volume: value,
- });
- }}
- minValue={0}
- maxValue={100}
- step={1}
- value={radio_noises}
- stepPixelSize={10}
- />
-
{(!!subspace || channels.length > 0) && (
{channels.length === 0 && (