diff --git a/Content.Server/Temperature/Components/EntityHeaterComponent.cs b/Content.Server/Temperature/Components/EntityHeaterComponent.cs index 3a162c20e3..0b5acb421a 100644 --- a/Content.Server/Temperature/Components/EntityHeaterComponent.cs +++ b/Content.Server/Temperature/Components/EntityHeaterComponent.cs @@ -1,5 +1,6 @@ using Content.Server.Temperature.Systems; using Content.Shared.Temperature; +using Robust.Shared.Audio; namespace Content.Server.Temperature.Components; @@ -21,4 +22,10 @@ public sealed partial class EntityHeaterComponent : Component /// [DataField] public EntityHeaterSetting Setting = EntityHeaterSetting.Off; + + /// + /// An optional sound that plays when the setting is changed. + /// + [DataField] + public SoundPathSpecifier? SettingSound; } diff --git a/Content.Server/Temperature/Systems/EntityHeaterSystem.cs b/Content.Server/Temperature/Systems/EntityHeaterSystem.cs index 6da774ba07..ffc796cbb2 100644 --- a/Content.Server/Temperature/Systems/EntityHeaterSystem.cs +++ b/Content.Server/Temperature/Systems/EntityHeaterSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Placeable; using Content.Shared.Popups; using Content.Shared.Temperature; using Content.Shared.Verbs; +using Robust.Server.Audio; namespace Content.Server.Temperature.Systems; @@ -16,6 +17,7 @@ public sealed class EntityHeaterSystem : EntitySystem [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly TemperatureSystem _temperature = default!; + [Dependency] private readonly AudioSystem _audio = default!; private readonly int SettingCount = Enum.GetValues(typeof(EntityHeaterSetting)).Length; @@ -92,6 +94,7 @@ public sealed class EntityHeaterSystem : EntitySystem comp.Setting = setting; power.Load = SettingPower(setting, comp.Power); _appearance.SetData(uid, EntityHeaterVisuals.Setting, setting); + _audio.PlayPvs(comp.SettingSound, uid); } private float SettingPower(EntityHeaterSetting setting, float max) diff --git a/Resources/Prototypes/Entities/Structures/Machines/grill.yml b/Resources/Prototypes/Entities/Structures/Machines/grill.yml index dbd31b3eae..9c4c67b951 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/grill.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/grill.yml @@ -17,6 +17,10 @@ - type: ApcPowerReceiver powerLoad: 0 # off by default - type: EntityHeater + settingSound: + path: /Audio/Weapons/click.ogg + params: + volume: -6 - type: ItemPlacer maxEntities: 4 # big grill, many steaks whitelist: