Add sound for turning on grill (#31099)

* Add sound for turning on grill

* remove view variable
This commit is contained in:
themias
2024-08-16 20:41:55 -04:00
committed by GitHub
parent cc445e07b8
commit 79ae2cceb4
3 changed files with 14 additions and 0 deletions

View File

@@ -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
/// </summary>
[DataField]
public EntityHeaterSetting Setting = EntityHeaterSetting.Off;
/// <summary>
/// An optional sound that plays when the setting is changed.
/// </summary>
[DataField]
public SoundPathSpecifier? SettingSound;
}

View File

@@ -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)

View File

@@ -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: