@@ -16,7 +16,7 @@ public sealed class AccessOverlay : Overlay
|
|||||||
|
|
||||||
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
||||||
|
|
||||||
public AccessOverlay(IEntityManager entManager, IClientResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform)
|
public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform)
|
||||||
{
|
{
|
||||||
_entityManager = entManager;
|
_entityManager = entManager;
|
||||||
_lookup = lookup;
|
_lookup = lookup;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public sealed class ShowAccessReadersCommand : IConsoleCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
var entManager = collection.Resolve<IEntityManager>();
|
var entManager = collection.Resolve<IEntityManager>();
|
||||||
var cache = collection.Resolve<IClientResourceCache>();
|
var cache = collection.Resolve<IResourceCache>();
|
||||||
var lookup = entManager.System<EntityLookupSystem>();
|
var lookup = entManager.System<EntityLookupSystem>();
|
||||||
var xform = entManager.System<SharedTransformSystem>();
|
var xform = entManager.System<SharedTransformSystem>();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Content.Client.Administration
|
|||||||
private readonly EntityLookupSystem _entityLookup;
|
private readonly EntityLookupSystem _entityLookup;
|
||||||
private readonly Font _font;
|
private readonly Font _font;
|
||||||
|
|
||||||
public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IClientResourceCache resourceCache, EntityLookupSystem entityLookup)
|
public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IResourceCache resourceCache, EntityLookupSystem entityLookup)
|
||||||
{
|
{
|
||||||
_system = system;
|
_system = system;
|
||||||
_entityManager = entityManager;
|
_entityManager = entityManager;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Content.Client.Administration.Systems
|
|||||||
public sealed partial class AdminSystem
|
public sealed partial class AdminSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
[Dependency] private readonly IOverlayManager _overlayManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
||||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public sealed class ExplosionDebugOverlay : Overlay
|
|||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
var cache = IoCManager.Resolve<IClientResourceCache>();
|
var cache = IoCManager.Resolve<IResourceCache>();
|
||||||
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace Content.Client.Arcade
|
|||||||
|
|
||||||
MinSize = SetSize = new Vector2(410, 490);
|
MinSize = SetSize = new Vector2(410, 490);
|
||||||
|
|
||||||
var resourceCache = IoCManager.Resolve<IClientResourceCache>();
|
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||||
var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
|
var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
|
||||||
|
|
||||||
_mainPanel = new PanelContainer();
|
_mainPanel = new PanelContainer();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Client.Atmos.EntitySystems
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem
|
public sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
||||||
[Dependency] private readonly SpriteSystem _spriteSys = default!;
|
[Dependency] private readonly SpriteSystem _spriteSys = default!;
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Client.Atmos.Overlays
|
|||||||
|
|
||||||
public const int GasOverlayZIndex = (int) Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else
|
public const int GasOverlayZIndex = (int) Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else
|
||||||
|
|
||||||
public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IClientResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys)
|
public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys)
|
||||||
{
|
{
|
||||||
_entManager = entManager;
|
_entManager = entManager;
|
||||||
_mapManager = IoCManager.Resolve<IMapManager>();
|
_mapManager = IoCManager.Resolve<IMapManager>();
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using System.Numerics;
|
||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Log;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Map;
|
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using System.Linq;
|
|
||||||
using System.Numerics;
|
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Shared.Audio.Effects;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Client.Audio;
|
namespace Content.Client.Audio;
|
||||||
//TODO: This is using a incomplete version of the whole "only play nearest sounds" algo, that breaks down a bit should the ambient sound cap get hit.
|
//TODO: This is using a incomplete version of the whole "only play nearest sounds" algo, that breaks down a bit should the ambient sound cap get hit.
|
||||||
@@ -46,18 +41,14 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
private TimeSpan _targetTime = TimeSpan.Zero;
|
private TimeSpan _targetTime = TimeSpan.Zero;
|
||||||
private float _ambienceVolume = 0.0f;
|
private float _ambienceVolume = 0.0f;
|
||||||
|
|
||||||
private static AudioParams _params = AudioParams.Default
|
private static AudioParams _params = AudioParams.Default.WithVariation(0.01f).WithLoop(true).WithAttenuation(Attenuation.LinearDistance);
|
||||||
.WithVariation(0.01f)
|
|
||||||
.WithLoop(true)
|
|
||||||
.WithAttenuation(Attenuation.LinearDistance)
|
|
||||||
.WithMaxDistance(7f);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How many times we can be playing 1 particular sound at once.
|
/// How many times we can be playing 1 particular sound at once.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int MaxSingleSound => (int) (_maxAmbientCount / (16.0f / 6.0f));
|
private int MaxSingleSound => (int) (_maxAmbientCount / (16.0f / 6.0f));
|
||||||
|
|
||||||
private readonly Dictionary<AmbientSoundComponent, (EntityUid? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
|
private readonly Dictionary<Entity<AmbientSoundComponent>, (IPlayingAudioStream? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
|
||||||
private readonly Dictionary<string, int> _playingCount = new();
|
private readonly Dictionary<string, int> _playingCount = new();
|
||||||
|
|
||||||
public bool OverlayEnabled
|
public bool OverlayEnabled
|
||||||
@@ -107,10 +98,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
|
|
||||||
private void OnShutdown(EntityUid uid, AmbientSoundComponent component, ComponentShutdown args)
|
private void OnShutdown(EntityUid uid, AmbientSoundComponent component, ComponentShutdown args)
|
||||||
{
|
{
|
||||||
if (!_playingSounds.Remove(component, out var sound))
|
if (!_playingSounds.Remove((uid, component), out var sound))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_audio.Stop(sound.Stream);
|
sound.Stream?.Stop();
|
||||||
_playingCount[sound.Path] -= 1;
|
_playingCount[sound.Path] -= 1;
|
||||||
if (_playingCount[sound.Path] == 0)
|
if (_playingCount[sound.Path] == 0)
|
||||||
_playingCount.Remove(sound.Path);
|
_playingCount.Remove(sound.Path);
|
||||||
@@ -120,13 +111,13 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
{
|
{
|
||||||
_ambienceVolume = value;
|
_ambienceVolume = value;
|
||||||
|
|
||||||
foreach (var (comp, values) in _playingSounds)
|
foreach (var ((_, comp), values) in _playingSounds)
|
||||||
{
|
{
|
||||||
if (values.Stream == null)
|
if (values.Stream == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var stream = values.Stream;
|
var stream = (AudioSystem.PlayingStream) values.Stream;
|
||||||
_audio.SetVolume(stream, _params.Volume + comp.Volume + _ambienceVolume);
|
stream.Volume = _params.Volume + comp.Volume + _ambienceVolume;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void SetCooldown(float value) => _cooldown = value;
|
private void SetCooldown(float value) => _cooldown = value;
|
||||||
@@ -186,7 +177,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
{
|
{
|
||||||
foreach (var (stream, _, _) in _playingSounds.Values)
|
foreach (var (stream, _, _) in _playingSounds.Values)
|
||||||
{
|
{
|
||||||
_audio.Stop(stream);
|
stream?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
_playingSounds.Clear();
|
_playingSounds.Clear();
|
||||||
@@ -195,7 +186,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
|
|
||||||
private readonly struct QueryState
|
private readonly struct QueryState
|
||||||
{
|
{
|
||||||
public readonly Dictionary<string, List<(float Importance, AmbientSoundComponent)>> SourceDict = new();
|
public readonly Dictionary<string, List<(float Importance, Entity<AmbientSoundComponent>)>> SourceDict = new();
|
||||||
public readonly Vector2 MapPos;
|
public readonly Vector2 MapPos;
|
||||||
public readonly TransformComponent Player;
|
public readonly TransformComponent Player;
|
||||||
public readonly EntityQuery<TransformComponent> Query;
|
public readonly EntityQuery<TransformComponent> Query;
|
||||||
@@ -233,7 +224,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
|
|
||||||
// Prioritize far away & loud sounds.
|
// Prioritize far away & loud sounds.
|
||||||
var importance = range * (ambientComp.Volume + 32);
|
var importance = range * (ambientComp.Volume + 32);
|
||||||
state.SourceDict.GetOrNew(key).Add((importance, ambientComp));
|
state.SourceDict.GetOrNew(key).Add((importance, (ambientComp.Owner, ambientComp)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,9 +238,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
var mapPos = playerXform.MapPosition;
|
var mapPos = playerXform.MapPosition;
|
||||||
|
|
||||||
// Remove out-of-range ambiences
|
// Remove out-of-range ambiences
|
||||||
foreach (var (comp, sound) in _playingSounds)
|
foreach (var (ent, sound) in _playingSounds)
|
||||||
{
|
{
|
||||||
var entity = comp.Owner;
|
var entity = ent.Owner;
|
||||||
|
var comp = ent.Comp;
|
||||||
|
|
||||||
if (comp.Enabled &&
|
if (comp.Enabled &&
|
||||||
// Don't keep playing sounds that have changed since.
|
// Don't keep playing sounds that have changed since.
|
||||||
@@ -266,8 +258,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_audio.Stop(sound.Stream);
|
sound.Stream?.Stop();
|
||||||
_playingSounds.Remove(comp);
|
_playingSounds.Remove((entity, comp));
|
||||||
_playingCount[sound.Path] -= 1;
|
_playingCount[sound.Path] -= 1;
|
||||||
if (_playingCount[sound.Path] == 0)
|
if (_playingCount[sound.Path] == 0)
|
||||||
_playingCount.Remove(sound.Path);
|
_playingCount.Remove(sound.Path);
|
||||||
@@ -292,11 +284,12 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
|
|
||||||
sources.Sort(static (a, b) => b.Importance.CompareTo(a.Importance));
|
sources.Sort(static (a, b) => b.Importance.CompareTo(a.Importance));
|
||||||
|
|
||||||
foreach (var (_, comp) in sources)
|
foreach (var (_, ent) in sources)
|
||||||
{
|
{
|
||||||
var uid = comp.Owner;
|
var uid = ent.Owner;
|
||||||
|
var comp = ent.Comp;
|
||||||
|
|
||||||
if (_playingSounds.ContainsKey(comp) ||
|
if (_playingSounds.ContainsKey(ent) ||
|
||||||
metaQuery.GetComponent(uid).EntityPaused)
|
metaQuery.GetComponent(uid).EntityPaused)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -306,8 +299,11 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
|
|||||||
.WithPlayOffset(_random.NextFloat(0.0f, 100.0f))
|
.WithPlayOffset(_random.NextFloat(0.0f, 100.0f))
|
||||||
.WithMaxDistance(comp.Range);
|
.WithMaxDistance(comp.Range);
|
||||||
|
|
||||||
var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams);
|
var stream = _audio.PlayPvs(comp.Sound, uid, audioParams);
|
||||||
_playingSounds[comp] = (stream.Value.Entity, comp.Sound, key);
|
if (stream == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_playingSounds[ent] = (stream, comp.Sound, key);
|
||||||
playingCount++;
|
playingCount++;
|
||||||
|
|
||||||
if (_playingSounds.Count >= _maxAmbientCount)
|
if (_playingSounds.Count >= _maxAmbientCount)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Client;
|
using Robust.Client;
|
||||||
using Robust.Client.State;
|
using Robust.Client.State;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
|
|||||||
|
|
||||||
private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
|
private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
|
||||||
|
|
||||||
private EntityUid? _lobbyStream;
|
private IPlayingAudioStream? _lobbyStream;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -119,11 +118,12 @@ public sealed class BackgroundAudioSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
_lobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
|
_lobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
|
||||||
_lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)))?.Entity;
|
_lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EndLobbyMusic()
|
private void EndLobbyMusic()
|
||||||
{
|
{
|
||||||
_lobbyStream = _audio.Stop(_lobbyStream);
|
_lobbyStream?.Stop();
|
||||||
|
_lobbyStream = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
@@ -15,11 +14,11 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
|
|
||||||
// Admin music
|
// Admin music
|
||||||
private bool _adminAudioEnabled = true;
|
private bool _adminAudioEnabled = true;
|
||||||
private List<EntityUid?> _adminAudio = new(1);
|
private List<IPlayingAudioStream?> _adminAudio = new(1);
|
||||||
|
|
||||||
// Event sounds (e.g. nuke timer)
|
// Event sounds (e.g. nuke timer)
|
||||||
private bool _eventAudioEnabled = true;
|
private bool _eventAudioEnabled = true;
|
||||||
private Dictionary<StationEventMusicType, EntityUid?> _eventAudio = new(1);
|
private Dictionary<StationEventMusicType, IPlayingAudioStream?> _eventAudio = new(1);
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -50,13 +49,13 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
{
|
{
|
||||||
foreach (var stream in _adminAudio)
|
foreach (var stream in _adminAudio)
|
||||||
{
|
{
|
||||||
_audio.Stop(stream);
|
stream?.Stop();
|
||||||
}
|
}
|
||||||
_adminAudio.Clear();
|
_adminAudio.Clear();
|
||||||
|
|
||||||
foreach (var stream in _eventAudio.Values)
|
foreach (var (_, stream) in _eventAudio)
|
||||||
{
|
{
|
||||||
_audio.Stop(stream);
|
stream?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
_eventAudio.Clear();
|
_eventAudio.Clear();
|
||||||
@@ -67,7 +66,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
if(!_adminAudioEnabled) return;
|
if(!_adminAudioEnabled) return;
|
||||||
|
|
||||||
var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
|
var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
|
||||||
_adminAudio.Add(stream.Value.Entity);
|
_adminAudio.Add(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
|
private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
|
||||||
@@ -76,7 +75,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;
|
if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;
|
||||||
|
|
||||||
var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
|
var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
|
||||||
_eventAudio.Add(soundEvent.Type, stream.Value.Entity);
|
_eventAudio.Add(soundEvent.Type, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayGameSound(GameGlobalSoundEvent soundEvent)
|
private void PlayGameSound(GameGlobalSoundEvent soundEvent)
|
||||||
@@ -86,10 +85,8 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
|
|
||||||
private void StopStationEventMusic(StopStationEventMusic soundEvent)
|
private void StopStationEventMusic(StopStationEventMusic soundEvent)
|
||||||
{
|
{
|
||||||
if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream))
|
if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream)) return;
|
||||||
return;
|
stream?.Stop();
|
||||||
|
|
||||||
_audio.Stop(stream);
|
|
||||||
_eventAudio.Remove(soundEvent.Type);
|
_eventAudio.Remove(soundEvent.Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +96,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
if (_adminAudioEnabled) return;
|
if (_adminAudioEnabled) return;
|
||||||
foreach (var stream in _adminAudio)
|
foreach (var stream in _adminAudio)
|
||||||
{
|
{
|
||||||
_audio.Stop(stream);
|
stream?.Stop();
|
||||||
}
|
}
|
||||||
_adminAudio.Clear();
|
_adminAudio.Clear();
|
||||||
}
|
}
|
||||||
@@ -110,7 +107,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
|
|||||||
if (_eventAudioEnabled) return;
|
if (_eventAudioEnabled) return;
|
||||||
foreach (var stream in _eventAudio)
|
foreach (var stream in _eventAudio)
|
||||||
{
|
{
|
||||||
_audio.Stop(stream.Value);
|
stream.Value?.Stop();
|
||||||
}
|
}
|
||||||
_eventAudio.Clear();
|
_eventAudio.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,10 @@ using Robust.Client.Player;
|
|||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Client.State;
|
using Robust.Client.State;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.ResourceManagement.ResourceTypes;
|
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
@@ -26,7 +24,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IPlayerManager _player = default!;
|
[Dependency] private readonly IPlayerManager _player = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resource = default!;
|
[Dependency] private readonly IResourceCache _resource = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly IStateManager _state = default!;
|
[Dependency] private readonly IStateManager _state = default!;
|
||||||
[Dependency] private readonly RulesSystem _rules = default!;
|
[Dependency] private readonly RulesSystem _rules = default!;
|
||||||
@@ -41,7 +39,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
// Don't need to worry about this being serializable or pauseable as it doesn't affect the sim.
|
// Don't need to worry about this being serializable or pauseable as it doesn't affect the sim.
|
||||||
private TimeSpan _nextAudio;
|
private TimeSpan _nextAudio;
|
||||||
|
|
||||||
private EntityUid? _ambientMusicStream;
|
private AudioSystem.PlayingStream? _ambientMusicStream;
|
||||||
private AmbientMusicPrototype? _musicProto;
|
private AmbientMusicPrototype? _musicProto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,7 +83,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
|
|
||||||
if (_ambientMusicStream != null && _musicProto != null)
|
if (_ambientMusicStream != null && _musicProto != null)
|
||||||
{
|
{
|
||||||
_audio.SetVolume(_ambientMusicStream, _musicProto.Sound.Params.Volume + _volumeSlider);
|
_ambientMusicStream.Volume = _musicProto.Sound.Params.Volume + _volumeSlider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +92,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
_configManager.UnsubValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged);
|
_configManager.UnsubValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged);
|
||||||
_proto.PrototypesReloaded -= OnProtoReload;
|
_proto.PrototypesReloaded -= OnProtoReload;
|
||||||
_state.OnStateChanged -= OnStateChange;
|
_state.OnStateChanged -= OnStateChange;
|
||||||
_ambientMusicStream = _audio.Stop(_ambientMusicStream);
|
_ambientMusicStream?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
||||||
@@ -131,7 +129,8 @@ public sealed partial class ContentAudioSystem
|
|||||||
private void OnRoundEndMessage(RoundEndMessageEvent ev)
|
private void OnRoundEndMessage(RoundEndMessageEvent ev)
|
||||||
{
|
{
|
||||||
// If scoreboard shows then just stop the music
|
// If scoreboard shows then just stop the music
|
||||||
_ambientMusicStream = _audio.Stop(_ambientMusicStream);
|
_ambientMusicStream?.Stop();
|
||||||
|
_ambientMusicStream = null;
|
||||||
_nextAudio = TimeSpan.FromMinutes(3);
|
_nextAudio = TimeSpan.FromMinutes(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +170,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDone = !Exists(_ambientMusicStream);
|
var isDone = _ambientMusicStream?.Done;
|
||||||
|
|
||||||
if (_interruptable)
|
if (_interruptable)
|
||||||
{
|
{
|
||||||
@@ -179,7 +178,7 @@ public sealed partial class ContentAudioSystem
|
|||||||
|
|
||||||
if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(_musicProto.Rules)))
|
if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(_musicProto.Rules)))
|
||||||
{
|
{
|
||||||
FadeOut(_ambientMusicStream, duration: AmbientMusicFadeTime);
|
FadeOut(_ambientMusicStream, AmbientMusicFadeTime);
|
||||||
_musicProto = null;
|
_musicProto = null;
|
||||||
_interruptable = false;
|
_interruptable = false;
|
||||||
isDone = true;
|
isDone = true;
|
||||||
@@ -222,11 +221,14 @@ public sealed partial class ContentAudioSystem
|
|||||||
false,
|
false,
|
||||||
AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));
|
AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));
|
||||||
|
|
||||||
_ambientMusicStream = strim.Value.Entity;
|
if (strim != null)
|
||||||
|
{
|
||||||
|
_ambientMusicStream = (AudioSystem.PlayingStream) strim;
|
||||||
|
|
||||||
if (_musicProto.FadeIn)
|
if (_musicProto.FadeIn)
|
||||||
{
|
{
|
||||||
FadeIn(_ambientMusicStream, strim.Value.Component, AmbientMusicFadeTime);
|
FadeIn(_ambientMusicStream, AmbientMusicFadeTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh the list
|
// Refresh the list
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
|
|
||||||
|
|
||||||
namespace Content.Client.Audio;
|
namespace Content.Client.Audio;
|
||||||
|
|
||||||
public sealed partial class ContentAudioSystem : SharedContentAudioSystem
|
public sealed partial class ContentAudioSystem : SharedContentAudioSystem
|
||||||
{
|
{
|
||||||
// Need how much volume to change per tick and just remove it when it drops below "0"
|
// Need how much volume to change per tick and just remove it when it drops below "0"
|
||||||
private readonly Dictionary<EntityUid, float> _fadingOut = new();
|
private readonly Dictionary<AudioSystem.PlayingStream, float> _fadingOut = new();
|
||||||
|
|
||||||
// Need volume change per tick + target volume.
|
// Need volume change per tick + target volume.
|
||||||
private readonly Dictionary<EntityUid, (float VolumeChange, float TargetVolume)> _fadingIn = new();
|
private readonly Dictionary<AudioSystem.PlayingStream, (float VolumeChange, float TargetVolume)> _fadingIn = new();
|
||||||
|
|
||||||
private readonly List<EntityUid> _fadeToRemove = new();
|
private readonly List<AudioSystem.PlayingStream> _fadeToRemove = new();
|
||||||
|
|
||||||
private const float MinVolume = -32f;
|
private const float MinVolume = -32f;
|
||||||
private const float DefaultDuration = 2f;
|
private const float DefaultDuration = 2f;
|
||||||
@@ -44,28 +42,28 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
|
|||||||
|
|
||||||
#region Fades
|
#region Fades
|
||||||
|
|
||||||
public void FadeOut(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
|
public void FadeOut(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
|
||||||
{
|
{
|
||||||
if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component))
|
if (stream == null || duration <= 0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Just in case
|
// Just in case
|
||||||
// TODO: Maybe handle the removals by making it seamless?
|
// TODO: Maybe handle the removals by making it seamless?
|
||||||
_fadingIn.Remove(stream.Value);
|
_fadingIn.Remove(stream);
|
||||||
var diff = component.Volume - MinVolume;
|
var diff = stream.Volume - MinVolume;
|
||||||
_fadingOut.Add(stream.Value, diff / duration);
|
_fadingOut.Add(stream, diff / duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FadeIn(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
|
public void FadeIn(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
|
||||||
{
|
{
|
||||||
if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component) || component.Volume < MinVolume)
|
if (stream == null || duration <= 0f || stream.Volume < MinVolume)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_fadingOut.Remove(stream.Value);
|
_fadingOut.Remove(stream);
|
||||||
var curVolume = component.Volume;
|
var curVolume = stream.Volume;
|
||||||
var change = (curVolume - MinVolume) / duration;
|
var change = (curVolume - MinVolume) / duration;
|
||||||
_fadingIn.Add(stream.Value, (change, component.Volume));
|
_fadingIn.Add(stream, (change, stream.Volume));
|
||||||
component.Volume = MinVolume;
|
stream.Volume = MinVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateFades(float frameTime)
|
private void UpdateFades(float frameTime)
|
||||||
@@ -74,18 +72,19 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
|
|||||||
|
|
||||||
foreach (var (stream, change) in _fadingOut)
|
foreach (var (stream, change) in _fadingOut)
|
||||||
{
|
{
|
||||||
if (!TryComp(stream, out AudioComponent? component))
|
// Cancelled elsewhere
|
||||||
|
if (stream.Done)
|
||||||
{
|
{
|
||||||
_fadeToRemove.Add(stream);
|
_fadeToRemove.Add(stream);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var volume = component.Volume - change * frameTime;
|
var volume = stream.Volume - change * frameTime;
|
||||||
component.Volume = MathF.Max(MinVolume, volume);
|
stream.Volume = MathF.Max(MinVolume, volume);
|
||||||
|
|
||||||
if (component.Volume.Equals(MinVolume))
|
if (stream.Volume.Equals(MinVolume))
|
||||||
{
|
{
|
||||||
_audio.Stop(stream);
|
stream.Stop();
|
||||||
_fadeToRemove.Add(stream);
|
_fadeToRemove.Add(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,16 +99,16 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
|
|||||||
foreach (var (stream, (change, target)) in _fadingIn)
|
foreach (var (stream, (change, target)) in _fadingIn)
|
||||||
{
|
{
|
||||||
// Cancelled elsewhere
|
// Cancelled elsewhere
|
||||||
if (!TryComp(stream, out AudioComponent? component))
|
if (stream.Done)
|
||||||
{
|
{
|
||||||
_fadeToRemove.Add(stream);
|
_fadeToRemove.Add(stream);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var volume = component.Volume + change * frameTime;
|
var volume = stream.Volume + change * frameTime;
|
||||||
component.Volume = MathF.Min(target, volume);
|
stream.Volume = MathF.Min(target, volume);
|
||||||
|
|
||||||
if (component.Volume.Equals(target))
|
if (stream.Volume.Equals(target))
|
||||||
{
|
{
|
||||||
_fadeToRemove.Add(stream);
|
_fadeToRemove.Add(stream);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ using Robust.Client.ResourceManagement;
|
|||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using static Content.Client.Changelog.ChangelogManager;
|
using static Content.Client.Changelog.ChangelogManager;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
@@ -18,7 +17,7 @@ namespace Content.Client.Changelog;
|
|||||||
public sealed partial class ChangelogTab : Control
|
public sealed partial class ChangelogTab : Control
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ChangelogManager _changelog = default!;
|
[Dependency] private readonly ChangelogManager _changelog = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public bool AdminOnly;
|
public bool AdminOnly;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Content.Client.Clickable
|
|||||||
private const float Threshold = 0.25f;
|
private const float Threshold = 0.25f;
|
||||||
private const int ClickRadius = 2;
|
private const int ClickRadius = 2;
|
||||||
|
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private readonly Dictionary<Texture, ClickMap> _textureMaps = new();
|
private readonly Dictionary<Texture, ClickMap> _textureMaps = new();
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
|||||||
{"suitstorage", "SUITSTORAGE"},
|
{"suitstorage", "SUITSTORAGE"},
|
||||||
};
|
};
|
||||||
|
|
||||||
[Dependency] private readonly IClientResourceCache _cache = default!;
|
[Dependency] private readonly IResourceCache _cache = default!;
|
||||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
@@ -24,7 +23,7 @@ namespace Content.Client.Credits
|
|||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class CreditsWindow : DefaultWindow
|
public sealed partial class CreditsWindow : DefaultWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IResourceManager _resourceManager = default!;
|
[Dependency] private readonly IResourceCache _resourceManager = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
|
|
||||||
private static readonly Dictionary<string, int> PatronTierPriority = new()
|
private static readonly Dictionary<string, int> PatronTierPriority = new()
|
||||||
@@ -50,7 +49,7 @@ namespace Content.Client.Credits
|
|||||||
|
|
||||||
private void PopulateLicenses(BoxContainer licensesContainer)
|
private void PopulateLicenses(BoxContainer licensesContainer)
|
||||||
{
|
{
|
||||||
foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name))
|
foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
|
||||||
{
|
{
|
||||||
licensesContainer.AddChild(new Label {StyleClasses = {StyleBase.StyleClassLabelHeading}, Text = entry.Name});
|
licensesContainer.AddChild(new Label {StyleClasses = {StyleBase.StyleClassLabelHeading}, Text = entry.Name});
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Client.Decals.UI;
|
|||||||
public sealed partial class PaletteColorPicker : DefaultWindow
|
public sealed partial class PaletteColorPicker : DefaultWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
private readonly TextureResource _tex;
|
private readonly TextureResource _tex;
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ using Content.Shared.Emag.Systems;
|
|||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Animations;
|
using Robust.Client.Animations;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent;
|
using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public sealed class DoorSystem : SharedDoorSystem
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
|
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -138,6 +138,6 @@ public sealed class DoorSystem : SharedDoorSystem
|
|||||||
protected override void PlaySound(EntityUid uid, SoundSpecifier soundSpecifier, AudioParams audioParams, EntityUid? predictingPlayer, bool predicted)
|
protected override void PlaySound(EntityUid uid, SoundSpecifier soundSpecifier, AudioParams audioParams, EntityUid? predictingPlayer, bool predicted)
|
||||||
{
|
{
|
||||||
if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted)
|
if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted)
|
||||||
Audio.PlayEntity(soundSpecifier, Filter.Local(), uid, false, audioParams);
|
Audio.Play(soundSpecifier, Filter.Local(), uid, false, audioParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Content.Client.Explosion;
|
|||||||
public sealed class ExplosionOverlaySystem : EntitySystem
|
public sealed class ExplosionOverlaySystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resCache = default!;
|
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||||
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
||||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
|
|||||||
public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
|
public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
|
||||||
public Action<NetEntity>? OnFollowFax;
|
public Action<NetEntity>? OnFollowFax;
|
||||||
|
|
||||||
[Dependency] private readonly IClientResourceCache _resCache = default!;
|
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||||
|
|
||||||
public AdminFaxWindow()
|
public AdminFaxWindow()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public sealed class PuddleOverlay : Overlay
|
|||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
_debugOverlaySystem = _entitySystemManager.GetEntitySystem<PuddleDebugOverlaySystem>();
|
_debugOverlaySystem = _entitySystemManager.GetEntitySystem<PuddleDebugOverlaySystem>();
|
||||||
var cache = IoCManager.Resolve<IClientResourceCache>();
|
var cache = IoCManager.Resolve<IResourceCache>();
|
||||||
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ using Content.Shared.GameWindow;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.State;
|
using Robust.Client.State;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using Content.Shared.Camera;
|
|||||||
using Content.Shared.Gravity;
|
using Content.Shared.Gravity;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ using Content.Shared.Tag;
|
|||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Content.Client.Info
|
|||||||
{
|
{
|
||||||
public sealed class RulesAndInfoWindow : DefaultWindow
|
public sealed class RulesAndInfoWindow : DefaultWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IResourceManager _resourceManager = default!;
|
[Dependency] private readonly IResourceCache _resourceManager = default!;
|
||||||
[Dependency] private readonly RulesManager _rules = default!;
|
[Dependency] private readonly RulesManager _rules = default!;
|
||||||
|
|
||||||
public RulesAndInfoWindow()
|
public RulesAndInfoWindow()
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
|
||||||
namespace Content.Client.IoC
|
namespace Content.Client.IoC
|
||||||
{
|
{
|
||||||
public static class StaticIoC
|
public static class StaticIoC
|
||||||
{
|
{
|
||||||
public static IClientResourceCache ResC => IoCManager.Resolve<IClientResourceCache>();
|
public static IResourceCache ResC => IoCManager.Resolve<IResourceCache>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Client.Items.Systems;
|
|||||||
|
|
||||||
public sealed class ItemSystem : SharedItemSystem
|
public sealed class ItemSystem : SharedItemSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resCache = default!;
|
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public sealed partial class ExpendableLightComponent : SharedExpendableLightComp
|
|||||||
/// The sound that plays when the expendable light is lit.
|
/// The sound that plays when the expendable light is lit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Access(typeof(ExpendableLightSystem))]
|
[Access(typeof(ExpendableLightSystem))]
|
||||||
public EntityUid? PlayingStream;
|
public IPlayingAudioStream? PlayingStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ExpendableLightVisualLayers : byte
|
public enum ExpendableLightVisualLayers : byte
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ using Content.Client.Light.Components;
|
|||||||
using Content.Shared.Light.Components;
|
using Content.Shared.Light.Components;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
|
|
||||||
namespace Content.Client.Light.EntitySystems;
|
namespace Content.Client.Light.EntitySystems;
|
||||||
|
|
||||||
@@ -21,7 +19,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
|
|
||||||
private void OnLightShutdown(EntityUid uid, ExpendableLightComponent component, ComponentShutdown args)
|
private void OnLightShutdown(EntityUid uid, ExpendableLightComponent component, ComponentShutdown args)
|
||||||
{
|
{
|
||||||
component.PlayingStream = _audioSystem.Stop(component.PlayingStream);
|
component.PlayingStream?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnAppearanceChange(EntityUid uid, ExpendableLightComponent comp, ref AppearanceChangeEvent args)
|
protected override void OnAppearanceChange(EntityUid uid, ExpendableLightComponent comp, ref AppearanceChangeEvent args)
|
||||||
@@ -50,10 +48,12 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ExpendableLightState.Lit:
|
case ExpendableLightState.Lit:
|
||||||
_audioSystem.Stop(comp.PlayingStream);
|
comp.PlayingStream?.Stop();
|
||||||
comp.PlayingStream = _audioSystem.PlayPvs(
|
comp.PlayingStream = _audioSystem.PlayPvs(
|
||||||
comp.LoopedSound, uid, SharedExpendableLightComponent.LoopedSoundParams)?.Entity;
|
comp.LoopedSound,
|
||||||
|
uid,
|
||||||
|
SharedExpendableLightComponent.LoopedSoundParams
|
||||||
|
);
|
||||||
if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
|
if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
|
if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
|
||||||
@@ -73,7 +73,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case ExpendableLightState.Dead:
|
case ExpendableLightState.Dead:
|
||||||
comp.PlayingStream = _audioSystem.Stop(comp.PlayingStream);
|
comp.PlayingStream?.Stop();
|
||||||
if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out layerIdx, true))
|
if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out layerIdx, true))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
|
if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ using Content.Shared.Light;
|
|||||||
using Robust.Client.Animations;
|
using Robust.Client.Animations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Animations;
|
using Robust.Shared.Animations;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Client.Light.Visualizers;
|
namespace Content.Client.Light.Visualizers;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using Robust.Client.UserInterface;
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.ResourceManagement.ResourceTypes;
|
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ namespace Content.Client.Lobby
|
|||||||
[Dependency] private readonly IBaseClient _baseClient = default!;
|
[Dependency] private readonly IBaseClient _baseClient = default!;
|
||||||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||||
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
|
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Content.Client.MainMenu
|
|||||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||||
[Dependency] private readonly IGameController _controllerProxy = default!;
|
[Dependency] private readonly IGameController _controllerProxy = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||||
|
|
||||||
private MainMenuControl _mainMenuControl = default!;
|
private MainMenuControl _mainMenuControl = default!;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Content.Client.MainMenu.UI;
|
|||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class MainMenuControl : Control
|
public sealed partial class MainMenuControl : Control
|
||||||
{
|
{
|
||||||
public MainMenuControl(IClientResourceCache resCache, IConfigurationManager configMan)
|
public MainMenuControl(IResourceCache resCache, IConfigurationManager configMan)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public sealed class HTNOverlay : Overlay
|
|||||||
|
|
||||||
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
||||||
|
|
||||||
public HTNOverlay(IEntityManager entManager, IClientResourceCache resourceCache)
|
public HTNOverlay(IEntityManager entManager, IResourceCache resourceCache)
|
||||||
{
|
{
|
||||||
_entManager = entManager;
|
_entManager = entManager;
|
||||||
_font = new VectorFont(resourceCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);
|
_font = new VectorFont(resourceCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public sealed class HTNSystem : EntitySystem
|
|||||||
|
|
||||||
if (_enableOverlay)
|
if (_enableOverlay)
|
||||||
{
|
{
|
||||||
overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve<IClientResourceCache>()));
|
overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve<IResourceCache>()));
|
||||||
RaiseNetworkEvent(new RequestHTNMessage()
|
RaiseNetworkEvent(new RequestHTNMessage()
|
||||||
{
|
{
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Content.Client.NPC
|
|||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _cache = default!;
|
[Dependency] private readonly IResourceCache _cache = default!;
|
||||||
[Dependency] private readonly NPCSteeringSystem _steering = default!;
|
[Dependency] private readonly NPCSteeringSystem _steering = default!;
|
||||||
[Dependency] private readonly MapSystem _mapSystem = default!;
|
[Dependency] private readonly MapSystem _mapSystem = default!;
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ namespace Content.Client.NPC
|
|||||||
IEyeManager eyeManager,
|
IEyeManager eyeManager,
|
||||||
IInputManager inputManager,
|
IInputManager inputManager,
|
||||||
IMapManager mapManager,
|
IMapManager mapManager,
|
||||||
IClientResourceCache cache,
|
IResourceCache cache,
|
||||||
PathfindingSystem system,
|
PathfindingSystem system,
|
||||||
MapSystem mapSystem)
|
MapSystem mapSystem)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Content.Client.NodeContainer
|
|||||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public bool VisEnabled { get; private set; }
|
public bool VisEnabled { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Client.NodeContainer
|
|||||||
EntityLookupSystem lookup,
|
EntityLookupSystem lookup,
|
||||||
IMapManager mapManager,
|
IMapManager mapManager,
|
||||||
IInputManager inputManager,
|
IInputManager inputManager,
|
||||||
IClientResourceCache cache,
|
IResourceCache cache,
|
||||||
IEntityManager entityManager)
|
IEntityManager entityManager)
|
||||||
{
|
{
|
||||||
_system = system;
|
_system = system;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Robust.Client.Audio;
|
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
@@ -16,14 +14,13 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
public sealed partial class AudioTab : Control
|
public sealed partial class AudioTab : Control
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
private readonly AudioSystem _audio;
|
[Dependency] private readonly IClydeAudio _clydeAudio = default!;
|
||||||
|
|
||||||
public AudioTab()
|
public AudioTab()
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
_audio = IoCManager.Resolve<IEntityManager>().System<AudioSystem>();
|
|
||||||
LobbyMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.LobbyMusicEnabled);
|
LobbyMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.LobbyMusicEnabled);
|
||||||
RestartSoundsCheckBox.Pressed = _cfg.GetCVar(CCVars.RestartSoundsEnabled);
|
RestartSoundsCheckBox.Pressed = _cfg.GetCVar(CCVars.RestartSoundsEnabled);
|
||||||
EventMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.EventMusicEnabled);
|
EventMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.EventMusicEnabled);
|
||||||
@@ -82,7 +79,7 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
|
|
||||||
private void OnMasterVolumeSliderChanged(Range range)
|
private void OnMasterVolumeSliderChanged(Range range)
|
||||||
{
|
{
|
||||||
_audio.SetMasterVolume(MasterVolumeSlider.Value / 100);
|
_clydeAudio.SetMasterVolume(MasterVolumeSlider.Value / 100);
|
||||||
UpdateChanges();
|
UpdateChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +108,7 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
|
|
||||||
private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
|
private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
_cfg.SetCVar(CVars.AudioMasterVolume, LV100ToDB(MasterVolumeSlider.Value, CCVars.MasterMultiplier));
|
_cfg.SetCVar(CVars.AudioMasterVolume, MasterVolumeSlider.Value / 100);
|
||||||
// Want the CVar updated values to have the multiplier applied
|
// Want the CVar updated values to have the multiplier applied
|
||||||
// For the UI we just display 0-100 still elsewhere
|
// For the UI we just display 0-100 still elsewhere
|
||||||
_cfg.SetCVar(CVars.MidiVolume, LV100ToDB(MidiVolumeSlider.Value, CCVars.MidiMultiplier));
|
_cfg.SetCVar(CVars.MidiVolume, LV100ToDB(MidiVolumeSlider.Value, CCVars.MidiMultiplier));
|
||||||
@@ -135,7 +132,7 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
|
|
||||||
private void Reset()
|
private void Reset()
|
||||||
{
|
{
|
||||||
MasterVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier);
|
MasterVolumeSlider.Value = _cfg.GetCVar(CVars.AudioMasterVolume) * 100;
|
||||||
MidiVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier);
|
MidiVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier);
|
||||||
AmbienceVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CCVars.AmbienceVolume), CCVars.AmbienceMultiplier);
|
AmbienceVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CCVars.AmbienceVolume), CCVars.AmbienceMultiplier);
|
||||||
AmbientMusicVolumeSlider.Value =
|
AmbientMusicVolumeSlider.Value =
|
||||||
@@ -153,8 +150,8 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
// Do be sure to rename the setting though
|
// Do be sure to rename the setting though
|
||||||
private float DBToLV100(float db, float multiplier = 1f)
|
private float DBToLV100(float db, float multiplier = 1f)
|
||||||
{
|
{
|
||||||
var beri = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
|
var weh = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
|
||||||
return beri;
|
return weh;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float LV100ToDB(float lv100, float multiplier = 1f)
|
private float LV100ToDB(float lv100, float multiplier = 1f)
|
||||||
@@ -167,7 +164,7 @@ namespace Content.Client.Options.UI.Tabs
|
|||||||
private void UpdateChanges()
|
private void UpdateChanges()
|
||||||
{
|
{
|
||||||
var isMasterVolumeSame =
|
var isMasterVolumeSame =
|
||||||
Math.Abs(MasterVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier)) < 0.01f;
|
Math.Abs(MasterVolumeSlider.Value - _cfg.GetCVar(CVars.AudioMasterVolume) * 100) < 0.01f;
|
||||||
var isMidiVolumeSame =
|
var isMidiVolumeSame =
|
||||||
Math.Abs(MidiVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier)) < 0.01f;
|
Math.Abs(MidiVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier)) < 0.01f;
|
||||||
var isAmbientVolumeSame =
|
var isAmbientVolumeSame =
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Content.Client.Paper.UI
|
|||||||
// Randomize the placement of any stamps based on the entity UID
|
// Randomize the placement of any stamps based on the entity UID
|
||||||
// so that there's some variety in different papers.
|
// so that there's some variety in different papers.
|
||||||
StampDisplay.PlacementSeed = (int)entity;
|
StampDisplay.PlacementSeed = (int)entity;
|
||||||
var resCache = IoCManager.Resolve<IClientResourceCache>();
|
var resCache = IoCManager.Resolve<IResourceCache>();
|
||||||
|
|
||||||
// Initialize the background:
|
// Initialize the background:
|
||||||
PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate;
|
PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public sealed partial class StampWidget : PanelContainer
|
|||||||
public StampWidget()
|
public StampWidget()
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
var resCache = IoCManager.Resolve<IClientResourceCache>();
|
var resCache = IoCManager.Resolve<IResourceCache>();
|
||||||
var borderImage = resCache.GetResource<TextureResource>(
|
var borderImage = resCache.GetResource<TextureResource>(
|
||||||
"/Textures/Interface/Paper/paper_stamp_border.svg.96dpi.png");
|
"/Textures/Interface/Paper/paper_stamp_border.svg.96dpi.png");
|
||||||
_borderTexture = new StyleBoxTexture {
|
_borderTexture = new StyleBoxTexture {
|
||||||
|
|||||||
@@ -57,17 +57,16 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
|
|||||||
}
|
}
|
||||||
|
|
||||||
var debugParallax = IoCManager.Resolve<IConfigurationManager>().GetCVar(CCVars.ParallaxDebug);
|
var debugParallax = IoCManager.Resolve<IConfigurationManager>().GetCVar(CCVars.ParallaxDebug);
|
||||||
var resManager = IoCManager.Resolve<IResourceManager>();
|
|
||||||
|
|
||||||
if (debugParallax
|
if (debugParallax
|
||||||
|| !resManager.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
|
|| !StaticIoC.ResC.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
|
||||||
|| previousParallaxConfig != parallaxConfig)
|
|| previousParallaxConfig != parallaxConfig)
|
||||||
{
|
{
|
||||||
var table = Toml.ReadString(parallaxConfig);
|
var table = Toml.ReadString(parallaxConfig);
|
||||||
await UpdateCachedTexture(table, debugParallax, cancel);
|
await UpdateCachedTexture(table, debugParallax, cancel);
|
||||||
|
|
||||||
//Update the previous config
|
//Update the previous config
|
||||||
using var writer = resManager.UserData.OpenWriteText(PreviousParallaxConfigPath);
|
using var writer = StaticIoC.ResC.UserData.OpenWriteText(PreviousParallaxConfigPath);
|
||||||
writer.Write(parallaxConfig);
|
writer.Write(parallaxConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Also try to at least sort of fix this if we've been fooled by a config backup
|
// Also try to at least sort of fix this if we've been fooled by a config backup
|
||||||
resManager.UserData.Delete(PreviousParallaxConfigPath);
|
StaticIoC.ResC.UserData.Delete(PreviousParallaxConfigPath);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -105,34 +104,31 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
|
|||||||
// And load it in the main thread for safety reasons.
|
// And load it in the main thread for safety reasons.
|
||||||
// But before spending time saving it, make sure to exit out early if it's not wanted.
|
// But before spending time saving it, make sure to exit out early if it's not wanted.
|
||||||
cancel.ThrowIfCancellationRequested();
|
cancel.ThrowIfCancellationRequested();
|
||||||
var resManager = IoCManager.Resolve<IResourceManager>();
|
|
||||||
|
|
||||||
// Store it and CRC so further game starts don't need to regenerate it.
|
// Store it and CRC so further game starts don't need to regenerate it.
|
||||||
await using var imageStream = resManager.UserData.OpenWrite(ParallaxCachedImagePath);
|
using var imageStream = StaticIoC.ResC.UserData.OpenWrite(ParallaxCachedImagePath);
|
||||||
await newParallexImage.SaveAsPngAsync(imageStream, cancel);
|
newParallexImage.SaveAsPng(imageStream);
|
||||||
|
|
||||||
if (saveDebugLayers)
|
if (saveDebugLayers)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < debugImages!.Count; i++)
|
for (var i = 0; i < debugImages!.Count; i++)
|
||||||
{
|
{
|
||||||
var debugImage = debugImages[i];
|
var debugImage = debugImages[i];
|
||||||
await using var debugImageStream = resManager.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
|
using var debugImageStream = StaticIoC.ResC.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
|
||||||
await debugImage.SaveAsPngAsync(debugImageStream, cancel);
|
debugImage.SaveAsPng(debugImageStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Texture GetCachedTexture()
|
private Texture GetCachedTexture()
|
||||||
{
|
{
|
||||||
var resManager = IoCManager.Resolve<IResourceManager>();
|
using var imageStream = StaticIoC.ResC.UserData.OpenRead(ParallaxCachedImagePath);
|
||||||
using var imageStream = resManager.UserData.OpenRead(ParallaxCachedImagePath);
|
|
||||||
return Texture.LoadFromPNGStream(imageStream, "Parallax");
|
return Texture.LoadFromPNGStream(imageStream, "Parallax");
|
||||||
}
|
}
|
||||||
|
|
||||||
private string? GetParallaxConfig()
|
private string? GetParallaxConfig()
|
||||||
{
|
{
|
||||||
var resManager = IoCManager.Resolve<IResourceManager>();
|
if (!StaticIoC.ResC.TryContentFileRead(ParallaxConfigPath, out var configStream))
|
||||||
if (!resManager.TryContentFileRead(ParallaxConfigPath, out var configStream))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Content.Client.ParticleAccelerator.UI
|
|||||||
_drawNoiseGenerator.SetFractalType(FastNoiseLite.FractalType.FBm);
|
_drawNoiseGenerator.SetFractalType(FastNoiseLite.FractalType.FBm);
|
||||||
_drawNoiseGenerator.SetFrequency(0.5f);
|
_drawNoiseGenerator.SetFrequency(0.5f);
|
||||||
|
|
||||||
var resourceCache = IoCManager.Resolve<IClientResourceCache>();
|
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||||
var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
|
var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
|
||||||
var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
|
var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ namespace Content.Client.ParticleAccelerator.UI
|
|||||||
private readonly TextureRect _unlit;
|
private readonly TextureRect _unlit;
|
||||||
private readonly RSI _rsi;
|
private readonly RSI _rsi;
|
||||||
|
|
||||||
public PASegmentControl(ParticleAcceleratorControlMenu menu, IClientResourceCache cache, string name)
|
public PASegmentControl(ParticleAcceleratorControlMenu menu, IResourceCache cache, string name)
|
||||||
{
|
{
|
||||||
_menu = menu;
|
_menu = menu;
|
||||||
_baseState = name;
|
_baseState = name;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public sealed class NavMapControl : MapGridControl
|
|||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
_transform = _entManager.System<SharedTransformSystem>();
|
_transform = _entManager.System<SharedTransformSystem>();
|
||||||
var cache = IoCManager.Resolve<IClientResourceCache>();
|
var cache = IoCManager.Resolve<IResourceCache>();
|
||||||
_font = new VectorFont(cache.GetResource<FontResource>("/EngineFonts/NotoSans/NotoSans-Regular.ttf"), 16);
|
_font = new VectorFont(cache.GetResource<FontResource>("/EngineFonts/NotoSans/NotoSans-Regular.ttf"), 16);
|
||||||
|
|
||||||
RectClipContent = true;
|
RectClipContent = true;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
IEntityManager entManager,
|
IEntityManager entManager,
|
||||||
IPlayerManager playerMgr,
|
IPlayerManager playerMgr,
|
||||||
IPrototypeManager protoManager,
|
IPrototypeManager protoManager,
|
||||||
IClientResourceCache cache,
|
IResourceCache cache,
|
||||||
IUserInterfaceManager uiManager,
|
IUserInterfaceManager uiManager,
|
||||||
PopupSystem popup)
|
PopupSystem popup)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Content.Client.Popups
|
|||||||
[Dependency] private readonly IOverlayManager _overlay = default!;
|
[Dependency] private readonly IOverlayManager _overlay = default!;
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resource = default!;
|
[Dependency] private readonly IResourceCache _resource = default!;
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
||||||
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
|
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Content.Client.Preferences.UI
|
|||||||
|
|
||||||
public CharacterSetupGui(
|
public CharacterSetupGui(
|
||||||
IEntityManager entityManager,
|
IEntityManager entityManager,
|
||||||
IClientResourceCache resourceCache,
|
IResourceCache resourceCache,
|
||||||
IClientPreferencesManager preferencesManager,
|
IClientPreferencesManager preferencesManager,
|
||||||
IPrototypeManager prototypeManager,
|
IPrototypeManager prototypeManager,
|
||||||
IConfigurationManager configurationManager)
|
IConfigurationManager configurationManager)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public sealed class RadiationDebugOverlay : Overlay
|
|||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
_radiation = _entityManager.System<RadiationSystem>();
|
_radiation = _entityManager.System<RadiationSystem>();
|
||||||
|
|
||||||
var cache = IoCManager.Resolve<IClientResourceCache>();
|
var cache = IoCManager.Resolve<IResourceCache>();
|
||||||
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
_font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ public sealed class ContentReplayPlaybackManager
|
|||||||
{
|
{
|
||||||
case RoundEndMessageEvent:
|
case RoundEndMessageEvent:
|
||||||
case PopupEvent:
|
case PopupEvent:
|
||||||
|
case AudioMessage:
|
||||||
case PickupAnimationEvent:
|
case PickupAnimationEvent:
|
||||||
case MeleeLungeEvent:
|
case MeleeLungeEvent:
|
||||||
case SharedGunSystem.HitscanEvent:
|
case SharedGunSystem.HitscanEvent:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Content.Client.Replay.UI.Loading;
|
|||||||
[Virtual]
|
[Virtual]
|
||||||
public class LoadingScreen<TResult> : State
|
public class LoadingScreen<TResult> : State
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||||
|
|
||||||
public event Action<TResult?, Exception?>? OnJobFinished;
|
public event Action<TResult?, Exception?>? OnJobFinished;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public sealed partial class LoadingScreenControl : Control
|
|||||||
{
|
{
|
||||||
public static SpriteSpecifier Sprite = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Silicon/Bots/mommi.rsi"), "wiggle");
|
public static SpriteSpecifier Sprite = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Silicon/Bots/mommi.rsi"), "wiggle");
|
||||||
|
|
||||||
public LoadingScreenControl(IClientResourceCache resCache)
|
public LoadingScreenControl(IResourceCache resCache)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
|
|
||||||
|
|||||||
@@ -9,27 +9,27 @@ namespace Content.Client.Resources
|
|||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static class ResourceCacheExtensions
|
public static class ResourceCacheExtensions
|
||||||
{
|
{
|
||||||
public static Texture GetTexture(this IClientResourceCache cache, ResPath path)
|
public static Texture GetTexture(this IResourceCache cache, ResPath path)
|
||||||
{
|
{
|
||||||
return cache.GetResource<TextureResource>(path);
|
return cache.GetResource<TextureResource>(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Texture GetTexture(this IClientResourceCache cache, string path)
|
public static Texture GetTexture(this IResourceCache cache, string path)
|
||||||
{
|
{
|
||||||
return GetTexture(cache, new ResPath(path));
|
return GetTexture(cache, new ResPath(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Font GetFont(this IClientResourceCache cache, ResPath path, int size)
|
public static Font GetFont(this IResourceCache cache, ResPath path, int size)
|
||||||
{
|
{
|
||||||
return new VectorFont(cache.GetResource<FontResource>(path), size);
|
return new VectorFont(cache.GetResource<FontResource>(path), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Font GetFont(this IClientResourceCache cache, string path, int size)
|
public static Font GetFont(this IResourceCache cache, string path, int size)
|
||||||
{
|
{
|
||||||
return cache.GetFont(new ResPath(path), size);
|
return cache.GetFont(new ResPath(path), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Font GetFont(this IClientResourceCache cache, ResPath[] path, int size)
|
public static Font GetFont(this IResourceCache cache, ResPath[] path, int size)
|
||||||
{
|
{
|
||||||
var fs = new Font[path.Length];
|
var fs = new Font[path.Length];
|
||||||
for (var i = 0; i < path.Length; i++)
|
for (var i = 0; i < path.Length; i++)
|
||||||
@@ -38,7 +38,7 @@ namespace Content.Client.Resources
|
|||||||
return new StackedFont(fs);
|
return new StackedFont(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Font GetFont(this IClientResourceCache cache, string[] path, int size)
|
public static Font GetFont(this IResourceCache cache, string[] path, int size)
|
||||||
{
|
{
|
||||||
var rp = new ResPath[path.Length];
|
var rp = new ResPath[path.Length];
|
||||||
for (var i = 0; i < path.Length; i++)
|
for (var i = 0; i < path.Length; i++)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Content.Client.SprayPainter;
|
|||||||
|
|
||||||
public sealed class SprayPainterSystem : SharedSprayPainterSystem
|
public sealed class SprayPainterSystem : SharedSprayPainterSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public List<SprayPainterEntry> Entries { get; private set; } = new();
|
public List<SprayPainterEntry> Entries { get; private set; } = new();
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Content.Client.Stylesheets
|
|||||||
protected StyleBoxTexture BaseAngleRect { get; }
|
protected StyleBoxTexture BaseAngleRect { get; }
|
||||||
protected StyleBoxTexture AngleBorderRect { get; }
|
protected StyleBoxTexture AngleBorderRect { get; }
|
||||||
|
|
||||||
protected StyleBase(IClientResourceCache resCache)
|
protected StyleBase(IResourceCache resCache)
|
||||||
{
|
{
|
||||||
var notoSans12 = resCache.GetFont
|
var notoSans12 = resCache.GetFont
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Content.Client.Stylesheets
|
|||||||
{
|
{
|
||||||
public static class ResCacheExtension
|
public static class ResCacheExtension
|
||||||
{
|
{
|
||||||
public static Font NotoStack(this IClientResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
|
public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
|
||||||
{
|
{
|
||||||
var ds = display ? "Display" : "";
|
var ds = display ? "Display" : "";
|
||||||
var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular";
|
var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular";
|
||||||
@@ -144,7 +144,7 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
public override Stylesheet Stylesheet { get; }
|
public override Stylesheet Stylesheet { get; }
|
||||||
|
|
||||||
public StyleNano(IClientResourceCache resCache) : base(resCache)
|
public StyleNano(IResourceCache resCache) : base(resCache)
|
||||||
{
|
{
|
||||||
var notoSans8 = resCache.NotoStack(size: 8);
|
var notoSans8 = resCache.NotoStack(size: 8);
|
||||||
var notoSans10 = resCache.NotoStack(size: 10);
|
var notoSans10 = resCache.NotoStack(size: 10);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
public override Stylesheet Stylesheet { get; }
|
public override Stylesheet Stylesheet { get; }
|
||||||
|
|
||||||
public StyleSpace(IClientResourceCache resCache) : base(resCache)
|
public StyleSpace(IResourceCache resCache) : base(resCache)
|
||||||
{
|
{
|
||||||
var notoSans10 = resCache.GetFont
|
var notoSans10 = resCache.GetFont
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Content.Client.Stylesheets
|
|||||||
public sealed class StylesheetManager : IStylesheetManager
|
public sealed class StylesheetManager : IStylesheetManager
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public Stylesheet SheetNano { get; private set; } = default!;
|
public Stylesheet SheetNano { get; private set; } = default!;
|
||||||
public Stylesheet SheetSpace { get; private set; } = default!;
|
public Stylesheet SheetSpace { get; private set; } = default!;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Content.Client.SurveillanceCamera.UI;
|
|||||||
public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow
|
public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public event Action<string>? CameraSelected;
|
public event Action<string>? CameraSelected;
|
||||||
public event Action<string>? SubnetOpened;
|
public event Action<string>? SubnetOpened;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ using System.Numerics;
|
|||||||
using Content.Shared.Traits.Assorted;
|
using Content.Shared.Traits.Assorted;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client.Traits;
|
namespace Content.Client.Traits;
|
||||||
@@ -42,7 +40,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
|
|||||||
|
|
||||||
private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
|
private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
|
||||||
{
|
{
|
||||||
component.Stream = _audio.Stop(component.Stream);
|
component.Stream?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayParacusiaSounds(EntityUid uid)
|
private void PlayParacusiaSounds(EntityUid uid)
|
||||||
@@ -68,7 +66,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
|
|||||||
var newCoords = Transform(uid).Coordinates.Offset(randomOffset);
|
var newCoords = Transform(uid).Coordinates.Offset(randomOffset);
|
||||||
|
|
||||||
// Play the sound
|
// Play the sound
|
||||||
paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords).Value.Entity;
|
paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Content.Shared.Trigger;
|
using Content.Shared.Trigger;
|
||||||
using Robust.Client.Animations;
|
using Robust.Client.Animations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
namespace Content.Client.Trigger;
|
namespace Content.Client.Trigger;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Content.Client.UserInterface.Controls.FancyTree;
|
|||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class FancyTree : Control
|
public sealed partial class FancyTree : Control
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resCache = default!;
|
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||||
|
|
||||||
public const string StylePropertyLineWidth = "LineWidth";
|
public const string StylePropertyLineWidth = "LineWidth";
|
||||||
public const string StylePropertyLineColor = "LineColor";
|
public const string StylePropertyLineColor = "LineColor";
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
|||||||
private readonly Control _contentContainer;
|
private readonly Control _contentContainer;
|
||||||
|
|
||||||
|
|
||||||
private readonly IClientResourceCache _resourceCache = default!;
|
private readonly IResourceCache _resourceCache = default!;
|
||||||
private readonly RichTextLabel _lblPressure;
|
private readonly RichTextLabel _lblPressure;
|
||||||
private readonly FloatSpinBox _spbPressure;
|
private readonly FloatSpinBox _spbPressure;
|
||||||
private readonly RichTextLabel _lblInternals;
|
private readonly RichTextLabel _lblInternals;
|
||||||
@@ -30,7 +30,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
|||||||
public GasTankWindow(GasTankBoundUserInterface owner)
|
public GasTankWindow(GasTankBoundUserInterface owner)
|
||||||
{
|
{
|
||||||
TextureButton btnClose;
|
TextureButton btnClose;
|
||||||
_resourceCache = IoCManager.Resolve<IClientResourceCache>();
|
_resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
var rootContainer = new LayoutContainer {Name = "GasTankRoot"};
|
var rootContainer = new LayoutContainer {Name = "GasTankRoot"};
|
||||||
AddChild(rootContainer);
|
AddChild(rootContainer);
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ using Robust.Client.UserInterface.Controllers;
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
@@ -35,7 +34,6 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly IClyde _clyde = default!;
|
[Dependency] private readonly IClyde _clyde = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
||||||
[UISystemDependency] private readonly SharedAudioSystem _audio = default!;
|
|
||||||
|
|
||||||
private BwoinkSystem? _bwoinkSystem;
|
private BwoinkSystem? _bwoinkSystem;
|
||||||
private MenuButton? GameAHelpButton => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>()?.AHelpButton;
|
private MenuButton? GameAHelpButton => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>()?.AHelpButton;
|
||||||
@@ -130,7 +128,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
}
|
}
|
||||||
if (localPlayer.UserId != message.TrueSender)
|
if (localPlayer.UserId != message.TrueSender)
|
||||||
{
|
{
|
||||||
_audio.PlayGlobal("/Audio/Effects/adminhelp.ogg", Filter.Local(), false);
|
SoundSystem.Play("/Audio/Effects/adminhelp.ogg", Filter.Local());
|
||||||
_clyde.RequestWindowAttention();
|
_clyde.RequestWindowAttention();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public sealed class ChannelFilterButton : ContainerButton
|
|||||||
public ChannelFilterButton()
|
public ChannelFilterButton()
|
||||||
{
|
{
|
||||||
_chatUIController = UserInterfaceManager.GetUIController<ChatUIController>();
|
_chatUIController = UserInterfaceManager.GetUIController<ChatUIController>();
|
||||||
var filterTexture = IoCManager.Resolve<IClientResourceCache>()
|
var filterTexture = IoCManager.Resolve<IResourceCache>()
|
||||||
.GetTexture("/Textures/Interface/Nano/filter.svg.96dpi.png");
|
.GetTexture("/Textures/Interface/Nano/filter.svg.96dpi.png");
|
||||||
|
|
||||||
// needed for same reason as ChannelSelectorButton
|
// needed for same reason as ChannelSelectorButton
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using Content.Client.UserInterface.Systems.Chat.Controls;
|
using Content.Client.UserInterface.Systems.Chat.Controls;
|
||||||
using Content.Shared.Chat;
|
using Content.Shared.Chat;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Robust.Client.Audio;
|
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
@@ -21,7 +19,6 @@ public partial class ChatBox : UIWidget
|
|||||||
#pragma warning restore RA0003
|
#pragma warning restore RA0003
|
||||||
{
|
{
|
||||||
private readonly ChatUIController _controller;
|
private readonly ChatUIController _controller;
|
||||||
private readonly IEntityManager _entManager;
|
|
||||||
|
|
||||||
public bool Main { get; set; }
|
public bool Main { get; set; }
|
||||||
|
|
||||||
@@ -30,7 +27,6 @@ public partial class ChatBox : UIWidget
|
|||||||
public ChatBox()
|
public ChatBox()
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
|
||||||
|
|
||||||
ChatInput.Input.OnTextEntered += OnTextEntered;
|
ChatInput.Input.OnTextEntered += OnTextEntered;
|
||||||
ChatInput.Input.OnKeyBindDown += OnKeyBindDown;
|
ChatInput.Input.OnKeyBindDown += OnKeyBindDown;
|
||||||
@@ -56,8 +52,8 @@ public partial class ChatBox : UIWidget
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg is { Read: false, AudioPath: { } })
|
if (msg is { Read: false, AudioPath: not null })
|
||||||
_entManager.System<AudioSystem>().PlayGlobal(msg.AudioPath, Filter.Local(), false, AudioParams.Default.WithVolume(msg.AudioVolume));
|
SoundSystem.Play(msg.AudioPath, Filter.Local(), new AudioParams().WithVolume(msg.AudioVolume));
|
||||||
|
|
||||||
msg.Read = true;
|
msg.Read = true;
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ namespace Content.Client.UserInterface.XamlExtensions;
|
|||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public sealed class TexExtension
|
public sealed class TexExtension
|
||||||
{
|
{
|
||||||
private IClientResourceCache _resourceCache;
|
private IResourceCache _resourceCache;
|
||||||
public string Path { get; }
|
public string Path { get; }
|
||||||
|
|
||||||
public TexExtension(string path)
|
public TexExtension(string path)
|
||||||
{
|
{
|
||||||
_resourceCache = IoCManager.Resolve<IClientResourceCache>();
|
_resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||||
Path = path;
|
Path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.Voting;
|
using Content.Shared.Voting;
|
||||||
using Robust.Client;
|
using Robust.Client;
|
||||||
using Robust.Client.Audio;
|
|
||||||
using Robust.Client.Console;
|
using Robust.Client.Console;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ using Content.Shared.Projectiles;
|
|||||||
using Content.Shared.Weapons.Ranged.Components;
|
using Content.Shared.Weapons.Ranged.Components;
|
||||||
using Content.Shared.Weapons.Ranged.Systems;
|
using Content.Shared.Weapons.Ranged.Systems;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public sealed class WeatherOverlay : Overlay
|
|||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _cache = default!;
|
[Dependency] private readonly IResourceCache _cache = default!;
|
||||||
private readonly SharedTransformSystem _transform;
|
private readonly SharedTransformSystem _transform;
|
||||||
private readonly SpriteSystem _sprite;
|
private readonly SpriteSystem _sprite;
|
||||||
private readonly WeatherSystem _weather;
|
private readonly WeatherSystem _weather;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Content.Shared.Weather;
|
using Content.Shared.Weather;
|
||||||
using Robust.Client.Audio;
|
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
@@ -12,7 +10,6 @@ using Robust.Shared.Physics;
|
|||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
|
|
||||||
|
|
||||||
namespace Content.Client.Weather;
|
namespace Content.Client.Weather;
|
||||||
|
|
||||||
@@ -58,18 +55,18 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
|||||||
{
|
{
|
||||||
weather.LastOcclusion = 0f;
|
weather.LastOcclusion = 0f;
|
||||||
weather.LastAlpha = 0f;
|
weather.LastAlpha = 0f;
|
||||||
weather.Stream = _audio.Stop(weather.Stream);
|
weather.Stream?.Stop();
|
||||||
|
weather.Stream = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
|
if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true).Value.Entity;
|
weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
|
||||||
var volumeMod = MathF.Pow(10, weatherProto.Sound.Params.Volume / 10f);
|
var volumeMod = MathF.Pow(10, weatherProto.Sound.Params.Volume / 10f);
|
||||||
|
|
||||||
var stream = weather.Stream.Value;
|
var stream = (AudioSystem.PlayingStream) weather.Stream!;
|
||||||
var comp = Comp<AudioComponent>(stream);
|
|
||||||
var alpha = weather.LastAlpha;
|
var alpha = weather.LastAlpha;
|
||||||
alpha = MathF.Pow(alpha, 2f) * volumeMod;
|
alpha = MathF.Pow(alpha, 2f) * volumeMod;
|
||||||
// TODO: Lerp this occlusion.
|
// TODO: Lerp this occlusion.
|
||||||
@@ -135,7 +132,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
|||||||
{
|
{
|
||||||
occlusion = _physics.IntersectRayPenetration(entXform.MapID,
|
occlusion = _physics.IntersectRayPenetration(entXform.MapID,
|
||||||
new CollisionRay(entPos, sourceRelative.Normalized(), _audio.OcclusionCollisionMask),
|
new CollisionRay(entPos, sourceRelative.Normalized(), _audio.OcclusionCollisionMask),
|
||||||
sourceRelative.Length(), stream);
|
sourceRelative.Length(), stream.TrackingEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,8 +148,8 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
|||||||
weather.LastAlpha += (alpha - weather.LastAlpha) * AlphaLerpRate * frameTime;
|
weather.LastAlpha += (alpha - weather.LastAlpha) * AlphaLerpRate * frameTime;
|
||||||
|
|
||||||
// Full volume if not on grid
|
// Full volume if not on grid
|
||||||
comp.Gain = weather.LastAlpha;
|
stream.Source.SetVolumeDirect(weather.LastAlpha);
|
||||||
comp.Occlusion = weather.LastOcclusion;
|
stream.Source.SetOcclusion(weather.LastOcclusion);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void EndWeather(EntityUid uid, WeatherComponent component, string proto)
|
protected override void EndWeather(EntityUid uid, WeatherComponent component, string proto)
|
||||||
@@ -175,8 +172,9 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// TODO: Fades (properly)
|
// TODO: Fades (properly)
|
||||||
weather.Stream = _audio.Stop(weather.Stream);
|
weather.Stream?.Stop();
|
||||||
weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true)?.Entity;
|
weather.Stream = null;
|
||||||
|
weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Content.Client.Wires.UI
|
|||||||
{
|
{
|
||||||
public sealed class WiresMenu : BaseWindow
|
public sealed class WiresMenu : BaseWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public WiresBoundUserInterface Owner { get; }
|
public WiresBoundUserInterface Owner { get; }
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ namespace Content.Client.Wires.UI
|
|||||||
|
|
||||||
private sealed class WireControl : Control
|
private sealed class WireControl : Control
|
||||||
{
|
{
|
||||||
private IClientResourceCache _resourceCache;
|
private IResourceCache _resourceCache;
|
||||||
|
|
||||||
private const string TextureContact = "/Textures/Interface/WireHacking/contact.svg.96dpi.png";
|
private const string TextureContact = "/Textures/Interface/WireHacking/contact.svg.96dpi.png";
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ namespace Content.Client.Wires.UI
|
|||||||
public event Action? ContactsClicked;
|
public event Action? ContactsClicked;
|
||||||
|
|
||||||
public WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type,
|
public WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type,
|
||||||
IClientResourceCache resourceCache)
|
IResourceCache resourceCache)
|
||||||
{
|
{
|
||||||
_resourceCache = resourceCache;
|
_resourceCache = resourceCache;
|
||||||
|
|
||||||
@@ -412,10 +412,10 @@ namespace Content.Client.Wires.UI
|
|||||||
"/Textures/Interface/WireHacking/wire_2_copper.svg.96dpi.png"
|
"/Textures/Interface/WireHacking/wire_2_copper.svg.96dpi.png"
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly IClientResourceCache _resourceCache;
|
private readonly IResourceCache _resourceCache;
|
||||||
|
|
||||||
public WireRender(WireColor color, bool isCut, bool flip, bool mirror, int type,
|
public WireRender(WireColor color, bool isCut, bool flip, bool mirror, int type,
|
||||||
IClientResourceCache resourceCache)
|
IResourceCache resourceCache)
|
||||||
{
|
{
|
||||||
_resourceCache = resourceCache;
|
_resourceCache = resourceCache;
|
||||||
_color = color;
|
_color = color;
|
||||||
@@ -507,7 +507,7 @@ namespace Content.Client.Wires.UI
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public StatusLight(StatusLightData data, IClientResourceCache resourceCache)
|
public StatusLight(StatusLightData data, IResourceCache resourceCache)
|
||||||
{
|
{
|
||||||
var hsv = Color.ToHsv(data.Color);
|
var hsv = Color.ToHsv(data.Color);
|
||||||
hsv.Z /= 2;
|
hsv.Z /= 2;
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ using Content.Server.Destructible.Thresholds.Triggers;
|
|||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Damage.Prototypes;
|
using Content.Shared.Damage.Prototypes;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;
|
using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests
|
|||||||
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
|
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
|
||||||
var client = pair.Client;
|
var client = pair.Client;
|
||||||
var prototypeManager = client.ResolveDependency<IPrototypeManager>();
|
var prototypeManager = client.ResolveDependency<IPrototypeManager>();
|
||||||
var resourceCache = client.ResolveDependency<IClientResourceCache>();
|
var resourceCache = client.ResolveDependency<IResourceCache>();
|
||||||
|
|
||||||
await client.WaitAssertion(() =>
|
await client.WaitAssertion(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -619,9 +619,6 @@ public abstract partial class InteractionTest
|
|||||||
{
|
{
|
||||||
foreach (var (proto, quantity) in expected.Entities)
|
foreach (var (proto, quantity) in expected.Entities)
|
||||||
{
|
{
|
||||||
if (proto == "Audio")
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (quantity < 0 && failOnExcess)
|
if (quantity < 0 && failOnExcess)
|
||||||
Assert.Fail($"Unexpected entity/stack: {proto}, quantity: {-quantity}");
|
Assert.Fail($"Unexpected entity/stack: {proto}, quantity: {-quantity}");
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System.IO;
|
|||||||
using Content.Shared.Decals;
|
using Content.Shared.Decals;
|
||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Client.Utility;
|
using Robust.Client.Utility;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -17,7 +16,7 @@ namespace Content.MapRenderer.Painters;
|
|||||||
|
|
||||||
public sealed class DecalPainter
|
public sealed class DecalPainter
|
||||||
{
|
{
|
||||||
private readonly IResourceManager _resManager;
|
private readonly IResourceCache _cResourceCache;
|
||||||
|
|
||||||
private readonly IPrototypeManager _sPrototypeManager;
|
private readonly IPrototypeManager _sPrototypeManager;
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ public sealed class DecalPainter
|
|||||||
|
|
||||||
public DecalPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
public DecalPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
||||||
{
|
{
|
||||||
_resManager = client.ResolveDependency<IResourceManager>();
|
_cResourceCache = client.ResolveDependency<IResourceCache>();
|
||||||
_sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
|
_sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ public sealed class DecalPainter
|
|||||||
Stream stream;
|
Stream stream;
|
||||||
if (sprite is SpriteSpecifier.Texture texture)
|
if (sprite is SpriteSpecifier.Texture texture)
|
||||||
{
|
{
|
||||||
stream = _resManager.ContentFileRead(texture.TexturePath);
|
stream = _cResourceCache.ContentFileRead(texture.TexturePath);
|
||||||
}
|
}
|
||||||
else if (sprite is SpriteSpecifier.Rsi rsi)
|
else if (sprite is SpriteSpecifier.Rsi rsi)
|
||||||
{
|
{
|
||||||
@@ -74,7 +73,7 @@ public sealed class DecalPainter
|
|||||||
path = $"/Textures/{path}";
|
path = $"/Textures/{path}";
|
||||||
}
|
}
|
||||||
|
|
||||||
stream = _resManager.ContentFileRead(path);
|
stream = _cResourceCache.ContentFileRead(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
@@ -15,7 +14,7 @@ namespace Content.MapRenderer.Painters;
|
|||||||
|
|
||||||
public sealed class EntityPainter
|
public sealed class EntityPainter
|
||||||
{
|
{
|
||||||
private readonly IResourceManager _resManager;
|
private readonly IResourceCache _cResourceCache;
|
||||||
|
|
||||||
private readonly Dictionary<(string path, string state), Image> _images;
|
private readonly Dictionary<(string path, string state), Image> _images;
|
||||||
private readonly Image _errorImage;
|
private readonly Image _errorImage;
|
||||||
@@ -24,12 +23,12 @@ public sealed class EntityPainter
|
|||||||
|
|
||||||
public EntityPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
public EntityPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
||||||
{
|
{
|
||||||
_resManager = client.ResolveDependency<IResourceManager>();
|
_cResourceCache = client.ResolveDependency<IResourceCache>();
|
||||||
|
|
||||||
_sEntityManager = server.ResolveDependency<IEntityManager>();
|
_sEntityManager = server.ResolveDependency<IEntityManager>();
|
||||||
|
|
||||||
_images = new Dictionary<(string path, string state), Image>();
|
_images = new Dictionary<(string path, string state), Image>();
|
||||||
_errorImage = Image.Load<Rgba32>(_resManager.ContentFileRead("/Textures/error.rsi/error.png"));
|
_errorImage = Image.Load<Rgba32>(_cResourceCache.ContentFileRead("/Textures/error.rsi/error.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run(Image canvas, List<EntityData> entities)
|
public void Run(Image canvas, List<EntityData> entities)
|
||||||
@@ -82,7 +81,7 @@ public sealed class EntityPainter
|
|||||||
|
|
||||||
if (!_images.TryGetValue(key, out image!))
|
if (!_images.TryGetValue(key, out image!))
|
||||||
{
|
{
|
||||||
var stream = _resManager.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
|
var stream = _cResourceCache.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
|
||||||
image = Image.Load<Rgba32>(stream);
|
image = Image.Load<Rgba32>(stream);
|
||||||
|
|
||||||
_images[key] = image;
|
_images[key] = image;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Shared.ContentPack;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
@@ -20,12 +19,12 @@ namespace Content.MapRenderer.Painters
|
|||||||
public const int TileImageSize = EyeManager.PixelsPerMeter;
|
public const int TileImageSize = EyeManager.PixelsPerMeter;
|
||||||
|
|
||||||
private readonly ITileDefinitionManager _sTileDefinitionManager;
|
private readonly ITileDefinitionManager _sTileDefinitionManager;
|
||||||
private readonly IResourceManager _resManager;
|
private readonly IResourceCache _cResourceCache;
|
||||||
|
|
||||||
public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
|
||||||
{
|
{
|
||||||
_sTileDefinitionManager = server.ResolveDependency<ITileDefinitionManager>();
|
_sTileDefinitionManager = server.ResolveDependency<ITileDefinitionManager>();
|
||||||
_resManager = client.ResolveDependency<IResourceManager>();
|
_cResourceCache = client.ResolveDependency<IResourceCache>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid)
|
public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid)
|
||||||
@@ -38,7 +37,7 @@ namespace Content.MapRenderer.Painters
|
|||||||
var yOffset = -bounds.Bottom;
|
var yOffset = -bounds.Bottom;
|
||||||
var tileSize = grid.TileSize * TileImageSize;
|
var tileSize = grid.TileSize * TileImageSize;
|
||||||
|
|
||||||
var images = GetTileImages(_sTileDefinitionManager, _resManager, tileSize);
|
var images = GetTileImages(_sTileDefinitionManager, _cResourceCache, tileSize);
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
||||||
grid.GetAllTiles().AsParallel().ForAll(tile =>
|
grid.GetAllTiles().AsParallel().ForAll(tile =>
|
||||||
@@ -62,7 +61,7 @@ namespace Content.MapRenderer.Painters
|
|||||||
|
|
||||||
private Dictionary<string, List<Image>> GetTileImages(
|
private Dictionary<string, List<Image>> GetTileImages(
|
||||||
ITileDefinitionManager tileDefinitionManager,
|
ITileDefinitionManager tileDefinitionManager,
|
||||||
IResourceManager resManager,
|
IResourceCache resourceCache,
|
||||||
int tileSize)
|
int tileSize)
|
||||||
{
|
{
|
||||||
var stopwatch = new Stopwatch();
|
var stopwatch = new Stopwatch();
|
||||||
@@ -79,7 +78,7 @@ namespace Content.MapRenderer.Painters
|
|||||||
|
|
||||||
images[path] = new List<Image>(definition.Variants);
|
images[path] = new List<Image>(definition.Variants);
|
||||||
|
|
||||||
using var stream = resManager.ContentFileRead(path);
|
using var stream = resourceCache.ContentFileRead(path);
|
||||||
Image tileSheet = Image.Load<Rgba32>(stream);
|
Image tileSheet = Image.Load<Rgba32>(stream);
|
||||||
|
|
||||||
if (tileSheet.Width != tileSize * definition.Variants || tileSheet.Height != tileSize)
|
if (tileSheet.Width != tileSize * definition.Variants || tileSheet.Height != tileSize)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public sealed class ReplayMainScreen : State
|
|||||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
[Dependency] private readonly IReplayLoadManager _loadMan = default!;
|
[Dependency] private readonly IReplayLoadManager _loadMan = default!;
|
||||||
[Dependency] private readonly IClientResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
[Dependency] private readonly IGameController _controllerProxy = default!;
|
[Dependency] private readonly IGameController _controllerProxy = default!;
|
||||||
[Dependency] private readonly IClientRobustSerializer _serializer = default!;
|
[Dependency] private readonly IClientRobustSerializer _serializer = default!;
|
||||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Content.Replay.Menu;
|
|||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class ReplayMainMenuControl : Control
|
public sealed partial class ReplayMainMenuControl : Control
|
||||||
{
|
{
|
||||||
public ReplayMainMenuControl(IClientResourceCache resCache)
|
public ReplayMainMenuControl(IResourceCache resCache)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ using Content.Shared.DoAfter;
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using static Content.Shared.Access.Components.AccessOverriderComponent;
|
using static Content.Shared.Access.Components.AccessOverriderComponent;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ using Content.Shared.Throwing;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Enums;
|
using Robust.Shared.Enums;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
@@ -40,6 +39,7 @@ namespace Content.Server.Administration.Systems
|
|||||||
[Dependency] private readonly IChatManager _chat = default!;
|
[Dependency] private readonly IChatManager _chat = default!;
|
||||||
[Dependency] private readonly IConfigurationManager _config = default!;
|
[Dependency] private readonly IConfigurationManager _config = default!;
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
|
[Dependency] private readonly AudioSystem _audio = default!;
|
||||||
[Dependency] private readonly HandsSystem _hands = default!;
|
[Dependency] private readonly HandsSystem _hands = default!;
|
||||||
[Dependency] private readonly SharedJobSystem _jobs = default!;
|
[Dependency] private readonly SharedJobSystem _jobs = default!;
|
||||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||||
@@ -49,7 +49,6 @@ namespace Content.Server.Administration.Systems
|
|||||||
[Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
|
[Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
|
||||||
[Dependency] private readonly SharedRoleSystem _role = default!;
|
[Dependency] private readonly SharedRoleSystem _role = default!;
|
||||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
||||||
[Dependency] private readonly StationRecordsSystem _stationRecords = default!;
|
[Dependency] private readonly StationRecordsSystem _stationRecords = default!;
|
||||||
[Dependency] private readonly TransformSystem _transform = default!;
|
[Dependency] private readonly TransformSystem _transform = default!;
|
||||||
|
|
||||||
@@ -341,7 +340,7 @@ namespace Content.Server.Administration.Systems
|
|||||||
_popup.PopupCoordinates(Loc.GetString("admin-erase-popup", ("user", name)), coordinates, PopupType.LargeCaution);
|
_popup.PopupCoordinates(Loc.GetString("admin-erase-popup", ("user", name)), coordinates, PopupType.LargeCaution);
|
||||||
var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager);
|
var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager);
|
||||||
var audioParams = new AudioParams().WithVolume(3);
|
var audioParams = new AudioParams().WithVolume(3);
|
||||||
_audio.PlayStatic("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
|
_audio.Play("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in _inventory.GetHandOrInventoryEntities(entity.Value))
|
foreach (var item in _inventory.GetHandOrInventoryEntities(entity.Value))
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using Content.Server.Chat.Systems;
|
|||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
@@ -11,11 +10,10 @@ namespace Content.Server.AlertLevel;
|
|||||||
|
|
||||||
public sealed class AlertLevelSystem : EntitySystem
|
public sealed class AlertLevelSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
||||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||||
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
|
|
||||||
// Until stations are a prototype, this is how it's going to have to be.
|
// Until stations are a prototype, this is how it's going to have to be.
|
||||||
public const string DefaultAlertLevelSet = "stationAlerts";
|
public const string DefaultAlertLevelSet = "stationAlerts";
|
||||||
@@ -176,7 +174,7 @@ public sealed class AlertLevelSystem : EntitySystem
|
|||||||
if (detail.Sound != null)
|
if (detail.Sound != null)
|
||||||
{
|
{
|
||||||
var filter = _stationSystem.GetInOwningStation(station);
|
var filter = _stationSystem.GetInOwningStation(station);
|
||||||
_audio.PlayGlobal(detail.Sound.GetSound(), filter, true, detail.Sound.Params);
|
SoundSystem.Play(detail.Sound.GetSound(), filter, detail.Sound.Params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ using Content.Shared.Popups;
|
|||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ using Content.Server.Tools;
|
|||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
|
||||||
namespace Content.Server.Ame.EntitySystems;
|
namespace Content.Server.Ame.EntitySystems;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Shared.Actions.Events;
|
|||||||
using Content.Shared.Nutrition.Components;
|
using Content.Shared.Nutrition.Components;
|
||||||
using Content.Shared.Nutrition.EntitySystems;
|
using Content.Shared.Nutrition.EntitySystems;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
using Robust.Server.Audio;
|
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public sealed partial class AnomalySystem
|
|||||||
|
|
||||||
var generating = EnsureComp<GeneratingAnomalyGeneratorComponent>(uid);
|
var generating = EnsureComp<GeneratingAnomalyGeneratorComponent>(uid);
|
||||||
generating.EndTime = Timing.CurTime + component.GenerationLength;
|
generating.EndTime = Timing.CurTime + component.GenerationLength;
|
||||||
generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true))?.Entity;
|
generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true));
|
||||||
component.CooldownEndTime = Timing.CurTime + component.CooldownLength;
|
component.CooldownEndTime = Timing.CurTime + component.CooldownLength;
|
||||||
UpdateGeneratorUi(uid, component);
|
UpdateGeneratorUi(uid, component);
|
||||||
}
|
}
|
||||||
@@ -174,8 +174,7 @@ public sealed partial class AnomalySystem
|
|||||||
{
|
{
|
||||||
if (Timing.CurTime < active.EndTime)
|
if (Timing.CurTime < active.EndTime)
|
||||||
continue;
|
continue;
|
||||||
|
active.AudioStream?.Stop();
|
||||||
active.AudioStream = _audio.Stop(active.AudioStream);
|
|
||||||
OnGeneratingFinished(ent, gen);
|
OnGeneratingFinished(ent, gen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ using Content.Shared.Anomaly;
|
|||||||
using Content.Shared.Anomaly.Components;
|
using Content.Shared.Anomaly.Components;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -33,7 +31,6 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
|
|||||||
[Dependency] private readonly SharedPointLightSystem _pointLight = default!;
|
[Dependency] private readonly SharedPointLightSystem _pointLight = default!;
|
||||||
[Dependency] private readonly StationSystem _station = default!;
|
[Dependency] private readonly StationSystem _station = default!;
|
||||||
[Dependency] private readonly RadioSystem _radio = default!;
|
[Dependency] private readonly RadioSystem _radio = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
||||||
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
||||||
|
|
||||||
public const float MinParticleVariation = 0.8f;
|
public const float MinParticleVariation = 0.8f;
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ public sealed partial class GeneratingAnomalyGeneratorComponent : Component
|
|||||||
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||||
public TimeSpan EndTime = TimeSpan.Zero;
|
public TimeSpan EndTime = TimeSpan.Zero;
|
||||||
|
|
||||||
public EntityUid? AudioStream;
|
public IPlayingAudioStream? AudioStream;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ using Content.Server.Anomaly.Components;
|
|||||||
using Content.Shared.Anomaly.Components;
|
using Content.Shared.Anomaly.Components;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
using Content.Shared.Teleportation.Components;
|
using Content.Shared.Teleportation.Components;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Server.Anomaly.Effects;
|
namespace Content.Server.Anomaly.Effects;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using Content.Shared.Chemistry.EntitySystems;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Content.Shared.Sprite;
|
using Content.Shared.Sprite;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
|
|
||||||
namespace Content.Server.Anomaly.Effects;
|
namespace Content.Server.Anomaly.Effects;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ using Content.Shared.Mobs.Components;
|
|||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Server.Shuttles.Systems;
|
using Content.Server.Shuttles.Systems;
|
||||||
using Content.Shared.Mobs;
|
using Content.Shared.Mobs;
|
||||||
using Robust.Server.Audio;
|
|
||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using Content.Server.UserInterface;
|
|||||||
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Server.Arcade.SpaceVillain;
|
namespace Content.Server.Arcade.SpaceVillain;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Server.Arcade.SpaceVillain;
|
namespace Content.Server.Arcade.SpaceVillain;
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ namespace Content.Server.Atmos.Components
|
|||||||
|
|
||||||
// Cancel toggles sounds if we re-toggle again.
|
// Cancel toggles sounds if we re-toggle again.
|
||||||
|
|
||||||
public EntityUid? ConnectStream;
|
public IPlayingAudioStream? ConnectStream;
|
||||||
public EntityUid? DisconnectStream;
|
public IPlayingAudioStream? DisconnectStream;
|
||||||
|
|
||||||
[DataField("air"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField("air"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public GasMixture Air { get; set; } = new();
|
public GasMixture Air { get; set; } = new();
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
|
if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
|
||||||
{
|
{
|
||||||
var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
|
var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
|
||||||
_audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
|
SoundSystem.Play(SpaceWindSound, Filter.Pvs(coordinates),
|
||||||
|
coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
// A few details on the audio parameters for fire.
|
// A few details on the audio parameters for fire.
|
||||||
// The greater the fire state, the lesser the pitch variation.
|
// The greater the fire state, the lesser the pitch variation.
|
||||||
// The greater the fire state, the greater the volume.
|
// The greater the fire state, the greater the volume.
|
||||||
_audio.PlayPvs(HotspotSound, coordinates, AudioParams.Default.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
|
SoundSystem.Play(HotspotSound, Filter.Pvs(coordinates),
|
||||||
|
coordinates, AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)
|
if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ using Content.Shared.Atmos.EntitySystems;
|
|||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
@@ -30,7 +28,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
|
|||||||
[Dependency] private readonly SharedContainerSystem _containers = default!;
|
[Dependency] private readonly SharedContainerSystem _containers = default!;
|
||||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||||
[Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
|
[Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
||||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||||
[Dependency] private readonly TileSystem _tile = default!;
|
[Dependency] private readonly TileSystem _tile = default!;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using Content.Shared.Verbs;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
@@ -240,8 +239,10 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if (!component.IsConnected)
|
if (!component.IsConnected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
component.ConnectStream = _audioSys.Stop(component.ConnectStream);
|
component.ConnectStream?.Stop();
|
||||||
component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, component.Owner)?.Entity;
|
|
||||||
|
if (component.ConnectSound != null)
|
||||||
|
component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, owner);
|
||||||
|
|
||||||
UpdateUserInterface(ent);
|
UpdateUserInterface(ent);
|
||||||
}
|
}
|
||||||
@@ -258,8 +259,10 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
_actions.SetToggled(component.ToggleActionEntity, false);
|
_actions.SetToggled(component.ToggleActionEntity, false);
|
||||||
|
|
||||||
_internals.DisconnectTank(internals);
|
_internals.DisconnectTank(internals);
|
||||||
component.DisconnectStream = _audioSys.Stop(component.DisconnectStream);
|
component.DisconnectStream?.Stop();
|
||||||
component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, component.Owner)?.Entity;
|
|
||||||
|
if (component.DisconnectSound != null)
|
||||||
|
component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, owner);
|
||||||
|
|
||||||
UpdateUserInterface(ent);
|
UpdateUserInterface(ent);
|
||||||
}
|
}
|
||||||
@@ -319,7 +322,7 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if(environment != null)
|
if(environment != null)
|
||||||
_atmosphereSystem.Merge(environment, component.Air);
|
_atmosphereSystem.Merge(environment, component.Air);
|
||||||
|
|
||||||
_audioSys.PlayPvs(component.RuptureSound, Transform(component.Owner).Coordinates, AudioParams.Default.WithVariation(0.125f));
|
_audioSys.Play(component.RuptureSound, Filter.Pvs(owner), Transform(owner).Coordinates, true, AudioParams.Default.WithVariation(0.125f));
|
||||||
|
|
||||||
QueueDel(owner);
|
QueueDel(owner);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user