From 5b8f3c48c4f739940dda49e6be5088af69ccbeaf Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:29:30 +1100 Subject: [PATCH] Revert "Update submodule to 175.0.0 (#21318)" (#21319) --- Content.Client/Access/AccessOverlay.cs | 2 +- .../Commands/ShowAccessReadersCommand.cs | 2 +- .../Administration/AdminNameOverlay.cs | 2 +- .../Systems/AdminSystem.Overlay.cs | 2 +- .../SpawnExplosion/ExplosionDebugOverlay.cs | 2 +- Content.Client/Arcade/BlockGameMenu.cs | 2 +- .../EntitySystems/GasTileOverlaySystem.cs | 2 +- .../Atmos/Overlays/GasTileOverlay.cs | 2 +- Content.Client/Audio/AmbientSoundSystem.cs | 58 +++++++++---------- Content.Client/Audio/BackgroundAudioSystem.cs | 8 +-- .../Audio/ClientGlobalSoundSystem.cs | 25 ++++---- .../Audio/ContentAudioSystem.AmbientMusic.cs | 28 ++++----- Content.Client/Audio/ContentAudioSystem.cs | 49 ++++++++-------- Content.Client/Changelog/ChangelogTab.xaml.cs | 3 +- Content.Client/Clickable/ClickMapManager.cs | 2 +- .../Clothing/ClientClothingSystem.cs | 2 +- Content.Client/Credits/CreditsWindow.xaml.cs | 5 +- .../Decals/UI/PaletteColorPicker.xaml.cs | 2 +- .../Disposal/Systems/DisposalUnitSystem.cs | 2 - Content.Client/Doors/DoorSystem.cs | 4 +- .../Explosion/ExplosionOverlaySystem.cs | 2 +- .../Fax/AdminUI/AdminFaxWindow.xaml.cs | 2 +- Content.Client/Fluids/PuddleOverlay.cs | 2 +- .../GameTicking/Managers/ClientGameTicker.cs | 2 - Content.Client/Gravity/GravitySystem.Shake.cs | 1 - Content.Client/Guidebook/GuidebookSystem.cs | 2 - Content.Client/Info/RulesAndInfoWindow.cs | 2 +- Content.Client/IoC/StaticIoC.cs | 3 +- Content.Client/Items/Systems/ItemSystem.cs | 2 +- .../Components/ExpendableLightComponent.cs | 2 +- .../EntitySystems/ExpendableLightSystem.cs | 14 ++--- .../PoweredLightVisualizerSystem.cs | 2 - Content.Client/Lobby/LobbyState.cs | 3 +- Content.Client/MainMenu/MainMenu.cs | 2 +- .../MainMenu/UI/MainMenuControl.xaml.cs | 2 +- Content.Client/NPC/HTN/HTNOverlay.cs | 2 +- Content.Client/NPC/HTN/HTNSystem.cs | 2 +- Content.Client/NPC/PathfindingSystem.cs | 4 +- .../NodeContainer/NodeGroupSystem.cs | 2 +- .../NodeContainer/NodeVisualizationOverlay.cs | 2 +- .../Options/UI/Tabs/AudioTab.xaml.cs | 17 +++--- Content.Client/Paper/UI/PaperWindow.xaml.cs | 2 +- Content.Client/Paper/UI/StampWidget.xaml.cs | 2 +- .../Data/GeneratedParallaxTextureSource.cs | 22 +++---- .../UI/ParticleAcceleratorControlMenu.cs | 4 +- Content.Client/Pinpointer/UI/NavMapControl.cs | 2 +- Content.Client/Popups/PopupOverlay.cs | 2 +- Content.Client/Popups/PopupSystem.cs | 2 +- .../Preferences/UI/CharacterSetupGui.xaml.cs | 2 +- .../Overlays/RadiationDebugOverlay.cs | 2 +- .../Replay/ContentReplayPlaybackManager.cs | 1 + .../Replay/UI/Loading/LoadingScreen.cs | 2 +- .../UI/Loading/LoadingScreenControl.xaml.cs | 2 +- .../Resources/ResourceCacheExtensions.cs | 12 ++-- .../SprayPainter/SprayPainterSystem.cs | 2 +- Content.Client/Stylesheets/StyleBase.cs | 2 +- Content.Client/Stylesheets/StyleNano.cs | 4 +- Content.Client/Stylesheets/StyleSpace.cs | 2 +- .../Stylesheets/StylesheetManager.cs | 2 +- .../SurveillanceCameraMonitorWindow.xaml.cs | 2 +- Content.Client/Traits/ParacusiaSystem.cs | 6 +- .../Trigger/TimerTriggerVisualizerSystem.cs | 2 - .../Controls/FancyTree/FancyTree.xaml.cs | 2 +- .../Systems/Atmos/GasTank/GasTankWindow.cs | 4 +- .../Systems/Bwoink/AHelpUIController.cs | 4 +- .../Chat/Controls/ChannelFilterButton.cs | 2 +- .../Systems/Chat/Widgets/ChatBox.xaml.cs | 8 +-- .../XamlExtensions/TextureExtension.cs | 4 +- Content.Client/Voting/VoteManager.cs | 1 - .../Ranged/Systems/FlyBySoundSystem.cs | 2 - Content.Client/Weather/WeatherOverlay.cs | 2 +- Content.Client/Weather/WeatherSystem.cs | 22 ++++--- Content.Client/Wires/UI/WiresMenu.cs | 12 ++-- .../DestructibleThresholdActivationTest.cs | 2 - .../Tests/DummyIconTest.cs | 2 +- .../Interaction/InteractionTest.Helpers.cs | 3 - Content.MapRenderer/Painters/DecalPainter.cs | 9 ++- Content.MapRenderer/Painters/EntityPainter.cs | 9 ++- Content.MapRenderer/Painters/TilePainter.cs | 11 ++-- Content.Replay/Menu/ReplayMainMenu.cs | 2 +- .../Menu/ReplayMainMenuControl.xaml.cs | 2 +- .../Access/Systems/AccessOverriderSystem.cs | 2 - .../Administration/Systems/AdminSystem.cs | 5 +- Content.Server/AlertLevel/AlertLevelSystem.cs | 6 +- .../Ame/EntitySystems/AmeControllerSystem.cs | 1 - .../Ame/EntitySystems/AmePartSystem.cs | 2 - .../Animals/Systems/EggLayerSystem.cs | 1 - .../Anomaly/AnomalySystem.Generator.cs | 5 +- Content.Server/Anomaly/AnomalySystem.cs | 3 - .../GeneratingAnomalyGeneratorComponent.cs | 2 +- .../Anomaly/Effects/BluespaceAnomalySystem.cs | 2 - .../Effects/ReagentProducerAnomalySystem.cs | 3 +- Content.Server/Antag/AntagSelectionSystem.cs | 1 - .../SpaceVillainArcadeSystem.cs | 1 - .../SpaceVillainGame/SpaceVillainGame.cs | 1 - .../Atmos/Components/GasTankComponent.cs | 4 +- .../AtmosphereSystem.HighPressureDelta.cs | 3 +- .../EntitySystems/AtmosphereSystem.Hotspot.cs | 3 +- .../Atmos/EntitySystems/AtmosphereSystem.cs | 3 - .../Atmos/EntitySystems/GasTankSystem.cs | 15 +++-- .../Monitor/Systems/AtmosAlarmableSystem.cs | 1 - .../Binary/EntitySystems/GasValveSystem.cs | 11 ++-- .../Unary/EntitySystems/GasCanisterSystem.cs | 2 - Content.Server/Audio/ContentAudioSystem.cs | 33 ----------- Content.Server/Beam/BeamSystem.cs | 2 - Content.Server/Bed/Sleep/SleepingSystem.cs | 2 - Content.Server/Bible/BibleSystem.cs | 12 ++-- .../Body/Systems/BloodstreamSystem.cs | 1 - Content.Server/Body/Systems/BodySystem.cs | 3 +- .../Botany/Systems/PlantHolderSystem.cs | 1 - .../CardboardBox/CardboardBoxSystem.cs | 2 - Content.Server/Cargo/Systems/CargoSystem.cs | 2 - .../Cartridges/NetProbeCartridgeSystem.cs | 1 - Content.Server/Chat/Systems/ChatSystem.cs | 5 +- .../EntitySystems/ChemMasterSystem.cs | 1 - .../EntitySystems/ChemistrySystem.cs | 2 - .../EntitySystems/ReagentDispenserSystem.cs | 1 - .../ReactionEffects/AreaReactionEffect.cs | 4 +- Content.Server/Cloning/CloningSystem.cs | 2 - Content.Server/Cluwne/CluwneSystem.cs | 2 - .../Construction/Completions/PlaySound.cs | 1 - .../Components/PartExchangerComponent.cs | 2 +- .../Construction/PartExchangerSystem.cs | 6 +- Content.Server/Crayon/CrayonSystem.cs | 1 - .../Systems/DamageOnHighSpeedImpactSystem.cs | 1 - .../Defusable/Systems/DefusableSystem.cs | 2 - .../Destructible/DestructibleSystem.cs | 1 - .../Thresholds/Behaviors/PlaySoundBehavior.cs | 1 - .../Systems/DeviceLinkOverloadSystem.cs | 1 - .../DeviceLinking/Systems/LogicGateSystem.cs | 4 +- .../Systems/SignalSwitchSystem.cs | 1 - .../Systems/SignalTimerSystem.cs | 2 - .../Systems/NetworkConfiguratorSystem.cs | 1 - Content.Server/Dice/DiceSystem.cs | 2 - .../Disposal/Tube/DisposalTubeSystem.cs | 1 - Content.Server/Dragon/DragonRiftSystem.cs | 2 - Content.Server/Dragon/DragonSystem.cs | 4 +- .../Electrocution/ElectrocutionSystem.cs | 1 - .../EntitySystems/ExplosionSystem.Visuals.cs | 4 +- .../EntitySystems/ExplosionSystem.cs | 4 +- .../Explosion/EntitySystems/TriggerSystem.cs | 1 - .../Extinguisher/FireExtinguisherSystem.cs | 7 +-- Content.Server/Fax/FaxSystem.cs | 1 - Content.Server/Flash/FlashSystem.cs | 3 +- .../Fluids/EntitySystems/AbsorbentSystem.cs | 1 - .../Fluids/EntitySystems/DrainSystem.cs | 3 - .../Fluids/EntitySystems/PuddleSystem.cs | 8 +-- .../Fluids/EntitySystems/SpraySystem.cs | 2 - .../Systems/ForensicScannerSystem.cs | 1 - .../GameTicking/GameTicker.Player.cs | 4 +- .../GameTicking/GameTicker.RoundFlow.cs | 4 +- Content.Server/GameTicking/GameTicker.cs | 3 - .../GameTicking/Rules/NukeopsRuleSystem.cs | 1 - .../GameTicking/Rules/PiratesRuleSystem.cs | 3 - .../GameTicking/Rules/TraitorRuleSystem.cs | 3 - .../GameTicking/Rules/ZombieRuleSystem.cs | 2 - .../Gateway/Systems/GatewaySystem.cs | 1 - Content.Server/Gatherable/GatherableSystem.cs | 1 - Content.Server/Glue/GlueSystem.cs | 2 - Content.Server/Guardian/GuardianSystem.cs | 10 ++-- .../Holiday/Christmas/RandomGiftSystem.cs | 1 - .../IgnitionSource/IgniteOnTriggerSystem.cs | 1 - .../ImmovableRod/ImmovableRodSystem.cs | 2 - .../Interaction/InteractionPopupSystem.cs | 20 +++---- Content.Server/Item/ItemToggleSystem.cs | 6 +- .../Kitchen/Components/MicrowaveComponent.cs | 3 +- .../Components/ReagentGrinderComponent.cs | 2 +- .../EntitySystems/KitchenSpikeSystem.cs | 4 +- .../Kitchen/EntitySystems/MicrowaveSystem.cs | 5 +- .../EntitySystems/ReagentGrinderSystem.cs | 5 +- Content.Server/Lathe/LatheSystem.cs | 2 - .../EntitySystems/ExpendableLightSystem.cs | 3 - .../EntitySystems/HandheldLightSystem.cs | 4 -- .../Light/EntitySystems/LightBulbSystem.cs | 4 +- .../EntitySystems/LightReplacerSystem.cs | 2 - .../Light/EntitySystems/MatchstickSystem.cs | 5 +- .../Light/EntitySystems/PoweredLightSystem.cs | 10 +--- .../UnpoweredFlashlightSystem.cs | 2 - Content.Server/Lube/LubeSystem.cs | 2 - Content.Server/Magic/MagicSystem.cs | 1 - .../MassMedia/Systems/NewsSystem.cs | 13 ----- .../Materials/MaterialStorageSystem.cs | 2 - .../Components/MechGrabberComponent.cs | 2 +- .../EntitySystems/MechGrabberSystem.cs | 6 +- .../BiomassReclaimerSystem.cs | 2 - Content.Server/Medical/DefibrillatorSystem.cs | 1 - Content.Server/Medical/HealingSystem.cs | 2 - .../Medical/HealthAnalyzerSystem.cs | 2 - Content.Server/Medical/VomitSystem.cs | 1 - Content.Server/Mind/MindSystem.cs | 5 +- Content.Server/Morgue/CrematoriumSystem.cs | 2 - Content.Server/Morgue/MorgueSystem.cs | 3 - .../Specific/MedibotInjectOperator.cs | 3 - Content.Server/NPC/Systems/NPCCombatSystem.cs | 2 - .../Ninja/Systems/BatteryDrainerSystem.cs | 1 - .../Ninja/Systems/SpaceNinjaSystem.cs | 2 - .../Ninja/Systems/StunProviderSystem.cs | 1 - Content.Server/Nuke/NukeComponent.cs | 2 +- Content.Server/Nuke/NukeSystem.cs | 11 ++-- .../Components/FatExtractorComponent.cs | 2 +- .../EntitySystems/AnimalHusbandrySystem.cs | 10 +--- .../Nutrition/EntitySystems/CreamPieSystem.cs | 3 +- .../Nutrition/EntitySystems/DrinkSystem.cs | 1 - .../EntitySystems/FatExtractorSystem.cs | 6 +- .../Nutrition/EntitySystems/FoodSystem.cs | 5 +- .../Nutrition/EntitySystems/OpenableSystem.cs | 2 - .../EntitySystems/SliceableFoodSystem.cs | 9 ++- .../Nutrition/EntitySystems/UtensilSystem.cs | 6 +- Content.Server/PDA/Ringer/RingerSystem.cs | 4 +- Content.Server/Paper/PaperSystem.cs | 3 - .../Pinpointer/ProximityBeeperSystem.cs | 1 - .../Plants/Systems/PottedPlantHideSystem.cs | 6 +- Content.Server/Points/PointSystem.cs | 2 +- .../Polymorph/Systems/PolymorphSystem.cs | 1 - .../Power/EntitySystems/ApcSystem.cs | 1 - .../EntitySystems/PowerReceiverSystem.cs | 1 - .../Generator/PortableGeneratorSystem.cs | 3 +- .../Power/Generator/PowerSwitchableSystem.cs | 5 +- Content.Server/PowerSink/PowerSinkSystem.cs | 1 - .../Radiation/Systems/GeigerSystem.cs | 5 +- .../Systems/DiskConsoleSystem.cs | 1 - Content.Server/RoundEnd/RoundEndSystem.cs | 6 +- .../Expeditions/SalvageExpeditionComponent.cs | 2 +- .../Salvage/SalvageSystem.Expeditions.cs | 2 +- .../Salvage/SalvageSystem.Runner.cs | 2 +- Content.Server/Salvage/SalvageSystem.cs | 2 - .../Shuttles/Components/FTLComponent.cs | 2 +- .../Systems/EmergencyShuttleSystem.cs | 3 - .../Systems/ShuttleSystem.FasterThanLight.cs | 19 ++++-- .../Shuttles/Systems/ShuttleSystem.Impact.cs | 2 +- .../Shuttles/Systems/ShuttleSystem.cs | 2 - .../EntitySystems/SingularitySystem.cs | 19 ++---- .../Speech/EntitySystems/VocalSystem.cs | 2 - Content.Server/Speech/SpeechNoiseSystem.cs | 4 +- .../SprayPainter/SprayPainterSystem.cs | 2 - .../Events/StationEventSystem.cs | 2 - .../CursedEntityStorageSystem.cs | 7 +-- .../EntitySystems/SpawnItemsOnUseSystem.cs | 6 +- .../Storage/EntitySystems/StorageSystem.cs | 2 +- .../Store/Systems/StoreSystem.Ui.cs | 2 - .../Stunnable/Systems/StunbatonSystem.cs | 4 +- .../SurveillanceCameraSpeakerSystem.cs | 2 - .../Teleportation/HandTeleporterSystem.cs | 1 - Content.Server/Toilet/ToiletSystem.cs | 1 - Content.Server/Tools/ToolSystem.cs | 2 - .../Melee/Balloon/BalloonPopperSystem.cs | 2 - .../Melee/EnergySword/EnergySwordSystem.cs | 6 +- .../Melee/WeaponRandom/WeaponRandomSystem.cs | 2 - Content.Server/Wires/WiresSystem.cs | 3 - .../Systems/ArtifactAnalyzerSystem.cs | 1 - .../XenoArtifacts/ArtifactSystem.cs | 2 - .../Effects/Systems/PolyArtifactSystem.cs | 1 - .../Zombies/ZombieSystem.Transform.cs | 1 - Content.Shared/Actions/SharedActionsSystem.cs | 2 - Content.Shared/Anomaly/SharedAnomalySystem.cs | 2 - .../Audio/SharedAmbientSoundSystem.cs | 8 +-- .../Audio/SharedContentAudioSystem.cs | 6 +- .../Blocking/BlockingSystem.User.cs | 3 +- .../Blocking/Components/BlockingComponent.cs | 7 +-- .../Buckle/SharedBuckleSystem.Buckle.cs | 6 +- Content.Shared/Buckle/SharedBuckleSystem.cs | 2 - Content.Shared/CCVar/CCVars.cs | 2 - .../Cabinet/SharedItemCabinetSystem.cs | 3 +- Content.Shared/Chasm/ChasmSystem.cs | 2 - .../Reaction/ChemicalReactionSystem.cs | 2 - Content.Shared/Climbing/Systems/BonkSystem.cs | 2 - .../Climbing/Systems/ClimbSystem.cs | 1 - .../Containers/ItemSlot/ItemSlotsSystem.cs | 2 - Content.Shared/Cuffs/SharedCuffableSystem.cs | 2 - .../Damage/Systems/StaminaSystem.cs | 1 - Content.Shared/Devour/SharedDevourSystem.cs | 2 - .../Doors/Systems/SharedDoorBoltSystem.cs | 2 - .../Doors/Systems/SharedDoorSystem.cs | 2 - .../Inventory/InventorySystem.Equip.cs | 9 +-- .../Light/SharedHandheldLightSystem.cs | 2 - Content.Shared/Lock/LockComponent.cs | 10 +--- Content.Shared/Lock/LockSystem.cs | 11 ++-- .../Materials/MaterialReclaimerComponent.cs | 2 +- .../SharedMaterialReclaimerSystem.cs | 15 ++--- .../Equipment/Systems/MechSoundboardSystem.cs | 1 - .../Movement/Systems/SharedMoverController.cs | 1 - .../Ninja/Systems/DashAbilitySystem.cs | 1 - .../Ninja/Systems/SharedNinjaSuitSystem.cs | 1 - .../Projectiles/SharedProjectileSystem.cs | 3 - Content.Shared/Prying/Systems/PryingSystem.cs | 2 - Content.Shared/RCD/Systems/RCDSystem.cs | 1 - .../Radiation/Components/GeigerComponent.cs | 2 +- .../EntitySystems/EncryptionKeySystem.cs | 2 - Content.Shared/RatKing/SharedRatKingSystem.cs | 2 - .../Salvage/Fulton/SharedFultonSystem.cs | 2 - .../Bots/EmaggableMedibotComponent.cs | 6 +- Content.Shared/Silicons/Bots/MedibotSystem.cs | 3 +- .../Components/SingularityComponent.cs | 2 +- Content.Shared/Slippery/SlipperySystem.cs | 2 - Content.Shared/Sound/SharedEmitSoundSystem.cs | 8 +-- .../Standing/StandingStateSystem.cs | 3 +- .../Storage/EntitySystems/DumpableSystem.cs | 2 - .../SharedEntityStorageSystem.cs | 2 - .../EntitySystems/SharedStorageSystem.cs | 2 - Content.Shared/Stunnable/SharedStunSystem.cs | 1 - .../Systems/SharedPortalSystem.cs | 2 - Content.Shared/Tiles/FloorTileComponent.cs | 7 +-- Content.Shared/Tiles/FloorTileSystem.cs | 3 +- .../Tools/Systems/SharedToolSystem.cs | 4 +- .../Traits/Assorted/ParacusiaComponent.cs | 2 +- .../Vehicle/Components/VehicleComponent.cs | 2 +- Content.Shared/Vehicle/SharedVehicleSystem.cs | 5 +- .../SharedVendingMachineSystem.cs | 2 - .../Marker/SharedDamageMarkerSystem.cs | 2 - .../Weapons/Melee/SharedMeleeWeaponSystem.cs | 1 - .../Weapons/Misc/BaseForceGunComponent.cs | 2 +- .../Weapons/Misc/SharedGrapplingGunSystem.cs | 22 +++---- .../Weapons/Misc/SharedTetherGunSystem.cs | 10 ++-- .../Components/GrapplingGunComponent.cs | 2 +- .../Systems/RechargeBasicEntityAmmoSystem.cs | 2 - .../Weapons/Ranged/Systems/SharedGunSystem.cs | 1 - .../Weapons/Reflect/SharedReflectSystem.cs | 2 - Content.Shared/Weather/SharedWeatherSystem.cs | 19 +++--- Content.Shared/Weather/WeatherComponent.cs | 2 +- Content.Shared/Wieldable/WieldableSystem.cs | 2 - .../Prototypes/Entities/Objects/Fun/toys.yml | 4 +- .../Entities/Objects/Misc/paper.yml | 4 +- .../Objects/Specific/Research/anomaly.yml | 4 +- .../Structures/Machines/fatextractor.yml | 2 +- .../Machines/material_reclaimer.yml | 2 +- .../Prototypes/Voice/speech_emote_sounds.yml | 4 +- RobustToolbox | 2 +- 327 files changed, 437 insertions(+), 891 deletions(-) diff --git a/Content.Client/Access/AccessOverlay.cs b/Content.Client/Access/AccessOverlay.cs index 90b872b4a4..2be3d07e90 100644 --- a/Content.Client/Access/AccessOverlay.cs +++ b/Content.Client/Access/AccessOverlay.cs @@ -16,7 +16,7 @@ public sealed class AccessOverlay : Overlay 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; _lookup = lookup; diff --git a/Content.Client/Access/Commands/ShowAccessReadersCommand.cs b/Content.Client/Access/Commands/ShowAccessReadersCommand.cs index 91a94138c8..7c804dd969 100644 --- a/Content.Client/Access/Commands/ShowAccessReadersCommand.cs +++ b/Content.Client/Access/Commands/ShowAccessReadersCommand.cs @@ -25,7 +25,7 @@ public sealed class ShowAccessReadersCommand : IConsoleCommand } var entManager = collection.Resolve(); - var cache = collection.Resolve(); + var cache = collection.Resolve(); var lookup = entManager.System(); var xform = entManager.System(); diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index fca50e1d95..c21ba2e32c 100644 --- a/Content.Client/Administration/AdminNameOverlay.cs +++ b/Content.Client/Administration/AdminNameOverlay.cs @@ -17,7 +17,7 @@ namespace Content.Client.Administration private readonly EntityLookupSystem _entityLookup; 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; _entityManager = entityManager; diff --git a/Content.Client/Administration/Systems/AdminSystem.Overlay.cs b/Content.Client/Administration/Systems/AdminSystem.Overlay.cs index 4093dcfbd7..3502faf9e8 100644 --- a/Content.Client/Administration/Systems/AdminSystem.Overlay.cs +++ b/Content.Client/Administration/Systems/AdminSystem.Overlay.cs @@ -7,7 +7,7 @@ namespace Content.Client.Administration.Systems public sealed partial class AdminSystem { [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 IEyeManager _eyeManager = default!; [Dependency] private readonly EntityLookupSystem _entityLookup = default!; diff --git a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs index 89c4d8d7cf..eede3a6217 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs @@ -34,7 +34,7 @@ public sealed class ExplosionDebugOverlay : Overlay { IoCManager.InjectDependencies(this); - var cache = IoCManager.Resolve(); + var cache = IoCManager.Resolve(); _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); } diff --git a/Content.Client/Arcade/BlockGameMenu.cs b/Content.Client/Arcade/BlockGameMenu.cs index 4832aa5a93..eeda2a3102 100644 --- a/Content.Client/Arcade/BlockGameMenu.cs +++ b/Content.Client/Arcade/BlockGameMenu.cs @@ -65,7 +65,7 @@ namespace Content.Client.Arcade MinSize = SetSize = new Vector2(410, 490); - var resourceCache = IoCManager.Resolve(); + var resourceCache = IoCManager.Resolve(); var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); _mainPanel = new PanelContainer(); diff --git a/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs b/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs index 132f404acd..78185ce6b0 100644 --- a/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs @@ -12,7 +12,7 @@ namespace Content.Client.Atmos.EntitySystems [UsedImplicitly] 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 SpriteSystem _spriteSys = default!; diff --git a/Content.Client/Atmos/Overlays/GasTileOverlay.cs b/Content.Client/Atmos/Overlays/GasTileOverlay.cs index 90df195485..ef65d43fe8 100644 --- a/Content.Client/Atmos/Overlays/GasTileOverlay.cs +++ b/Content.Client/Atmos/Overlays/GasTileOverlay.cs @@ -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 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; _mapManager = IoCManager.Resolve(); diff --git a/Content.Client/Audio/AmbientSoundSystem.cs b/Content.Client/Audio/AmbientSoundSystem.cs index 10065b6583..aebacb94f6 100644 --- a/Content.Client/Audio/AmbientSoundSystem.cs +++ b/Content.Client/Audio/AmbientSoundSystem.cs @@ -1,21 +1,16 @@ +using System.Linq; +using System.Numerics; using Content.Shared.Audio; using Content.Shared.CCVar; +using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.Player; using Robust.Shared.Audio; -using Robust.Shared.Log; using Robust.Shared.Configuration; -using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Random; using Robust.Shared.Timing; 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; //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 float _ambienceVolume = 0.0f; - private static AudioParams _params = AudioParams.Default - .WithVariation(0.01f) - .WithLoop(true) - .WithAttenuation(Attenuation.LinearDistance) - .WithMaxDistance(7f); + private static AudioParams _params = AudioParams.Default.WithVariation(0.01f).WithLoop(true).WithAttenuation(Attenuation.LinearDistance); /// /// How many times we can be playing 1 particular sound at once. /// private int MaxSingleSound => (int) (_maxAmbientCount / (16.0f / 6.0f)); - private readonly Dictionary _playingSounds = new(); + private readonly Dictionary, (IPlayingAudioStream? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new(); private readonly Dictionary _playingCount = new(); public bool OverlayEnabled @@ -107,10 +98,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem 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; - _audio.Stop(sound.Stream); + sound.Stream?.Stop(); _playingCount[sound.Path] -= 1; if (_playingCount[sound.Path] == 0) _playingCount.Remove(sound.Path); @@ -120,13 +111,13 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem { _ambienceVolume = value; - foreach (var (comp, values) in _playingSounds) + foreach (var ((_, comp), values) in _playingSounds) { if (values.Stream == null) continue; - var stream = values.Stream; - _audio.SetVolume(stream, _params.Volume + comp.Volume + _ambienceVolume); + var stream = (AudioSystem.PlayingStream) values.Stream; + stream.Volume = _params.Volume + comp.Volume + _ambienceVolume; } } private void SetCooldown(float value) => _cooldown = value; @@ -186,7 +177,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem { foreach (var (stream, _, _) in _playingSounds.Values) { - _audio.Stop(stream); + stream?.Stop(); } _playingSounds.Clear(); @@ -195,7 +186,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem private readonly struct QueryState { - public readonly Dictionary> SourceDict = new(); + public readonly Dictionary)>> SourceDict = new(); public readonly Vector2 MapPos; public readonly TransformComponent Player; public readonly EntityQuery Query; @@ -233,7 +224,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem // Prioritize far away & loud sounds. var importance = range * (ambientComp.Volume + 32); - state.SourceDict.GetOrNew(key).Add((importance, ambientComp)); + state.SourceDict.GetOrNew(key).Add((importance, (ambientComp.Owner, ambientComp))); return true; } @@ -247,9 +238,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem var mapPos = playerXform.MapPosition; // 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 && // Don't keep playing sounds that have changed since. @@ -266,8 +258,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem continue; } - _audio.Stop(sound.Stream); - _playingSounds.Remove(comp); + sound.Stream?.Stop(); + _playingSounds.Remove((entity, comp)); _playingCount[sound.Path] -= 1; if (_playingCount[sound.Path] == 0) _playingCount.Remove(sound.Path); @@ -292,11 +284,12 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem 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) continue; @@ -306,8 +299,11 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem .WithPlayOffset(_random.NextFloat(0.0f, 100.0f)) .WithMaxDistance(comp.Range); - var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams); - _playingSounds[comp] = (stream.Value.Entity, comp.Sound, key); + var stream = _audio.PlayPvs(comp.Sound, uid, audioParams); + if (stream == null) + continue; + + _playingSounds[ent] = (stream, comp.Sound, key); playingCount++; if (_playingSounds.Count >= _maxAmbientCount) diff --git a/Content.Client/Audio/BackgroundAudioSystem.cs b/Content.Client/Audio/BackgroundAudioSystem.cs index a26603bf74..0b31db2463 100644 --- a/Content.Client/Audio/BackgroundAudioSystem.cs +++ b/Content.Client/Audio/BackgroundAudioSystem.cs @@ -5,7 +5,6 @@ using JetBrains.Annotations; using Robust.Client; using Robust.Client.State; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; 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 EntityUid? _lobbyStream; + private IPlayingAudioStream? _lobbyStream; public override void Initialize() { @@ -119,11 +118,12 @@ public sealed class BackgroundAudioSystem : EntitySystem } _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() { - _lobbyStream = _audio.Stop(_lobbyStream); + _lobbyStream?.Stop(); + _lobbyStream = null; } } diff --git a/Content.Client/Audio/ClientGlobalSoundSystem.cs b/Content.Client/Audio/ClientGlobalSoundSystem.cs index 1d98564090..792f149d18 100644 --- a/Content.Client/Audio/ClientGlobalSoundSystem.cs +++ b/Content.Client/Audio/ClientGlobalSoundSystem.cs @@ -2,7 +2,6 @@ using Content.Shared.CCVar; using Content.Shared.GameTicking; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; @@ -15,11 +14,11 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem // Admin music private bool _adminAudioEnabled = true; - private List _adminAudio = new(1); + private List _adminAudio = new(1); // Event sounds (e.g. nuke timer) private bool _eventAudioEnabled = true; - private Dictionary _eventAudio = new(1); + private Dictionary _eventAudio = new(1); public override void Initialize() { @@ -50,13 +49,13 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem { foreach (var stream in _adminAudio) { - _audio.Stop(stream); + stream?.Stop(); } _adminAudio.Clear(); - foreach (var stream in _eventAudio.Values) + foreach (var (_, stream) in _eventAudio) { - _audio.Stop(stream); + stream?.Stop(); } _eventAudio.Clear(); @@ -67,7 +66,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem if(!_adminAudioEnabled) return; var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams); - _adminAudio.Add(stream.Value.Entity); + _adminAudio.Add(stream); } private void PlayStationEventMusic(StationEventMusicEvent soundEvent) @@ -76,7 +75,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return; 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) @@ -86,10 +85,8 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem private void StopStationEventMusic(StopStationEventMusic soundEvent) { - if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream)) - return; - - _audio.Stop(stream); + if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream)) return; + stream?.Stop(); _eventAudio.Remove(soundEvent.Type); } @@ -99,7 +96,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem if (_adminAudioEnabled) return; foreach (var stream in _adminAudio) { - _audio.Stop(stream); + stream?.Stop(); } _adminAudio.Clear(); } @@ -110,7 +107,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem if (_eventAudioEnabled) return; foreach (var stream in _eventAudio) { - _audio.Stop(stream.Value); + stream.Value?.Stop(); } _eventAudio.Clear(); } diff --git a/Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs b/Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs index 525b09b2c6..15fc53222e 100644 --- a/Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs +++ b/Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs @@ -9,12 +9,10 @@ using Robust.Client.Player; using Robust.Client.ResourceManagement; using Robust.Client.State; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; -using Robust.Shared.ResourceManagement.ResourceTypes; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -26,7 +24,7 @@ public sealed partial class ContentAudioSystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IPlayerManager _player = 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 IStateManager _state = 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. private TimeSpan _nextAudio; - private EntityUid? _ambientMusicStream; + private AudioSystem.PlayingStream? _ambientMusicStream; private AmbientMusicPrototype? _musicProto; /// @@ -85,7 +83,7 @@ public sealed partial class ContentAudioSystem 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); _proto.PrototypesReloaded -= OnProtoReload; _state.OnStateChanged -= OnStateChange; - _ambientMusicStream = _audio.Stop(_ambientMusicStream); + _ambientMusicStream?.Stop(); } private void OnProtoReload(PrototypesReloadedEventArgs obj) @@ -131,7 +129,8 @@ public sealed partial class ContentAudioSystem private void OnRoundEndMessage(RoundEndMessageEvent ev) { // If scoreboard shows then just stop the music - _ambientMusicStream = _audio.Stop(_ambientMusicStream); + _ambientMusicStream?.Stop(); + _ambientMusicStream = null; _nextAudio = TimeSpan.FromMinutes(3); } @@ -171,7 +170,7 @@ public sealed partial class ContentAudioSystem return; } - var isDone = !Exists(_ambientMusicStream); + var isDone = _ambientMusicStream?.Done; if (_interruptable) { @@ -179,7 +178,7 @@ public sealed partial class ContentAudioSystem if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index(_musicProto.Rules))) { - FadeOut(_ambientMusicStream, duration: AmbientMusicFadeTime); + FadeOut(_ambientMusicStream, AmbientMusicFadeTime); _musicProto = null; _interruptable = false; isDone = true; @@ -222,11 +221,14 @@ public sealed partial class ContentAudioSystem false, AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider)); - _ambientMusicStream = strim.Value.Entity; - - if (_musicProto.FadeIn) + if (strim != null) { - FadeIn(_ambientMusicStream, strim.Value.Component, AmbientMusicFadeTime); + _ambientMusicStream = (AudioSystem.PlayingStream) strim; + + if (_musicProto.FadeIn) + { + FadeIn(_ambientMusicStream, AmbientMusicFadeTime); + } } // Refresh the list diff --git a/Content.Client/Audio/ContentAudioSystem.cs b/Content.Client/Audio/ContentAudioSystem.cs index 726493fdab..696a5eb32d 100644 --- a/Content.Client/Audio/ContentAudioSystem.cs +++ b/Content.Client/Audio/ContentAudioSystem.cs @@ -1,19 +1,17 @@ using Content.Shared.Audio; using Robust.Client.GameObjects; -using Robust.Shared.Audio; -using AudioComponent = Robust.Shared.Audio.Components.AudioComponent; namespace Content.Client.Audio; public sealed partial class ContentAudioSystem : SharedContentAudioSystem { // Need how much volume to change per tick and just remove it when it drops below "0" - private readonly Dictionary _fadingOut = new(); + private readonly Dictionary _fadingOut = new(); // Need volume change per tick + target volume. - private readonly Dictionary _fadingIn = new(); + private readonly Dictionary _fadingIn = new(); - private readonly List _fadeToRemove = new(); + private readonly List _fadeToRemove = new(); private const float MinVolume = -32f; private const float DefaultDuration = 2f; @@ -44,28 +42,28 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem #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; // Just in case // TODO: Maybe handle the removals by making it seamless? - _fadingIn.Remove(stream.Value); - var diff = component.Volume - MinVolume; - _fadingOut.Add(stream.Value, diff / duration); + _fadingIn.Remove(stream); + var diff = stream.Volume - MinVolume; + _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; - _fadingOut.Remove(stream.Value); - var curVolume = component.Volume; + _fadingOut.Remove(stream); + var curVolume = stream.Volume; var change = (curVolume - MinVolume) / duration; - _fadingIn.Add(stream.Value, (change, component.Volume)); - component.Volume = MinVolume; + _fadingIn.Add(stream, (change, stream.Volume)); + stream.Volume = MinVolume; } private void UpdateFades(float frameTime) @@ -74,18 +72,19 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem foreach (var (stream, change) in _fadingOut) { - if (!TryComp(stream, out AudioComponent? component)) + // Cancelled elsewhere + if (stream.Done) { _fadeToRemove.Add(stream); continue; } - var volume = component.Volume - change * frameTime; - component.Volume = MathF.Max(MinVolume, volume); + var volume = stream.Volume - change * frameTime; + stream.Volume = MathF.Max(MinVolume, volume); - if (component.Volume.Equals(MinVolume)) + if (stream.Volume.Equals(MinVolume)) { - _audio.Stop(stream); + stream.Stop(); _fadeToRemove.Add(stream); } } @@ -100,16 +99,16 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem foreach (var (stream, (change, target)) in _fadingIn) { // Cancelled elsewhere - if (!TryComp(stream, out AudioComponent? component)) + if (stream.Done) { _fadeToRemove.Add(stream); continue; } - var volume = component.Volume + change * frameTime; - component.Volume = MathF.Min(target, volume); + var volume = stream.Volume + change * frameTime; + stream.Volume = MathF.Min(target, volume); - if (component.Volume.Equals(target)) + if (stream.Volume.Equals(target)) { _fadeToRemove.Add(stream); } diff --git a/Content.Client/Changelog/ChangelogTab.xaml.cs b/Content.Client/Changelog/ChangelogTab.xaml.cs index 83397d6a36..d1e2bc7533 100644 --- a/Content.Client/Changelog/ChangelogTab.xaml.cs +++ b/Content.Client/Changelog/ChangelogTab.xaml.cs @@ -7,7 +7,6 @@ using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; -using Robust.Shared.ContentPack; using Robust.Shared.Utility; using static Content.Client.Changelog.ChangelogManager; using static Robust.Client.UserInterface.Controls.BoxContainer; @@ -18,7 +17,7 @@ namespace Content.Client.Changelog; public sealed partial class ChangelogTab : Control { [Dependency] private readonly ChangelogManager _changelog = default!; - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; public bool AdminOnly; diff --git a/Content.Client/Clickable/ClickMapManager.cs b/Content.Client/Clickable/ClickMapManager.cs index b90289a022..6a77c7e054 100644 --- a/Content.Client/Clickable/ClickMapManager.cs +++ b/Content.Client/Clickable/ClickMapManager.cs @@ -23,7 +23,7 @@ namespace Content.Client.Clickable private const float Threshold = 0.25f; private const int ClickRadius = 2; - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; [ViewVariables] private readonly Dictionary _textureMaps = new(); diff --git a/Content.Client/Clothing/ClientClothingSystem.cs b/Content.Client/Clothing/ClientClothingSystem.cs index 1dd0fed137..b16e14d653 100644 --- a/Content.Client/Clothing/ClientClothingSystem.cs +++ b/Content.Client/Clothing/ClientClothingSystem.cs @@ -45,7 +45,7 @@ public sealed class ClientClothingSystem : ClothingSystem {"suitstorage", "SUITSTORAGE"}, }; - [Dependency] private readonly IClientResourceCache _cache = default!; + [Dependency] private readonly IResourceCache _cache = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!; public override void Initialize() diff --git a/Content.Client/Credits/CreditsWindow.xaml.cs b/Content.Client/Credits/CreditsWindow.xaml.cs index 60ac579845..666ff2aa48 100644 --- a/Content.Client/Credits/CreditsWindow.xaml.cs +++ b/Content.Client/Credits/CreditsWindow.xaml.cs @@ -11,7 +11,6 @@ using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Configuration; -using Robust.Shared.ContentPack; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; @@ -24,7 +23,7 @@ namespace Content.Client.Credits [GenerateTypedNameReferences] public sealed partial class CreditsWindow : DefaultWindow { - [Dependency] private readonly IResourceManager _resourceManager = default!; + [Dependency] private readonly IResourceCache _resourceManager = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; private static readonly Dictionary PatronTierPriority = new() @@ -50,7 +49,7 @@ namespace Content.Client.Credits 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}); diff --git a/Content.Client/Decals/UI/PaletteColorPicker.xaml.cs b/Content.Client/Decals/UI/PaletteColorPicker.xaml.cs index b491dbaa48..2d6a89101c 100644 --- a/Content.Client/Decals/UI/PaletteColorPicker.xaml.cs +++ b/Content.Client/Decals/UI/PaletteColorPicker.xaml.cs @@ -12,7 +12,7 @@ namespace Content.Client.Decals.UI; public sealed partial class PaletteColorPicker : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; private readonly TextureResource _tex; diff --git a/Content.Client/Disposal/Systems/DisposalUnitSystem.cs b/Content.Client/Disposal/Systems/DisposalUnitSystem.cs index 344bd2ec97..d10101754c 100644 --- a/Content.Client/Disposal/Systems/DisposalUnitSystem.cs +++ b/Content.Client/Disposal/Systems/DisposalUnitSystem.cs @@ -6,8 +6,6 @@ using Content.Shared.Emag.Systems; using Robust.Client.GameObjects; using Robust.Client.Animations; using Robust.Client.Graphics; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; using Robust.Shared.Physics.Events; using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent; diff --git a/Content.Client/Doors/DoorSystem.cs b/Content.Client/Doors/DoorSystem.cs index ccdd9c48cd..4b82d3506a 100644 --- a/Content.Client/Doors/DoorSystem.cs +++ b/Content.Client/Doors/DoorSystem.cs @@ -14,7 +14,7 @@ public sealed class DoorSystem : SharedDoorSystem { [Dependency] private readonly AnimationPlayerSystem _animationSystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; 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) { if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted) - Audio.PlayEntity(soundSpecifier, Filter.Local(), uid, false, audioParams); + Audio.Play(soundSpecifier, Filter.Local(), uid, false, audioParams); } } diff --git a/Content.Client/Explosion/ExplosionOverlaySystem.cs b/Content.Client/Explosion/ExplosionOverlaySystem.cs index a6188bf948..60208ea1a0 100644 --- a/Content.Client/Explosion/ExplosionOverlaySystem.cs +++ b/Content.Client/Explosion/ExplosionOverlaySystem.cs @@ -15,7 +15,7 @@ namespace Content.Client.Explosion; public sealed class ExplosionOverlaySystem : EntitySystem { [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 SharedPointLightSystem _lights = default!; diff --git a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs index 021582faa5..c1fba48309 100644 --- a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs +++ b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs @@ -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? OnFollowFax; - [Dependency] private readonly IClientResourceCache _resCache = default!; + [Dependency] private readonly IResourceCache _resCache = default!; public AdminFaxWindow() { diff --git a/Content.Client/Fluids/PuddleOverlay.cs b/Content.Client/Fluids/PuddleOverlay.cs index 035d7e893b..8c8b13a1ef 100644 --- a/Content.Client/Fluids/PuddleOverlay.cs +++ b/Content.Client/Fluids/PuddleOverlay.cs @@ -27,7 +27,7 @@ public sealed class PuddleOverlay : Overlay { IoCManager.InjectDependencies(this); _debugOverlaySystem = _entitySystemManager.GetEntitySystem(); - var cache = IoCManager.Resolve(); + var cache = IoCManager.Resolve(); _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); } diff --git a/Content.Client/GameTicking/Managers/ClientGameTicker.cs b/Content.Client/GameTicking/Managers/ClientGameTicker.cs index a25b592f57..e363ae764b 100644 --- a/Content.Client/GameTicking/Managers/ClientGameTicker.cs +++ b/Content.Client/GameTicking/Managers/ClientGameTicker.cs @@ -7,8 +7,6 @@ using Content.Shared.GameWindow; using JetBrains.Annotations; using Robust.Client.Graphics; using Robust.Client.State; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Utility; diff --git a/Content.Client/Gravity/GravitySystem.Shake.cs b/Content.Client/Gravity/GravitySystem.Shake.cs index 55becdd395..fee072051a 100644 --- a/Content.Client/Gravity/GravitySystem.Shake.cs +++ b/Content.Client/Gravity/GravitySystem.Shake.cs @@ -3,7 +3,6 @@ using Content.Shared.Camera; using Content.Shared.Gravity; using Robust.Client.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Client/Guidebook/GuidebookSystem.cs b/Content.Client/Guidebook/GuidebookSystem.cs index dffc625cb8..8ef6f13e31 100644 --- a/Content.Client/Guidebook/GuidebookSystem.cs +++ b/Content.Client/Guidebook/GuidebookSystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Tag; using Content.Shared.Verbs; using Robust.Client.GameObjects; using Robust.Client.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Timing; diff --git a/Content.Client/Info/RulesAndInfoWindow.cs b/Content.Client/Info/RulesAndInfoWindow.cs index 7a763a1d6f..2905857b39 100644 --- a/Content.Client/Info/RulesAndInfoWindow.cs +++ b/Content.Client/Info/RulesAndInfoWindow.cs @@ -11,7 +11,7 @@ namespace Content.Client.Info { public sealed class RulesAndInfoWindow : DefaultWindow { - [Dependency] private readonly IResourceManager _resourceManager = default!; + [Dependency] private readonly IResourceCache _resourceManager = default!; [Dependency] private readonly RulesManager _rules = default!; public RulesAndInfoWindow() diff --git a/Content.Client/IoC/StaticIoC.cs b/Content.Client/IoC/StaticIoC.cs index 767a9f01ec..9cbe8053e3 100644 --- a/Content.Client/IoC/StaticIoC.cs +++ b/Content.Client/IoC/StaticIoC.cs @@ -1,11 +1,10 @@ using Robust.Client.ResourceManagement; -using Robust.Shared.ContentPack; using Robust.Shared.IoC; namespace Content.Client.IoC { public static class StaticIoC { - public static IClientResourceCache ResC => IoCManager.Resolve(); + public static IResourceCache ResC => IoCManager.Resolve(); } } diff --git a/Content.Client/Items/Systems/ItemSystem.cs b/Content.Client/Items/Systems/ItemSystem.cs index 70a845f57e..e406ba2b55 100644 --- a/Content.Client/Items/Systems/ItemSystem.cs +++ b/Content.Client/Items/Systems/ItemSystem.cs @@ -12,7 +12,7 @@ namespace Content.Client.Items.Systems; public sealed class ItemSystem : SharedItemSystem { - [Dependency] private readonly IClientResourceCache _resCache = default!; + [Dependency] private readonly IResourceCache _resCache = default!; public override void Initialize() { diff --git a/Content.Client/Light/Components/ExpendableLightComponent.cs b/Content.Client/Light/Components/ExpendableLightComponent.cs index f5dbcc297e..2ce0249fc1 100644 --- a/Content.Client/Light/Components/ExpendableLightComponent.cs +++ b/Content.Client/Light/Components/ExpendableLightComponent.cs @@ -44,7 +44,7 @@ public sealed partial class ExpendableLightComponent : SharedExpendableLightComp /// The sound that plays when the expendable light is lit. /// [Access(typeof(ExpendableLightSystem))] - public EntityUid? PlayingStream; + public IPlayingAudioStream? PlayingStream; } public enum ExpendableLightVisualLayers : byte diff --git a/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs b/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs index a2a7fb2531..6e9e546dfa 100644 --- a/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs +++ b/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs @@ -2,8 +2,6 @@ using Content.Client.Light.Components; using Content.Shared.Light.Components; using Robust.Client.GameObjects; using Robust.Client.Graphics; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Client.Light.EntitySystems; @@ -21,7 +19,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem OverlaySpace.ScreenSpace; - public HTNOverlay(IEntityManager entManager, IClientResourceCache resourceCache) + public HTNOverlay(IEntityManager entManager, IResourceCache resourceCache) { _entManager = entManager; _font = new VectorFont(resourceCache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10); diff --git a/Content.Client/NPC/HTN/HTNSystem.cs b/Content.Client/NPC/HTN/HTNSystem.cs index 41e9d5cb72..7ea914b8c3 100644 --- a/Content.Client/NPC/HTN/HTNSystem.cs +++ b/Content.Client/NPC/HTN/HTNSystem.cs @@ -19,7 +19,7 @@ public sealed class HTNSystem : EntitySystem if (_enableOverlay) { - overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve())); + overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve())); RaiseNetworkEvent(new RequestHTNMessage() { Enabled = true, diff --git a/Content.Client/NPC/PathfindingSystem.cs b/Content.Client/NPC/PathfindingSystem.cs index c2579ab5ec..548edd601c 100644 --- a/Content.Client/NPC/PathfindingSystem.cs +++ b/Content.Client/NPC/PathfindingSystem.cs @@ -20,7 +20,7 @@ namespace Content.Client.NPC [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IInputManager _inputManager = 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 MapSystem _mapSystem = default!; @@ -151,7 +151,7 @@ namespace Content.Client.NPC IEyeManager eyeManager, IInputManager inputManager, IMapManager mapManager, - IClientResourceCache cache, + IResourceCache cache, PathfindingSystem system, MapSystem mapSystem) { diff --git a/Content.Client/NodeContainer/NodeGroupSystem.cs b/Content.Client/NodeContainer/NodeGroupSystem.cs index 55532b57f0..0a3d7ddad0 100644 --- a/Content.Client/NodeContainer/NodeGroupSystem.cs +++ b/Content.Client/NodeContainer/NodeGroupSystem.cs @@ -18,7 +18,7 @@ namespace Content.Client.NodeContainer [Dependency] private readonly EntityLookupSystem _entityLookup = default!; [Dependency] private readonly IMapManager _mapManager = 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; } diff --git a/Content.Client/NodeContainer/NodeVisualizationOverlay.cs b/Content.Client/NodeContainer/NodeVisualizationOverlay.cs index b8e2e3bbb7..f10eb9ed8b 100644 --- a/Content.Client/NodeContainer/NodeVisualizationOverlay.cs +++ b/Content.Client/NodeContainer/NodeVisualizationOverlay.cs @@ -38,7 +38,7 @@ namespace Content.Client.NodeContainer EntityLookupSystem lookup, IMapManager mapManager, IInputManager inputManager, - IClientResourceCache cache, + IResourceCache cache, IEntityManager entityManager) { _system = system; diff --git a/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs b/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs index 6a9928b8bd..5875c4a33a 100644 --- a/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/AudioTab.xaml.cs @@ -1,7 +1,5 @@ using Content.Shared.CCVar; -using Robust.Client.Audio; using Robust.Client.AutoGenerated; -using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -16,14 +14,13 @@ namespace Content.Client.Options.UI.Tabs public sealed partial class AudioTab : Control { [Dependency] private readonly IConfigurationManager _cfg = default!; - private readonly AudioSystem _audio; + [Dependency] private readonly IClydeAudio _clydeAudio = default!; public AudioTab() { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); - _audio = IoCManager.Resolve().System(); LobbyMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.LobbyMusicEnabled); RestartSoundsCheckBox.Pressed = _cfg.GetCVar(CCVars.RestartSoundsEnabled); EventMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.EventMusicEnabled); @@ -82,7 +79,7 @@ namespace Content.Client.Options.UI.Tabs private void OnMasterVolumeSliderChanged(Range range) { - _audio.SetMasterVolume(MasterVolumeSlider.Value / 100); + _clydeAudio.SetMasterVolume(MasterVolumeSlider.Value / 100); UpdateChanges(); } @@ -111,7 +108,7 @@ namespace Content.Client.Options.UI.Tabs 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 // For the UI we just display 0-100 still elsewhere _cfg.SetCVar(CVars.MidiVolume, LV100ToDB(MidiVolumeSlider.Value, CCVars.MidiMultiplier)); @@ -135,7 +132,7 @@ namespace Content.Client.Options.UI.Tabs 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); AmbienceVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CCVars.AmbienceVolume), CCVars.AmbienceMultiplier); AmbientMusicVolumeSlider.Value = @@ -153,8 +150,8 @@ namespace Content.Client.Options.UI.Tabs // Do be sure to rename the setting though private float DBToLV100(float db, float multiplier = 1f) { - var beri = (float) (Math.Pow(10, db / 10) * 100 / multiplier); - return beri; + var weh = (float) (Math.Pow(10, db / 10) * 100 / multiplier); + return weh; } private float LV100ToDB(float lv100, float multiplier = 1f) @@ -167,7 +164,7 @@ namespace Content.Client.Options.UI.Tabs private void UpdateChanges() { 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 = Math.Abs(MidiVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier)) < 0.01f; var isAmbientVolumeSame = diff --git a/Content.Client/Paper/UI/PaperWindow.xaml.cs b/Content.Client/Paper/UI/PaperWindow.xaml.cs index 6ff66b3821..c3192a495d 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml.cs +++ b/Content.Client/Paper/UI/PaperWindow.xaml.cs @@ -61,7 +61,7 @@ namespace Content.Client.Paper.UI // Randomize the placement of any stamps based on the entity UID // so that there's some variety in different papers. StampDisplay.PlacementSeed = (int)entity; - var resCache = IoCManager.Resolve(); + var resCache = IoCManager.Resolve(); // Initialize the background: PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate; diff --git a/Content.Client/Paper/UI/StampWidget.xaml.cs b/Content.Client/Paper/UI/StampWidget.xaml.cs index 2481859492..a04508aeba 100644 --- a/Content.Client/Paper/UI/StampWidget.xaml.cs +++ b/Content.Client/Paper/UI/StampWidget.xaml.cs @@ -32,7 +32,7 @@ public sealed partial class StampWidget : PanelContainer public StampWidget() { RobustXamlLoader.Load(this); - var resCache = IoCManager.Resolve(); + var resCache = IoCManager.Resolve(); var borderImage = resCache.GetResource( "/Textures/Interface/Paper/paper_stamp_border.svg.96dpi.png"); _borderTexture = new StyleBoxTexture { diff --git a/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs b/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs index 2e69a5a562..81f012d93c 100644 --- a/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs +++ b/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs @@ -57,17 +57,16 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou } var debugParallax = IoCManager.Resolve().GetCVar(CCVars.ParallaxDebug); - var resManager = IoCManager.Resolve(); if (debugParallax - || !resManager.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig) + || !StaticIoC.ResC.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig) || previousParallaxConfig != parallaxConfig) { var table = Toml.ReadString(parallaxConfig); await UpdateCachedTexture(table, debugParallax, cancel); //Update the previous config - using var writer = resManager.UserData.OpenWriteText(PreviousParallaxConfigPath); + using var writer = StaticIoC.ResC.UserData.OpenWriteText(PreviousParallaxConfigPath); writer.Write(parallaxConfig); } @@ -82,7 +81,7 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou try { // 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) { @@ -105,34 +104,31 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou // 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. cancel.ThrowIfCancellationRequested(); - var resManager = IoCManager.Resolve(); // Store it and CRC so further game starts don't need to regenerate it. - await using var imageStream = resManager.UserData.OpenWrite(ParallaxCachedImagePath); - await newParallexImage.SaveAsPngAsync(imageStream, cancel); + using var imageStream = StaticIoC.ResC.UserData.OpenWrite(ParallaxCachedImagePath); + newParallexImage.SaveAsPng(imageStream); if (saveDebugLayers) { for (var i = 0; i < debugImages!.Count; i++) { var debugImage = debugImages[i]; - await using var debugImageStream = resManager.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png")); - await debugImage.SaveAsPngAsync(debugImageStream, cancel); + using var debugImageStream = StaticIoC.ResC.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png")); + debugImage.SaveAsPng(debugImageStream); } } } private Texture GetCachedTexture() { - var resManager = IoCManager.Resolve(); - using var imageStream = resManager.UserData.OpenRead(ParallaxCachedImagePath); + using var imageStream = StaticIoC.ResC.UserData.OpenRead(ParallaxCachedImagePath); return Texture.LoadFromPNGStream(imageStream, "Parallax"); } private string? GetParallaxConfig() { - var resManager = IoCManager.Resolve(); - if (!resManager.TryContentFileRead(ParallaxConfigPath, out var configStream)) + if (!StaticIoC.ResC.TryContentFileRead(ParallaxConfigPath, out var configStream)) { return null; } diff --git a/Content.Client/ParticleAccelerator/UI/ParticleAcceleratorControlMenu.cs b/Content.Client/ParticleAccelerator/UI/ParticleAcceleratorControlMenu.cs index 0422f1fa66..c69e027137 100644 --- a/Content.Client/ParticleAccelerator/UI/ParticleAcceleratorControlMenu.cs +++ b/Content.Client/ParticleAccelerator/UI/ParticleAcceleratorControlMenu.cs @@ -60,7 +60,7 @@ namespace Content.Client.ParticleAccelerator.UI _drawNoiseGenerator.SetFractalType(FastNoiseLite.FractalType.FBm); _drawNoiseGenerator.SetFrequency(0.5f); - var resourceCache = IoCManager.Resolve(); + var resourceCache = IoCManager.Resolve(); var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13); 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 RSI _rsi; - public PASegmentControl(ParticleAcceleratorControlMenu menu, IClientResourceCache cache, string name) + public PASegmentControl(ParticleAcceleratorControlMenu menu, IResourceCache cache, string name) { _menu = menu; _baseState = name; diff --git a/Content.Client/Pinpointer/UI/NavMapControl.cs b/Content.Client/Pinpointer/UI/NavMapControl.cs index 7c222ee4a8..04d8cc76f9 100644 --- a/Content.Client/Pinpointer/UI/NavMapControl.cs +++ b/Content.Client/Pinpointer/UI/NavMapControl.cs @@ -57,7 +57,7 @@ public sealed class NavMapControl : MapGridControl IoCManager.InjectDependencies(this); _transform = _entManager.System(); - var cache = IoCManager.Resolve(); + var cache = IoCManager.Resolve(); _font = new VectorFont(cache.GetResource("/EngineFonts/NotoSans/NotoSans-Regular.ttf"), 16); RectClipContent = true; diff --git a/Content.Client/Popups/PopupOverlay.cs b/Content.Client/Popups/PopupOverlay.cs index 5914c1b9d3..5adc2e1ff0 100644 --- a/Content.Client/Popups/PopupOverlay.cs +++ b/Content.Client/Popups/PopupOverlay.cs @@ -39,7 +39,7 @@ public sealed class PopupOverlay : Overlay IEntityManager entManager, IPlayerManager playerMgr, IPrototypeManager protoManager, - IClientResourceCache cache, + IResourceCache cache, IUserInterfaceManager uiManager, PopupSystem popup) { diff --git a/Content.Client/Popups/PopupSystem.cs b/Content.Client/Popups/PopupSystem.cs index 4e27b119fc..d68272a107 100644 --- a/Content.Client/Popups/PopupSystem.cs +++ b/Content.Client/Popups/PopupSystem.cs @@ -23,7 +23,7 @@ namespace Content.Client.Popups [Dependency] private readonly IOverlayManager _overlay = default!; [Dependency] private readonly IPlayerManager _playerManager = 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 IUserInterfaceManager _uiManager = default!; [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; diff --git a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs index 8ff2f6c2d9..f1052086de 100644 --- a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs +++ b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs @@ -42,7 +42,7 @@ namespace Content.Client.Preferences.UI public CharacterSetupGui( IEntityManager entityManager, - IClientResourceCache resourceCache, + IResourceCache resourceCache, IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager, IConfigurationManager configurationManager) diff --git a/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs b/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs index cfa7e27fb8..8c721fa777 100644 --- a/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs +++ b/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs @@ -23,7 +23,7 @@ public sealed class RadiationDebugOverlay : Overlay IoCManager.InjectDependencies(this); _radiation = _entityManager.System(); - var cache = IoCManager.Resolve(); + var cache = IoCManager.Resolve(); _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); } diff --git a/Content.Client/Replay/ContentReplayPlaybackManager.cs b/Content.Client/Replay/ContentReplayPlaybackManager.cs index b9880f339b..cbb5117255 100644 --- a/Content.Client/Replay/ContentReplayPlaybackManager.cs +++ b/Content.Client/Replay/ContentReplayPlaybackManager.cs @@ -135,6 +135,7 @@ public sealed class ContentReplayPlaybackManager { case RoundEndMessageEvent: case PopupEvent: + case AudioMessage: case PickupAnimationEvent: case MeleeLungeEvent: case SharedGunSystem.HitscanEvent: diff --git a/Content.Client/Replay/UI/Loading/LoadingScreen.cs b/Content.Client/Replay/UI/Loading/LoadingScreen.cs index d546a396f5..f3f75a2950 100644 --- a/Content.Client/Replay/UI/Loading/LoadingScreen.cs +++ b/Content.Client/Replay/UI/Loading/LoadingScreen.cs @@ -9,7 +9,7 @@ namespace Content.Client.Replay.UI.Loading; [Virtual] public class LoadingScreen : State { - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; public event Action? OnJobFinished; diff --git a/Content.Client/Replay/UI/Loading/LoadingScreenControl.xaml.cs b/Content.Client/Replay/UI/Loading/LoadingScreenControl.xaml.cs index 6847a73ab9..bbb5111438 100644 --- a/Content.Client/Replay/UI/Loading/LoadingScreenControl.xaml.cs +++ b/Content.Client/Replay/UI/Loading/LoadingScreenControl.xaml.cs @@ -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 LoadingScreenControl(IClientResourceCache resCache) + public LoadingScreenControl(IResourceCache resCache) { RobustXamlLoader.Load(this); diff --git a/Content.Client/Resources/ResourceCacheExtensions.cs b/Content.Client/Resources/ResourceCacheExtensions.cs index b5a74afcb6..be8b8fed3b 100644 --- a/Content.Client/Resources/ResourceCacheExtensions.cs +++ b/Content.Client/Resources/ResourceCacheExtensions.cs @@ -9,27 +9,27 @@ namespace Content.Client.Resources [PublicAPI] 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(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)); } - 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(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); } - 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]; for (var i = 0; i < path.Length; i++) @@ -38,7 +38,7 @@ namespace Content.Client.Resources 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]; for (var i = 0; i < path.Length; i++) diff --git a/Content.Client/SprayPainter/SprayPainterSystem.cs b/Content.Client/SprayPainter/SprayPainterSystem.cs index cd12f8fc45..4476e2a90a 100644 --- a/Content.Client/SprayPainter/SprayPainterSystem.cs +++ b/Content.Client/SprayPainter/SprayPainterSystem.cs @@ -10,7 +10,7 @@ namespace Content.Client.SprayPainter; public sealed class SprayPainterSystem : SharedSprayPainterSystem { - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; public List Entries { get; private set; } = new(); diff --git a/Content.Client/Stylesheets/StyleBase.cs b/Content.Client/Stylesheets/StyleBase.cs index 02f21f0bf5..5068f97e36 100644 --- a/Content.Client/Stylesheets/StyleBase.cs +++ b/Content.Client/Stylesheets/StyleBase.cs @@ -41,7 +41,7 @@ namespace Content.Client.Stylesheets protected StyleBoxTexture BaseAngleRect { get; } protected StyleBoxTexture AngleBorderRect { get; } - protected StyleBase(IClientResourceCache resCache) + protected StyleBase(IResourceCache resCache) { var notoSans12 = resCache.GetFont ( diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index b581c49a9e..2ef5a63ac7 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -20,7 +20,7 @@ namespace Content.Client.Stylesheets { 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 sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular"; @@ -144,7 +144,7 @@ namespace Content.Client.Stylesheets public override Stylesheet Stylesheet { get; } - public StyleNano(IClientResourceCache resCache) : base(resCache) + public StyleNano(IResourceCache resCache) : base(resCache) { var notoSans8 = resCache.NotoStack(size: 8); var notoSans10 = resCache.NotoStack(size: 10); diff --git a/Content.Client/Stylesheets/StyleSpace.cs b/Content.Client/Stylesheets/StyleSpace.cs index 2c48ce65f5..3bb4e986af 100644 --- a/Content.Client/Stylesheets/StyleSpace.cs +++ b/Content.Client/Stylesheets/StyleSpace.cs @@ -24,7 +24,7 @@ namespace Content.Client.Stylesheets public override Stylesheet Stylesheet { get; } - public StyleSpace(IClientResourceCache resCache) : base(resCache) + public StyleSpace(IResourceCache resCache) : base(resCache) { var notoSans10 = resCache.GetFont ( diff --git a/Content.Client/Stylesheets/StylesheetManager.cs b/Content.Client/Stylesheets/StylesheetManager.cs index f817816fc2..4c767bd554 100644 --- a/Content.Client/Stylesheets/StylesheetManager.cs +++ b/Content.Client/Stylesheets/StylesheetManager.cs @@ -7,7 +7,7 @@ namespace Content.Client.Stylesheets public sealed class StylesheetManager : IStylesheetManager { [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 SheetSpace { get; private set; } = default!; diff --git a/Content.Client/SurveillanceCamera/UI/SurveillanceCameraMonitorWindow.xaml.cs b/Content.Client/SurveillanceCamera/UI/SurveillanceCameraMonitorWindow.xaml.cs index 0f60c49752..59ac435acf 100644 --- a/Content.Client/SurveillanceCamera/UI/SurveillanceCameraMonitorWindow.xaml.cs +++ b/Content.Client/SurveillanceCamera/UI/SurveillanceCameraMonitorWindow.xaml.cs @@ -18,7 +18,7 @@ namespace Content.Client.SurveillanceCamera.UI; public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; public event Action? CameraSelected; public event Action? SubnetOpened; diff --git a/Content.Client/Traits/ParacusiaSystem.cs b/Content.Client/Traits/ParacusiaSystem.cs index ba4f922ddb..87abec80bb 100644 --- a/Content.Client/Traits/ParacusiaSystem.cs +++ b/Content.Client/Traits/ParacusiaSystem.cs @@ -2,8 +2,6 @@ using System.Numerics; using Content.Shared.Traits.Assorted; using Robust.Shared.Random; using Robust.Client.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Client.Traits; @@ -42,7 +40,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args) { - component.Stream = _audio.Stop(component.Stream); + component.Stream?.Stop(); } private void PlayParacusiaSounds(EntityUid uid) @@ -68,7 +66,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem var newCoords = Transform(uid).Coordinates.Offset(randomOffset); // Play the sound - paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords).Value.Entity; + paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords); } } diff --git a/Content.Client/Trigger/TimerTriggerVisualizerSystem.cs b/Content.Client/Trigger/TimerTriggerVisualizerSystem.cs index 44c92456a1..1c91565858 100644 --- a/Content.Client/Trigger/TimerTriggerVisualizerSystem.cs +++ b/Content.Client/Trigger/TimerTriggerVisualizerSystem.cs @@ -1,8 +1,6 @@ using Content.Shared.Trigger; using Robust.Client.Animations; using Robust.Client.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameObjects; namespace Content.Client.Trigger; diff --git a/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs b/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs index f52bd6573e..6cf7622ea4 100644 --- a/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs +++ b/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs @@ -19,7 +19,7 @@ namespace Content.Client.UserInterface.Controls.FancyTree; [GenerateTypedNameReferences] 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 StylePropertyLineColor = "LineColor"; diff --git a/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs b/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs index 7ab855c0ee..7797a096de 100644 --- a/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs +++ b/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs @@ -21,7 +21,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank private readonly Control _contentContainer; - private readonly IClientResourceCache _resourceCache = default!; + private readonly IResourceCache _resourceCache = default!; private readonly RichTextLabel _lblPressure; private readonly FloatSpinBox _spbPressure; private readonly RichTextLabel _lblInternals; @@ -30,7 +30,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank public GasTankWindow(GasTankBoundUserInterface owner) { TextureButton btnClose; - _resourceCache = IoCManager.Resolve(); + _resourceCache = IoCManager.Resolve(); _owner = owner; var rootContainer = new LayoutContainer {Name = "GasTankRoot"}; AddChild(rootContainer); diff --git a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs index 659792f967..87d4b8072f 100644 --- a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs +++ b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs @@ -20,7 +20,6 @@ using Robust.Client.UserInterface.Controllers; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Input.Binding; using Robust.Shared.Network; using Robust.Shared.Player; @@ -35,7 +34,6 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged UIManager.GetActiveUIWidgetOrNull()?.AHelpButton; @@ -130,7 +128,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged(); - var filterTexture = IoCManager.Resolve() + var filterTexture = IoCManager.Resolve() .GetTexture("/Textures/Interface/Nano/filter.svg.96dpi.png"); // needed for same reason as ChannelSelectorButton diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs index 79d23a94be..56c0c28634 100644 --- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs +++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs @@ -1,9 +1,7 @@ using Content.Client.UserInterface.Systems.Chat.Controls; using Content.Shared.Chat; using Content.Shared.Input; -using Robust.Client.Audio; using Robust.Client.AutoGenerated; -using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; @@ -21,7 +19,6 @@ public partial class ChatBox : UIWidget #pragma warning restore RA0003 { private readonly ChatUIController _controller; - private readonly IEntityManager _entManager; public bool Main { get; set; } @@ -30,7 +27,6 @@ public partial class ChatBox : UIWidget public ChatBox() { RobustXamlLoader.Load(this); - _entManager = IoCManager.Resolve(); ChatInput.Input.OnTextEntered += OnTextEntered; ChatInput.Input.OnKeyBindDown += OnKeyBindDown; @@ -56,8 +52,8 @@ public partial class ChatBox : UIWidget return; } - if (msg is { Read: false, AudioPath: { } }) - _entManager.System().PlayGlobal(msg.AudioPath, Filter.Local(), false, AudioParams.Default.WithVolume(msg.AudioVolume)); + if (msg is { Read: false, AudioPath: not null }) + SoundSystem.Play(msg.AudioPath, Filter.Local(), new AudioParams().WithVolume(msg.AudioVolume)); msg.Read = true; diff --git a/Content.Client/UserInterface/XamlExtensions/TextureExtension.cs b/Content.Client/UserInterface/XamlExtensions/TextureExtension.cs index 2cabe67988..4a64b466c3 100644 --- a/Content.Client/UserInterface/XamlExtensions/TextureExtension.cs +++ b/Content.Client/UserInterface/XamlExtensions/TextureExtension.cs @@ -8,12 +8,12 @@ namespace Content.Client.UserInterface.XamlExtensions; [PublicAPI] public sealed class TexExtension { - private IClientResourceCache _resourceCache; + private IResourceCache _resourceCache; public string Path { get; } public TexExtension(string path) { - _resourceCache = IoCManager.Resolve(); + _resourceCache = IoCManager.Resolve(); Path = path; } diff --git a/Content.Client/Voting/VoteManager.cs b/Content.Client/Voting/VoteManager.cs index 63c706c86b..3220f2bdb2 100644 --- a/Content.Client/Voting/VoteManager.cs +++ b/Content.Client/Voting/VoteManager.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using Content.Shared.Voting; using Robust.Client; -using Robust.Client.Audio; using Robust.Client.Console; using Robust.Client.GameObjects; using Robust.Client.UserInterface; diff --git a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs index 565672ad38..4e4df4a156 100644 --- a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs @@ -2,8 +2,6 @@ using Content.Shared.Projectiles; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Systems; using Robust.Client.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Physics.Events; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Client/Weather/WeatherOverlay.cs b/Content.Client/Weather/WeatherOverlay.cs index 0a487c1b5b..12af31b863 100644 --- a/Content.Client/Weather/WeatherOverlay.cs +++ b/Content.Client/Weather/WeatherOverlay.cs @@ -24,7 +24,7 @@ public sealed class WeatherOverlay : Overlay [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IMapManager _mapManager = 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 SpriteSystem _sprite; private readonly WeatherSystem _weather; diff --git a/Content.Client/Weather/WeatherSystem.cs b/Content.Client/Weather/WeatherSystem.cs index bf8aa2a0f7..e1742f4790 100644 --- a/Content.Client/Weather/WeatherSystem.cs +++ b/Content.Client/Weather/WeatherSystem.cs @@ -1,10 +1,8 @@ using System.Numerics; using Content.Shared.Weather; -using Robust.Client.Audio; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.Player; -using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Map.Components; @@ -12,7 +10,6 @@ using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; using Robust.Shared.Player; -using AudioComponent = Robust.Shared.Audio.Components.AudioComponent; namespace Content.Client.Weather; @@ -58,18 +55,18 @@ public sealed class WeatherSystem : SharedWeatherSystem { weather.LastOcclusion = 0f; weather.LastAlpha = 0f; - weather.Stream = _audio.Stop(weather.Stream); + weather.Stream?.Stop(); + weather.Stream = null; return; } if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null) 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 stream = weather.Stream.Value; - var comp = Comp(stream); + var stream = (AudioSystem.PlayingStream) weather.Stream!; var alpha = weather.LastAlpha; alpha = MathF.Pow(alpha, 2f) * volumeMod; // TODO: Lerp this occlusion. @@ -135,7 +132,7 @@ public sealed class WeatherSystem : SharedWeatherSystem { occlusion = _physics.IntersectRayPenetration(entXform.MapID, 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; // Full volume if not on grid - comp.Gain = weather.LastAlpha; - comp.Occlusion = weather.LastOcclusion; + stream.Source.SetVolumeDirect(weather.LastAlpha); + stream.Source.SetOcclusion(weather.LastOcclusion); } protected override void EndWeather(EntityUid uid, WeatherComponent component, string proto) @@ -175,8 +172,9 @@ public sealed class WeatherSystem : SharedWeatherSystem return true; // TODO: Fades (properly) - weather.Stream = _audio.Stop(weather.Stream); - weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true)?.Entity; + weather.Stream?.Stop(); + weather.Stream = null; + weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true); return true; } diff --git a/Content.Client/Wires/UI/WiresMenu.cs b/Content.Client/Wires/UI/WiresMenu.cs index e1c93aa428..7bccc20861 100644 --- a/Content.Client/Wires/UI/WiresMenu.cs +++ b/Content.Client/Wires/UI/WiresMenu.cs @@ -22,7 +22,7 @@ namespace Content.Client.Wires.UI { public sealed class WiresMenu : BaseWindow { - [Dependency] private readonly IClientResourceCache _resourceCache = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; public WiresBoundUserInterface Owner { get; } @@ -299,7 +299,7 @@ namespace Content.Client.Wires.UI private sealed class WireControl : Control { - private IClientResourceCache _resourceCache; + private IResourceCache _resourceCache; 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 WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type, - IClientResourceCache resourceCache) + IResourceCache resourceCache) { _resourceCache = resourceCache; @@ -412,10 +412,10 @@ namespace Content.Client.Wires.UI "/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, - IClientResourceCache resourceCache) + IResourceCache resourceCache) { _resourceCache = resourceCache; _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); hsv.Z /= 2; diff --git a/Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs b/Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs index 47c0d84977..34692aa082 100644 --- a/Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs +++ b/Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs @@ -6,8 +6,6 @@ using Content.Server.Destructible.Thresholds.Triggers; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameObjects; using Robust.Shared.Prototypes; using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes; diff --git a/Content.IntegrationTests/Tests/DummyIconTest.cs b/Content.IntegrationTests/Tests/DummyIconTest.cs index b9b76cdd57..a11191a51e 100644 --- a/Content.IntegrationTests/Tests/DummyIconTest.cs +++ b/Content.IntegrationTests/Tests/DummyIconTest.cs @@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true }); var client = pair.Client; var prototypeManager = client.ResolveDependency(); - var resourceCache = client.ResolveDependency(); + var resourceCache = client.ResolveDependency(); await client.WaitAssertion(() => { diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs index f59952afec..25171e1ea2 100644 --- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs +++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs @@ -619,9 +619,6 @@ public abstract partial class InteractionTest { foreach (var (proto, quantity) in expected.Entities) { - if (proto == "Audio") - continue; - if (quantity < 0 && failOnExcess) Assert.Fail($"Unexpected entity/stack: {proto}, quantity: {-quantity}"); diff --git a/Content.MapRenderer/Painters/DecalPainter.cs b/Content.MapRenderer/Painters/DecalPainter.cs index f863595f9a..ffcd140a6e 100644 --- a/Content.MapRenderer/Painters/DecalPainter.cs +++ b/Content.MapRenderer/Painters/DecalPainter.cs @@ -4,7 +4,6 @@ using System.IO; using Content.Shared.Decals; using Robust.Client.ResourceManagement; using Robust.Client.Utility; -using Robust.Shared.ContentPack; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -17,7 +16,7 @@ namespace Content.MapRenderer.Painters; public sealed class DecalPainter { - private readonly IResourceManager _resManager; + private readonly IResourceCache _cResourceCache; private readonly IPrototypeManager _sPrototypeManager; @@ -25,7 +24,7 @@ public sealed class DecalPainter public DecalPainter(ClientIntegrationInstance client, ServerIntegrationInstance server) { - _resManager = client.ResolveDependency(); + _cResourceCache = client.ResolveDependency(); _sPrototypeManager = server.ResolveDependency(); } @@ -64,7 +63,7 @@ public sealed class DecalPainter Stream stream; if (sprite is SpriteSpecifier.Texture texture) { - stream = _resManager.ContentFileRead(texture.TexturePath); + stream = _cResourceCache.ContentFileRead(texture.TexturePath); } else if (sprite is SpriteSpecifier.Rsi rsi) { @@ -74,7 +73,7 @@ public sealed class DecalPainter path = $"/Textures/{path}"; } - stream = _resManager.ContentFileRead(path); + stream = _cResourceCache.ContentFileRead(path); } else { diff --git a/Content.MapRenderer/Painters/EntityPainter.cs b/Content.MapRenderer/Painters/EntityPainter.cs index de6b98711f..79f2ed7679 100644 --- a/Content.MapRenderer/Painters/EntityPainter.cs +++ b/Content.MapRenderer/Painters/EntityPainter.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; -using Robust.Shared.ContentPack; using Robust.Shared.GameObjects; using Robust.Shared.Timing; using SixLabors.ImageSharp; @@ -15,7 +14,7 @@ namespace Content.MapRenderer.Painters; public sealed class EntityPainter { - private readonly IResourceManager _resManager; + private readonly IResourceCache _cResourceCache; private readonly Dictionary<(string path, string state), Image> _images; private readonly Image _errorImage; @@ -24,12 +23,12 @@ public sealed class EntityPainter public EntityPainter(ClientIntegrationInstance client, ServerIntegrationInstance server) { - _resManager = client.ResolveDependency(); + _cResourceCache = client.ResolveDependency(); _sEntityManager = server.ResolveDependency(); _images = new Dictionary<(string path, string state), Image>(); - _errorImage = Image.Load(_resManager.ContentFileRead("/Textures/error.rsi/error.png")); + _errorImage = Image.Load(_cResourceCache.ContentFileRead("/Textures/error.rsi/error.png")); } public void Run(Image canvas, List entities) @@ -82,7 +81,7 @@ public sealed class EntityPainter 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(stream); _images[key] = image; diff --git a/Content.MapRenderer/Painters/TilePainter.cs b/Content.MapRenderer/Painters/TilePainter.cs index cac0f960c4..461bad9f21 100644 --- a/Content.MapRenderer/Painters/TilePainter.cs +++ b/Content.MapRenderer/Painters/TilePainter.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; -using Robust.Shared.ContentPack; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Map.Components; @@ -20,12 +19,12 @@ namespace Content.MapRenderer.Painters public const int TileImageSize = EyeManager.PixelsPerMeter; private readonly ITileDefinitionManager _sTileDefinitionManager; - private readonly IResourceManager _resManager; + private readonly IResourceCache _cResourceCache; public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server) { _sTileDefinitionManager = server.ResolveDependency(); - _resManager = client.ResolveDependency(); + _cResourceCache = client.ResolveDependency(); } public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid) @@ -38,7 +37,7 @@ namespace Content.MapRenderer.Painters var yOffset = -bounds.Bottom; var tileSize = grid.TileSize * TileImageSize; - var images = GetTileImages(_sTileDefinitionManager, _resManager, tileSize); + var images = GetTileImages(_sTileDefinitionManager, _cResourceCache, tileSize); var i = 0; grid.GetAllTiles().AsParallel().ForAll(tile => @@ -62,7 +61,7 @@ namespace Content.MapRenderer.Painters private Dictionary> GetTileImages( ITileDefinitionManager tileDefinitionManager, - IResourceManager resManager, + IResourceCache resourceCache, int tileSize) { var stopwatch = new Stopwatch(); @@ -79,7 +78,7 @@ namespace Content.MapRenderer.Painters images[path] = new List(definition.Variants); - using var stream = resManager.ContentFileRead(path); + using var stream = resourceCache.ContentFileRead(path); Image tileSheet = Image.Load(stream); if (tileSheet.Width != tileSize * definition.Variants || tileSheet.Height != tileSize) diff --git a/Content.Replay/Menu/ReplayMainMenu.cs b/Content.Replay/Menu/ReplayMainMenu.cs index fc75a93acb..5792c1bc01 100644 --- a/Content.Replay/Menu/ReplayMainMenu.cs +++ b/Content.Replay/Menu/ReplayMainMenu.cs @@ -27,7 +27,7 @@ public sealed class ReplayMainScreen : State [Dependency] private readonly IComponentFactory _factory = default!; [Dependency] private readonly IConfigurationManager _cfg = 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 IClientRobustSerializer _serializer = default!; [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; diff --git a/Content.Replay/Menu/ReplayMainMenuControl.xaml.cs b/Content.Replay/Menu/ReplayMainMenuControl.xaml.cs index 824c8f423b..8ab7f7412d 100644 --- a/Content.Replay/Menu/ReplayMainMenuControl.xaml.cs +++ b/Content.Replay/Menu/ReplayMainMenuControl.xaml.cs @@ -11,7 +11,7 @@ namespace Content.Replay.Menu; [GenerateTypedNameReferences] public sealed partial class ReplayMainMenuControl : Control { - public ReplayMainMenuControl(IClientResourceCache resCache) + public ReplayMainMenuControl(IResourceCache resCache) { RobustXamlLoader.Load(this); diff --git a/Content.Server/Access/Systems/AccessOverriderSystem.cs b/Content.Server/Access/Systems/AccessOverriderSystem.cs index 41bb84ab6b..147ac70a6d 100644 --- a/Content.Server/Access/Systems/AccessOverriderSystem.cs +++ b/Content.Server/Access/Systems/AccessOverriderSystem.cs @@ -8,8 +8,6 @@ using Content.Shared.DoAfter; using Content.Shared.Interaction; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; using static Content.Shared.Access.Components.AccessOverriderComponent; diff --git a/Content.Server/Administration/Systems/AdminSystem.cs b/Content.Server/Administration/Systems/AdminSystem.cs index cc31071fe8..feabaa2aad 100644 --- a/Content.Server/Administration/Systems/AdminSystem.cs +++ b/Content.Server/Administration/Systems/AdminSystem.cs @@ -26,7 +26,6 @@ using Content.Shared.Throwing; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Network; @@ -40,6 +39,7 @@ namespace Content.Server.Administration.Systems [Dependency] private readonly IChatManager _chat = default!; [Dependency] private readonly IConfigurationManager _config = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly HandsSystem _hands = default!; [Dependency] private readonly SharedJobSystem _jobs = 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 SharedRoleSystem _role = default!; [Dependency] private readonly GameTicker _gameTicker = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StationRecordsSystem _stationRecords = 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); var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager); 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)) diff --git a/Content.Server/AlertLevel/AlertLevelSystem.cs b/Content.Server/AlertLevel/AlertLevelSystem.cs index b2b63e618e..66e09d34e0 100644 --- a/Content.Server/AlertLevel/AlertLevelSystem.cs +++ b/Content.Server/AlertLevel/AlertLevelSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Chat.Systems; using Content.Server.Station.Systems; using Content.Shared.CCVar; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; @@ -11,11 +10,10 @@ namespace Content.Server.AlertLevel; public sealed class AlertLevelSystem : EntitySystem { - [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly ChatSystem _chatSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = 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. public const string DefaultAlertLevelSet = "stationAlerts"; @@ -176,7 +174,7 @@ public sealed class AlertLevelSystem : EntitySystem if (detail.Sound != null) { 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 { diff --git a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs index c7704ecf76..44140193d2 100644 --- a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs +++ b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Popups; using Robust.Server.Containers; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Timing; diff --git a/Content.Server/Ame/EntitySystems/AmePartSystem.cs b/Content.Server/Ame/EntitySystems/AmePartSystem.cs index a75c092e2e..54a379f693 100644 --- a/Content.Server/Ame/EntitySystems/AmePartSystem.cs +++ b/Content.Server/Ame/EntitySystems/AmePartSystem.cs @@ -6,8 +6,6 @@ using Content.Server.Tools; using Content.Shared.Database; using Content.Shared.Hands.Components; using Content.Shared.Interaction; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; namespace Content.Server.Ame.EntitySystems; diff --git a/Content.Server/Animals/Systems/EggLayerSystem.cs b/Content.Server/Animals/Systems/EggLayerSystem.cs index 35c3bab01d..5189adb031 100644 --- a/Content.Server/Animals/Systems/EggLayerSystem.cs +++ b/Content.Server/Animals/Systems/EggLayerSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.Actions.Events; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Storage; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Server/Anomaly/AnomalySystem.Generator.cs b/Content.Server/Anomaly/AnomalySystem.Generator.cs index 769558a7ad..f1b147ac80 100644 --- a/Content.Server/Anomaly/AnomalySystem.Generator.cs +++ b/Content.Server/Anomaly/AnomalySystem.Generator.cs @@ -81,7 +81,7 @@ public sealed partial class AnomalySystem var generating = EnsureComp(uid); 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; UpdateGeneratorUi(uid, component); } @@ -174,8 +174,7 @@ public sealed partial class AnomalySystem { if (Timing.CurTime < active.EndTime) continue; - - active.AudioStream = _audio.Stop(active.AudioStream); + active.AudioStream?.Stop(); OnGeneratingFinished(ent, gen); } } diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index bb7a7304d9..5f6220f386 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Anomaly; using Content.Shared.Anomaly.Components; using Content.Shared.DoAfter; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Physics.Events; using Robust.Shared.Prototypes; @@ -33,7 +31,6 @@ public sealed partial class AnomalySystem : SharedAnomalySystem [Dependency] private readonly SharedPointLightSystem _pointLight = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly RadioSystem _radio = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; public const float MinParticleVariation = 0.8f; diff --git a/Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs b/Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs index 4233bfd7e1..d768f905ce 100644 --- a/Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs +++ b/Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs @@ -13,5 +13,5 @@ public sealed partial class GeneratingAnomalyGeneratorComponent : Component [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan EndTime = TimeSpan.Zero; - public EntityUid? AudioStream; + public IPlayingAudioStream? AudioStream; } diff --git a/Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs b/Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs index 603396e31a..964a42234d 100644 --- a/Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs @@ -4,8 +4,6 @@ using Content.Server.Anomaly.Components; using Content.Shared.Anomaly.Components; using Content.Shared.Mobs.Components; using Content.Shared.Teleportation.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Anomaly.Effects; diff --git a/Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs b/Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs index 487d20f43f..c87dcf4eae 100644 --- a/Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs @@ -6,7 +6,6 @@ using Content.Shared.Chemistry.EntitySystems; using Robust.Shared.Prototypes; using Content.Shared.Sprite; using Robust.Server.GameObjects; -using Robust.Shared.Audio.Systems; namespace Content.Server.Anomaly.Effects; @@ -76,7 +75,7 @@ public sealed class ReagentProducerAnomalySystem : EntitySystem if (anomaly.Severity >= 0.97) reagentProducingAmount *= component.SupercriticalReagentProducingModifier; newSol.AddReagent(component.ProducingReagent, reagentProducingAmount); - _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled. + _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled. component.AccumulatedFrametime = 0; diff --git a/Content.Server/Antag/AntagSelectionSystem.cs b/Content.Server/Antag/AntagSelectionSystem.cs index b3b8a37508..737b723d39 100644 --- a/Content.Server/Antag/AntagSelectionSystem.cs +++ b/Content.Server/Antag/AntagSelectionSystem.cs @@ -21,7 +21,6 @@ using Content.Shared.Mobs.Components; using Content.Server.Station.Systems; using Content.Server.Shuttles.Systems; using Content.Shared.Mobs; -using Robust.Server.Audio; using Robust.Server.Containers; using Robust.Shared.Player; using Robust.Shared.Prototypes; diff --git a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs index eae9b94964..5e4d7d5ec6 100644 --- a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs +++ b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs @@ -3,7 +3,6 @@ using Content.Server.UserInterface; using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Arcade.SpaceVillain; diff --git a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs index ae4c15f2db..18dc32282b 100644 --- a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs +++ b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs @@ -1,7 +1,6 @@ using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Arcade.SpaceVillain; diff --git a/Content.Server/Atmos/Components/GasTankComponent.cs b/Content.Server/Atmos/Components/GasTankComponent.cs index 2d6b073e9d..a649e57b45 100644 --- a/Content.Server/Atmos/Components/GasTankComponent.cs +++ b/Content.Server/Atmos/Components/GasTankComponent.cs @@ -30,8 +30,8 @@ namespace Content.Server.Atmos.Components // Cancel toggles sounds if we re-toggle again. - public EntityUid? ConnectStream; - public EntityUid? DisconnectStream; + public IPlayingAudioStream? ConnectStream; + public IPlayingAudioStream? DisconnectStream; [DataField("air"), ViewVariables(VVAccess.ReadWrite)] public GasMixture Air { get; set; } = new(); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs index 989fed945f..020684aa3b 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs @@ -101,7 +101,8 @@ namespace Content.Server.Atmos.EntitySystems if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound)) { 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))); } } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs index 5b3d869229..1b44f6e819 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs @@ -85,7 +85,8 @@ namespace Content.Server.Atmos.EntitySystems // 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 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) diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs index 19855a71e5..d8364b652b 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Atmos.EntitySystems; using Content.Shared.Maps; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Physics.Systems; @@ -30,7 +28,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem [Dependency] private readonly SharedContainerSystem _containers = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly TileSystem _tile = default!; diff --git a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs index f2085bc673..17715435b2 100644 --- a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs @@ -13,7 +13,6 @@ using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Physics.Systems; using Robust.Shared.Player; @@ -240,8 +239,10 @@ namespace Content.Server.Atmos.EntitySystems if (!component.IsConnected) return; - component.ConnectStream = _audioSys.Stop(component.ConnectStream); - component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, component.Owner)?.Entity; + component.ConnectStream?.Stop(); + + if (component.ConnectSound != null) + component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, owner); UpdateUserInterface(ent); } @@ -258,8 +259,10 @@ namespace Content.Server.Atmos.EntitySystems _actions.SetToggled(component.ToggleActionEntity, false); _internals.DisconnectTank(internals); - component.DisconnectStream = _audioSys.Stop(component.DisconnectStream); - component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, component.Owner)?.Entity; + component.DisconnectStream?.Stop(); + + if (component.DisconnectSound != null) + component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, owner); UpdateUserInterface(ent); } @@ -319,7 +322,7 @@ namespace Content.Server.Atmos.EntitySystems if(environment != null) _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); return; diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs index 27e64a9956..b674f86442 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs @@ -7,7 +7,6 @@ using Content.Server.DeviceNetwork.Systems; using Content.Server.Power.Components; using Content.Shared.Atmos.Monitor; using Content.Shared.Tag; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Utility; diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs index 934ce8a7a4..914e732991 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs @@ -8,7 +8,6 @@ using Content.Shared.Examine; using Content.Shared.Interaction; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Atmos.Piping.Binary.EntitySystems @@ -18,7 +17,6 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems { [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly NodeContainerSystem _nodeContainer = default!; public override void Initialize() @@ -37,11 +35,10 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems return; if (Loc.TryGetString("gas-valve-system-examined", out var str, - ("statusColor", valve.Open ? "green" : "orange"), - ("open", valve.Open))) - { + ("statusColor", valve.Open ? "green" : "orange"), + ("open", valve.Open) + )) args.PushMarkup(str); - } } private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStartup args) @@ -53,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args) { Toggle(uid, component); - _audio.PlayPvs(component.ValveSound, uid, AudioParams.Default.WithVariation(0.25f)); + SoundSystem.Play(component.ValveSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f)); } public void Set(EntityUid uid, GasValveComponent component, bool value) diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs index 1ec1bdb1c1..14a1e5e456 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs @@ -16,8 +16,6 @@ using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Lock; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; diff --git a/Content.Server/Audio/ContentAudioSystem.cs b/Content.Server/Audio/ContentAudioSystem.cs index 1c5625b0b8..b1e7dcb187 100644 --- a/Content.Server/Audio/ContentAudioSystem.cs +++ b/Content.Server/Audio/ContentAudioSystem.cs @@ -1,41 +1,8 @@ -using Content.Server.GameTicking.Events; using Content.Shared.Audio; -using Robust.Server.Audio; -using Robust.Shared.Audio; -using Robust.Shared.Prototypes; namespace Content.Server.Audio; public sealed class ContentAudioSystem : SharedContentAudioSystem { - [Dependency] private readonly AudioSystem _serverAudio = default!; - [Dependency] private readonly IPrototypeManager _protoManager = default!; - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnRoundStart); - _protoManager.PrototypesReloaded += OnProtoReload; - } - - private void OnProtoReload(PrototypesReloadedEventArgs obj) - { - if (!obj.ByType.ContainsKey(typeof(AudioPresetPrototype))) - return; - - _serverAudio.ReloadPresets(); - } - - public override void Shutdown() - { - base.Shutdown(); - _protoManager.PrototypesReloaded -= OnProtoReload; - } - - private void OnRoundStart(RoundStartingEvent ev) - { - // On cleanup all entities get purged so need to ensure audio presets are still loaded - // yeah it's whacky af. - _serverAudio.ReloadPresets(); - } } diff --git a/Content.Server/Beam/BeamSystem.cs b/Content.Server/Beam/BeamSystem.cs index 33f2f252d9..a9f994ed56 100644 --- a/Content.Server/Beam/BeamSystem.cs +++ b/Content.Server/Beam/BeamSystem.cs @@ -3,8 +3,6 @@ using Content.Server.Beam.Components; using Content.Shared.Beam; using Content.Shared.Beam.Components; using Content.Shared.Physics; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index 4a6874bccc..17fe4d5eff 100644 --- a/Content.Server/Bed/Sleep/SleepingSystem.cs +++ b/Content.Server/Bed/Sleep/SleepingSystem.cs @@ -13,8 +13,6 @@ using Content.Shared.Slippery; using Content.Shared.StatusEffect; using Content.Shared.Stunnable; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Bible/BibleSystem.cs b/Content.Server/Bible/BibleSystem.cs index 5c153bb464..b3b41e2f32 100644 --- a/Content.Server/Bible/BibleSystem.cs +++ b/Content.Server/Bible/BibleSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Popups; using Content.Shared.Timing; using Content.Shared.Verbs; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; @@ -30,7 +29,6 @@ namespace Content.Server.Bible [Dependency] private readonly MobStateSystem _mobStateSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UseDelaySystem _delay = default!; public override void Initialize() @@ -82,8 +80,8 @@ namespace Content.Server.Bible summonableComp.Summon = null; } summonableComp.AlreadySummoned = false; - _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium); - _audio.PlayPvs("/Audio/Effects/radpulse9.ogg", summonableComp.Owner, AudioParams.Default.WithVolume(-4f)); + _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", uid)), uid, PopupType.Medium); + SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(-4f)); // Clean up the accumulator and respawn tracking component summonableComp.Accumulator = 0; _remQueue.Enqueue(uid); @@ -109,7 +107,7 @@ namespace Content.Server.Bible { _popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, args.User); - _audio.PlayPvs(component.SizzleSoundPath, args.User); + SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User); _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid); _delay.BeginDelay(uid, delay); @@ -127,7 +125,7 @@ namespace Content.Server.Bible var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); _popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution); - _audio.PlayPvs("/Audio/Effects/hit_kick.ogg", args.User); + SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User); _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid); _delay.BeginDelay(uid, delay); return; @@ -151,7 +149,7 @@ namespace Content.Server.Bible var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large); - _audio.PlayPvs(component.HealSoundPath, args.User); + SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User); _delay.BeginDelay(uid, delay); } } diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index b48438e8a4..39403288e9 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -20,7 +20,6 @@ using Robust.Server.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Content.Shared.Speech.EntitySystems; -using Robust.Server.Audio; namespace Content.Server.Body.Systems; diff --git a/Content.Server/Body/Systems/BodySystem.cs b/Content.Server/Body/Systems/BodySystem.cs index 763e53de00..242b02d78c 100644 --- a/Content.Server/Body/Systems/BodySystem.cs +++ b/Content.Server/Body/Systems/BodySystem.cs @@ -15,7 +15,6 @@ using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; using System.Numerics; -using Robust.Shared.Audio.Systems; namespace Content.Server.Body.Systems; @@ -130,7 +129,7 @@ public sealed class BodySystem : SharedBodySystem var filter = Filter.Pvs(bodyId, entityManager: EntityManager); var audio = AudioParams.Default.WithVariation(0.025f); - _audio.PlayStatic(body.GibSound, filter, coordinates, true, audio); + _audio.Play(body.GibSound, filter, coordinates, true, audio); foreach (var entity in gibs) { diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs index c9469efb06..9991edd230 100644 --- a/Content.Server/Botany/Systems/PlantHolderSystem.cs +++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs @@ -19,7 +19,6 @@ using Content.Shared.Random; using Content.Shared.Tag; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/CardboardBox/CardboardBoxSystem.cs b/Content.Server/CardboardBox/CardboardBoxSystem.cs index 83445d2ae4..df9743a21a 100644 --- a/Content.Server/CardboardBox/CardboardBoxSystem.cs +++ b/Content.Server/CardboardBox/CardboardBoxSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Stealth; using Content.Shared.Stealth.Components; using Content.Shared.Storage.Components; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Timing; diff --git a/Content.Server/Cargo/Systems/CargoSystem.cs b/Content.Server/Cargo/Systems/CargoSystem.cs index 51cfc9791c..32b63f7105 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.cs @@ -13,8 +13,6 @@ using Content.Shared.Containers.ItemSlots; using Content.Shared.Mobs.Components; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Prototypes; diff --git a/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs b/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs index f01be1fc71..b115e658bb 100644 --- a/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs +++ b/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader.Cartridges; using Content.Shared.Popups; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 8c4cfc76c0..3315f61c2f 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -22,7 +22,6 @@ using Content.Shared.Radio; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Network; @@ -308,7 +307,7 @@ public sealed partial class ChatSystem : SharedChatSystem _chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride); if (playSound) { - _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), true, AudioParams.Default.WithVolume(-2f)); + SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f)); } _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}"); } @@ -346,7 +345,7 @@ public sealed partial class ChatSystem : SharedChatSystem if (playDefaultSound) { - _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, true, AudioParams.Default.WithVolume(-2f)); + SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f)); } _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}"); diff --git a/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs b/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs index 07ac01fab6..a831165e68 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs @@ -14,7 +14,6 @@ using Content.Shared.Database; using Content.Shared.FixedPoint; using Content.Shared.Storage; using JetBrains.Annotations; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs index 759d403ace..fc4ea0a0b2 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Chemistry; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.DoAfter; using Content.Shared.Mobs.Systems; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Chemistry.EntitySystems; diff --git a/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs b/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs index 3768ee1051..daa2ac80b7 100644 --- a/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs @@ -10,7 +10,6 @@ using Content.Shared.Database; using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; using JetBrains.Annotations; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; diff --git a/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs index fc807069f7..291a654422 100644 --- a/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs @@ -8,7 +8,6 @@ using Content.Shared.FixedPoint; using Content.Shared.Maps; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -73,8 +72,7 @@ namespace Content.Server.Chemistry.ReactionEffects var smoke = args.EntityManager.System(); smoke.StartSmoke(ent, splitSolution, _duration, spreadAmount); - var audio = args.EntityManager.System(); - audio.PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f)); + args.EntityManager.System().PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f)); } } } diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index 8bfd6250ef..6d34e0e6f7 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -29,8 +29,6 @@ using Content.Shared.Roles.Jobs; using Robust.Server.Containers; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Containers; using Robust.Shared.Physics.Components; diff --git a/Content.Server/Cluwne/CluwneSystem.cs b/Content.Server/Cluwne/CluwneSystem.cs index c170886a80..9ce50137bf 100644 --- a/Content.Server/Cluwne/CluwneSystem.cs +++ b/Content.Server/Cluwne/CluwneSystem.cs @@ -14,8 +14,6 @@ using Content.Server.Emoting.Systems; using Content.Server.Speech.EntitySystems; using Content.Shared.Cluwne; using Content.Shared.Interaction.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Cluwne; diff --git a/Content.Server/Construction/Completions/PlaySound.cs b/Content.Server/Construction/Completions/PlaySound.cs index 50b705ddfe..9fa3c43ae4 100644 --- a/Content.Server/Construction/Completions/PlaySound.cs +++ b/Content.Server/Construction/Completions/PlaySound.cs @@ -1,7 +1,6 @@ using Content.Shared.Construction; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Construction.Completions diff --git a/Content.Server/Construction/Components/PartExchangerComponent.cs b/Content.Server/Construction/Components/PartExchangerComponent.cs index a2579c92e8..6cf32a5e46 100644 --- a/Content.Server/Construction/Components/PartExchangerComponent.cs +++ b/Content.Server/Construction/Components/PartExchangerComponent.cs @@ -25,5 +25,5 @@ public sealed partial class PartExchangerComponent : Component [DataField("exchangeSound")] public SoundSpecifier ExchangeSound = new SoundPathSpecifier("/Audio/Items/rped.ogg"); - public EntityUid? AudioStream; + public IPlayingAudioStream? AudioStream; } diff --git a/Content.Server/Construction/PartExchangerSystem.cs b/Content.Server/Construction/PartExchangerSystem.cs index 75629146a4..4b543a0247 100644 --- a/Content.Server/Construction/PartExchangerSystem.cs +++ b/Content.Server/Construction/PartExchangerSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Storage; using Robust.Shared.Containers; using Robust.Shared.Utility; using Content.Shared.Wires; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Collections; namespace Content.Server.Construction; @@ -36,7 +34,7 @@ public sealed class PartExchangerSystem : EntitySystem { if (args.Cancelled) { - component.AudioStream = _audio.Stop(component.AudioStream); + component.AudioStream?.Stop(); return; } @@ -170,7 +168,7 @@ public sealed class PartExchangerSystem : EntitySystem return; } - component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid).Value.Entity; + component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid); _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid) { diff --git a/Content.Server/Crayon/CrayonSystem.cs b/Content.Server/Crayon/CrayonSystem.cs index 32bb96e9e2..16385d4d7e 100644 --- a/Content.Server/Crayon/CrayonSystem.cs +++ b/Content.Server/Crayon/CrayonSystem.cs @@ -11,7 +11,6 @@ using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; using Robust.Shared.Player; using Robust.Shared.Prototypes; diff --git a/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs b/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs index 95819dd1fc..bcd1e0423a 100644 --- a/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs +++ b/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Stunnable; using Content.Shared.Damage; using Content.Shared.Effects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Physics.Events; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Server/Defusable/Systems/DefusableSystem.cs b/Content.Server/Defusable/Systems/DefusableSystem.cs index e9b074268f..ca5c6f5a09 100644 --- a/Content.Server/Defusable/Systems/DefusableSystem.cs +++ b/Content.Server/Defusable/Systems/DefusableSystem.cs @@ -12,8 +12,6 @@ using Content.Shared.Popups; using Content.Shared.Verbs; using Content.Shared.Wires; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Defusable.Systems; diff --git a/Content.Server/Destructible/DestructibleSystem.cs b/Content.Server/Destructible/DestructibleSystem.cs index 7e43e72007..74e88292df 100644 --- a/Content.Server/Destructible/DestructibleSystem.cs +++ b/Content.Server/Destructible/DestructibleSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Database; using Content.Shared.Destructible; using Content.Shared.FixedPoint; using JetBrains.Annotations; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Containers; using Robust.Shared.Prototypes; diff --git a/Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs index 26ba01c359..74a4cdfb1b 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs @@ -1,6 +1,5 @@ using Content.Shared.Audio; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Destructible.Thresholds.Behaviors diff --git a/Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs b/Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs index 8ca6fd75c2..8f4bade83a 100644 --- a/Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs +++ b/Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs @@ -1,7 +1,6 @@ using Content.Server.DeviceLinking.Components; using Content.Server.DeviceLinking.Components.Overload; using Content.Server.DeviceLinking.Events; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; diff --git a/Content.Server/DeviceLinking/Systems/LogicGateSystem.cs b/Content.Server/DeviceLinking/Systems/LogicGateSystem.cs index 60d13b78fc..5641b0b4ae 100644 --- a/Content.Server/DeviceLinking/Systems/LogicGateSystem.cs +++ b/Content.Server/DeviceLinking/Systems/LogicGateSystem.cs @@ -5,9 +5,7 @@ using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Tools; using Content.Shared.Popups; -using Content.Shared.Tools.Systems; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; +using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem; using SignalReceivedEvent = Content.Server.DeviceLinking.Events.SignalReceivedEvent; namespace Content.Server.DeviceLinking.Systems; diff --git a/Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs b/Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs index f6469d68b9..7bcc438b92 100644 --- a/Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs +++ b/Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs @@ -2,7 +2,6 @@ using Content.Server.DeviceLinking.Components; using Content.Server.DeviceNetwork; using Content.Shared.Interaction; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.DeviceLinking.Systems; diff --git a/Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs b/Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs index 63bf5854d9..3a7fd6bec9 100644 --- a/Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs +++ b/Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs @@ -4,8 +4,6 @@ using Content.Shared.Access.Systems; using Content.Shared.MachineLinking; using Content.Shared.TextScreen; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Server.DeviceLinking.Systems; diff --git a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs index 4deb08ec3d..a977a44287 100644 --- a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Verbs; using JetBrains.Annotations; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Player; diff --git a/Content.Server/Dice/DiceSystem.cs b/Content.Server/Dice/DiceSystem.cs index 2d13679bd0..beb2a28489 100644 --- a/Content.Server/Dice/DiceSystem.cs +++ b/Content.Server/Dice/DiceSystem.cs @@ -1,8 +1,6 @@ using Content.Shared.Dice; using Content.Shared.Popups; using JetBrains.Annotations; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Dice; diff --git a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs index fab16bc315..477a167fa2 100644 --- a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs +++ b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs @@ -13,7 +13,6 @@ using Content.Shared.Hands.Components; using Content.Shared.Movement.Events; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Physics; diff --git a/Content.Server/Dragon/DragonRiftSystem.cs b/Content.Server/Dragon/DragonRiftSystem.cs index f7d5cd783d..52137f2ee6 100644 --- a/Content.Server/Dragon/DragonRiftSystem.cs +++ b/Content.Server/Dragon/DragonRiftSystem.cs @@ -11,8 +11,6 @@ using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Serialization.Manager; using System.Numerics; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Dragon; diff --git a/Content.Server/Dragon/DragonSystem.cs b/Content.Server/Dragon/DragonSystem.cs index 93d6bc8db0..ed17ba8bdc 100644 --- a/Content.Server/Dragon/DragonSystem.cs +++ b/Content.Server/Dragon/DragonSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Mobs; using Content.Shared.Movement.Systems; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Player; @@ -205,7 +203,7 @@ public sealed partial class DragonSystem : EntitySystem private void Roar(EntityUid uid, DragonComponent comp) { if (comp.SoundRoar != null) - _audio.PlayPvs(comp.SoundRoar, uid); + _audio.Play(comp.SoundRoar, Filter.Pvs(uid, 4f, EntityManager), uid, true); } /// diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 4dc4f198a5..8ddc8540c0 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -26,7 +26,6 @@ using Content.Shared.Stunnable; using Content.Shared.Tag; using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics.Events; using Robust.Shared.Player; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs index ef8e1ffd98..08374d7392 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs @@ -50,11 +50,11 @@ public sealed partial class ExplosionSystem : EntitySystem comp.Intensity = iterationIntensity; comp.SpaceMatrix = spaceMatrix; comp.SpaceTileSize = spaceData?.TileSize ?? DefaultTileSize; - Dirty(explosionEntity, comp); + Dirty(comp); // Light, sound & visuals may extend well beyond normal PVS range. In principle, this should probably still be // restricted to something like the same map, but whatever. - _pvsSys.AddGlobalOverride(GetNetEntity(explosionEntity)); + _pvsSys.AddGlobalOverride(explosionEntity); var appearance = AddComp(explosionEntity); _appearance.SetData(explosionEntity, ExplosionAppearanceData.Progress, 1, appearance); diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs index 81324d0079..aa1ad71b16 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs @@ -20,7 +20,6 @@ using Content.Shared.Throwing; using Robust.Server.GameStates; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Physics.Components; @@ -49,7 +48,6 @@ public sealed partial class ExplosionSystem : EntitySystem [Dependency] private readonly IChatManager _chat = default!; [Dependency] private readonly ThrowingSystem _throwingSystem = default!; [Dependency] private readonly PvsOverrideSystem _pvsSys = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; private EntityQuery _transformQuery; @@ -336,7 +334,7 @@ public sealed partial class ExplosionSystem : EntitySystem // play sound. var audioRange = iterationIntensity.Count * 5; var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange); - _audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams); + SoundSystem.Play(type.Sound.GetSound(), filter, mapEntityCoords, _audioParams); return new Explosion(this, type, diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index 854fa7f661..b57e9bd298 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -24,7 +24,6 @@ using Robust.Shared.Physics.Systems; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Content.Shared.Weapons.Ranged.Events; -using Robust.Shared.Audio.Systems; namespace Content.Server.Explosion.EntitySystems { diff --git a/Content.Server/Extinguisher/FireExtinguisherSystem.cs b/Content.Server/Extinguisher/FireExtinguisherSystem.cs index 30895deb4c..7b96b8b921 100644 --- a/Content.Server/Extinguisher/FireExtinguisherSystem.cs +++ b/Content.Server/Extinguisher/FireExtinguisherSystem.cs @@ -9,7 +9,6 @@ using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Verbs; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Extinguisher; @@ -19,7 +18,6 @@ public sealed class FireExtinguisherSystem : EntitySystem [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -88,7 +86,7 @@ public sealed class FireExtinguisherSystem : EntitySystem var drained = _solutionContainerSystem.Drain(target, targetSolution, transfer); _solutionContainerSystem.TryAddSolution(uid, container, drained); - _audio.PlayPvs(component.RefillSound, uid); + SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid); _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", uid)), uid, args.Target.Value); } @@ -137,7 +135,8 @@ public sealed class FireExtinguisherSystem : EntitySystem return; extinguisher.Safety = !extinguisher.Safety; - _audio.PlayPvs(extinguisher.SafetySound, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-4f)); + SoundSystem.Play(extinguisher.SafetySound.GetSound(), Filter.Pvs(uid), + uid, AudioHelpers.WithVariation(0.125f).WithVolume(-4f)); UpdateAppearance(uid, extinguisher); } } diff --git a/Content.Server/Fax/FaxSystem.cs b/Content.Server/Fax/FaxSystem.cs index 647f73bad3..ec95d71dcf 100644 --- a/Content.Server/Fax/FaxSystem.cs +++ b/Content.Server/Fax/FaxSystem.cs @@ -19,7 +19,6 @@ using Content.Shared.Interaction; using Content.Shared.Paper; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 29d603bfc6..bc2c4ddaba 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Physics; using Content.Shared.Tag; using Content.Shared.Traits.Assorted; using Content.Shared.Weapons.Melee.Events; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Player; @@ -173,7 +172,7 @@ namespace Content.Server.Flash } if (sound != null) { - _audio.PlayPvs(sound, source); + SoundSystem.Play(sound.GetSound(), Filter.Pvs(transform), source); } } diff --git a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs index e5ddff6c07..facc39f146 100644 --- a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs +++ b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs @@ -8,7 +8,6 @@ using Content.Shared.Fluids.Components; using Content.Shared.Interaction; using Content.Shared.Timing; using Content.Shared.Weapons.Melee; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Utility; diff --git a/Content.Server/Fluids/EntitySystems/DrainSystem.cs b/Content.Server/Fluids/EntitySystems/DrainSystem.cs index 505ce71261..ea3df2f8c4 100644 --- a/Content.Server/Fluids/EntitySystems/DrainSystem.cs +++ b/Content.Server/Fluids/EntitySystems/DrainSystem.cs @@ -13,9 +13,6 @@ using Content.Shared.Fluids.Components; using Content.Shared.Interaction; using Content.Shared.Tag; using Content.Shared.Verbs; -using Content.Shared.Fluids.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Collections; using Robust.Shared.Random; using Robust.Shared.Utility; diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index 4c28e3d700..886cb9eff1 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -30,11 +30,6 @@ using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; -using Content.Shared.Movement.Components; -using Content.Shared.Movement.Systems; -using Content.Shared.Maps; -using Content.Shared.Effects; -using Robust.Server.Audio; namespace Content.Server.Fluids.EntitySystems; @@ -451,7 +446,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem return true; } - _audio.PlayPvs(puddleComponent.SpillSound, puddleUid); + SoundSystem.Play(puddleComponent.SpillSound.GetSound(), + Filter.Pvs(puddleUid), puddleUid); return true; } diff --git a/Content.Server/Fluids/EntitySystems/SpraySystem.cs b/Content.Server/Fluids/EntitySystems/SpraySystem.cs index 1b87b3ef24..f0afd43dd2 100644 --- a/Content.Server/Fluids/EntitySystems/SpraySystem.cs +++ b/Content.Server/Fluids/EntitySystems/SpraySystem.cs @@ -12,8 +12,6 @@ using Content.Shared.FixedPoint; using Content.Shared.Interaction; using Content.Shared.Vapor; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Physics.Components; using Robust.Shared.Prototypes; using Robust.Shared.Timing; diff --git a/Content.Server/Forensics/Systems/ForensicScannerSystem.cs b/Content.Server/Forensics/Systems/ForensicScannerSystem.cs index a073574e1d..acf7cbd80d 100644 --- a/Content.Server/Forensics/Systems/ForensicScannerSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicScannerSystem.cs @@ -8,7 +8,6 @@ using Content.Shared.Forensics; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Verbs; -using Robust.Shared.Audio.Systems; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Player; diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index ad82733341..dfd2e98499 100644 --- a/Content.Server/GameTicking/GameTicker.Player.cs +++ b/Content.Server/GameTicking/GameTicker.Player.cs @@ -34,7 +34,7 @@ namespace Content.Server.GameTicking if (args.NewStatus != SessionStatus.Disconnected) { mind.Session = session; - _pvsOverride.AddSessionOverride(GetNetEntity(mindId.Value), session); + _pvsOverride.AddSessionOverride(mindId.Value, session); } DebugTools.Assert(mind.Session == session); @@ -122,7 +122,7 @@ namespace Content.Server.GameTicking _chatManager.SendAdminAnnouncement(Loc.GetString("player-leave-message", ("name", args.Session.Name))); if (mind != null) { - _pvsOverride.ClearOverride(GetNetEntity(mindId!.Value)); + _pvsOverride.ClearOverride(mindId!.Value); mind.Session = null; } diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 6b714c7d21..85f833bd1c 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -360,7 +360,7 @@ namespace Content.Server.GameTicking playerIcName = icName; if (TryGetEntity(mind.OriginalOwnedEntity, out var entity)) - _pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true); + _pvsOverride.AddGlobalOverride(entity.Value, recursive: true); var roles = _roles.MindGetAllRoles(mindId); @@ -609,7 +609,7 @@ namespace Content.Server.GameTicking _chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true); if (proto.Sound != null) - _audio.PlayGlobal(proto.Sound, Filter.Broadcast(), true); + SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast()); } private async void SendRoundStartedDiscordMessage() diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 8da271e1a8..14819fb0ac 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -19,8 +19,6 @@ using Content.Shared.Roles; using Robust.Server; using Robust.Server.GameObjects; using Robust.Server.GameStates; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Map; @@ -63,7 +61,6 @@ namespace Content.Server.GameTicking [Dependency] private readonly PlayTimeTrackingSystem _playTimeTrackings = default!; [Dependency] private readonly PvsOverrideSystem _pvsOverride = default!; [Dependency] private readonly ServerUpdateManager _serverUpdates = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StationJobsSystem _stationJobs = default!; [Dependency] private readonly StationSpawningSystem _stationSpawning = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index bb8582c34b..779c47885f 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -44,7 +44,6 @@ using Robust.Server.GameObjects; using Robust.Server.Maps; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Prototypes; diff --git a/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs b/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs index c5b5854475..0785d81d09 100644 --- a/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs @@ -15,9 +15,6 @@ using Content.Shared.Preferences; using Content.Shared.Roles; using Robust.Server.GameObjects; using Robust.Server.Maps; -using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Map; diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index 145b4192b5..ef949d09fc 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -17,9 +17,6 @@ using Content.Shared.PDA; using Content.Shared.Preferences; using Content.Shared.Roles; using Content.Shared.Roles.Jobs; -using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Prototypes; diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index f4319815a7..a4febc385c 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -22,8 +22,6 @@ using Content.Shared.Roles; using Content.Shared.Zombies; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Server/Gateway/Systems/GatewaySystem.cs b/Content.Server/Gateway/Systems/GatewaySystem.cs index f498d70975..ae00cd378c 100644 --- a/Content.Server/Gateway/Systems/GatewaySystem.cs +++ b/Content.Server/Gateway/Systems/GatewaySystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Teleportation.Systems; using Content.Shared.Verbs; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameObjects; using Robust.Shared.Timing; diff --git a/Content.Server/Gatherable/GatherableSystem.cs b/Content.Server/Gatherable/GatherableSystem.cs index 7fbbf7f4f6..4f7d19b0a8 100644 --- a/Content.Server/Gatherable/GatherableSystem.cs +++ b/Content.Server/Gatherable/GatherableSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.Interaction; using Content.Shared.Tag; using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Glue/GlueSystem.cs b/Content.Server/Glue/GlueSystem.cs index 58eed00c49..eaf95a1f1d 100644 --- a/Content.Server/Glue/GlueSystem.cs +++ b/Content.Server/Glue/GlueSystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Database; using Content.Shared.Hands; using Robust.Shared.Timing; using Content.Shared.Interaction.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Glue; diff --git a/Content.Server/Guardian/GuardianSystem.cs b/Content.Server/Guardian/GuardianSystem.cs index 25009ed7dd..b6121a7fbd 100644 --- a/Content.Server/Guardian/GuardianSystem.cs +++ b/Content.Server/Guardian/GuardianSystem.cs @@ -13,8 +13,6 @@ using Content.Shared.Interaction.Events; using Content.Shared.Mobs; using Content.Shared.Popups; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Utility; @@ -196,14 +194,14 @@ namespace Content.Server.Guardian if (TryComp(guardian, out var guardianComp)) { guardianComp.Host = args.Args.Target.Value; - _audio.PlayPvs("/Audio/Effects/guardian_inject.ogg", args.Args.Target.Value); + _audio.Play("/Audio/Effects/guardian_inject.ogg", Filter.Pvs(args.Args.Target.Value), args.Args.Target.Value, true); _popupSystem.PopupEntity(Loc.GetString("guardian-created"), args.Args.Target.Value, args.Args.Target.Value); // Exhaust the activator component.Used = true; } else { - Log.Error($"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}"); + Logger.ErrorS("guardian", $"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}"); EntityManager.QueueDeleteEntity(guardian); } @@ -221,12 +219,12 @@ namespace Content.Server.Guardian if (args.NewMobState == MobState.Critical) { _popupSystem.PopupEntity(Loc.GetString("guardian-host-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value); - _audio.PlayPvs("/Audio/Effects/guardian_warn.ogg", component.HostedGuardian.Value); + _audio.Play("/Audio/Effects/guardian_warn.ogg", Filter.Pvs(component.HostedGuardian.Value), component.HostedGuardian.Value, true); } else if (args.NewMobState == MobState.Dead) { //TODO: Replace WithVariation with datafield - _audio.PlayPvs("/Audio/Voice/Human/malescream_guardian.ogg", uid, AudioParams.Default.WithVariation(0.20f)); + _audio.Play("/Audio/Voice/Human/malescream_guardian.ogg", Filter.Pvs(uid), uid, true, AudioHelpers.WithVariation(0.20f)); EntityManager.RemoveComponent(uid); } } diff --git a/Content.Server/Holiday/Christmas/RandomGiftSystem.cs b/Content.Server/Holiday/Christmas/RandomGiftSystem.cs index 40b365105d..4581d378f6 100644 --- a/Content.Server/Holiday/Christmas/RandomGiftSystem.cs +++ b/Content.Server/Holiday/Christmas/RandomGiftSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Database; using Content.Shared.Examine; using Content.Shared.Interaction.Events; using Content.Shared.Item; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; diff --git a/Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs b/Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs index d80d7ecbfc..256a857864 100644 --- a/Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs +++ b/Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs @@ -1,7 +1,6 @@ using Content.Server.Explosion.EntitySystems; using Content.Shared.Timing; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Server.IgnitionSource; diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index 0fa8f7d292..d688941abf 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -3,8 +3,6 @@ using Content.Server.Popups; using Content.Shared.Body.Components; using Content.Shared.Examine; using Content.Shared.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; diff --git a/Content.Server/Interaction/InteractionPopupSystem.cs b/Content.Server/Interaction/InteractionPopupSystem.cs index 474284cf80..86158fb7a8 100644 --- a/Content.Server/Interaction/InteractionPopupSystem.cs +++ b/Content.Server/Interaction/InteractionPopupSystem.cs @@ -6,7 +6,6 @@ using Content.Shared.Interaction; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -19,7 +18,6 @@ public sealed class InteractionPopupSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly MobStateSystem _mobStateSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -43,17 +41,15 @@ public sealed class InteractionPopupSystem : EntitySystem if (curTime < component.LastInteractTime + component.InteractDelay) return; - if (TryComp(uid, out var state) - && !_mobStateSystem.IsAlive(uid, state)) - { + if (TryComp(uid, out var state) // if it has a MobStateComponent, + && !_mobStateSystem.IsAlive(uid, state)) // AND if that state is not Alive (e.g. dead/incapacitated/critical) return; - } // TODO: Should be an attempt event // TODO: Need to handle pausing with an accumulator. string msg = ""; // Stores the text to be shown in the popup message - SoundSpecifier? sfx = null; // Stores the filepath of the sound to be played + string? sfx = null; // Stores the filepath of the sound to be played if (_random.Prob(component.SuccessChance)) { @@ -61,7 +57,7 @@ public sealed class InteractionPopupSystem : EntitySystem msg = Loc.GetString(component.InteractSuccessString, ("target", Identity.Entity(uid, EntityManager))); // Success message (localized). if (component.InteractSuccessSound != null) - sfx = component.InteractSuccessSound; + sfx = component.InteractSuccessSound.GetSound(); if (component.InteractSuccessSpawn != null) Spawn(component.InteractSuccessSpawn, Transform(uid).MapPosition); @@ -72,7 +68,7 @@ public sealed class InteractionPopupSystem : EntitySystem msg = Loc.GetString(component.InteractFailureString, ("target", Identity.Entity(uid, EntityManager))); // Failure message (localized). if (component.InteractFailureSound != null) - sfx = component.InteractFailureSound; + sfx = component.InteractFailureSound.GetSound(); if (component.InteractFailureSpawn != null) Spawn(component.InteractFailureSpawn, Transform(uid).MapPosition); @@ -80,7 +76,7 @@ public sealed class InteractionPopupSystem : EntitySystem if (component.MessagePerceivedByOthers != null) { - var msgOthers = Loc.GetString(component.MessagePerceivedByOthers, + string msgOthers = Loc.GetString(component.MessagePerceivedByOthers, ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager))); _popupSystem.PopupEntity(msg, uid, args.User); _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true); @@ -91,9 +87,9 @@ public sealed class InteractionPopupSystem : EntitySystem if (sfx is not null) //not all cases will have sound. { if (component.SoundPerceivedByOthers) - _audio.PlayPvs(sfx, args.Target); //play for everyone in range + SoundSystem.Play(sfx, Filter.Pvs(args.Target), args.Target); //play for everyone in range else - _audio.PlayEntity(sfx, Filter.Entities(args.User, args.Target), args.Target, true); //play only for the initiating entity and its target. + SoundSystem.Play(sfx, Filter.Entities(args.User, args.Target), args.Target); //play only for the initiating entity and its target. } component.LastInteractTime = curTime; diff --git a/Content.Server/Item/ItemToggleSystem.cs b/Content.Server/Item/ItemToggleSystem.cs index fb72148b88..5610582007 100644 --- a/Content.Server/Item/ItemToggleSystem.cs +++ b/Content.Server/Item/ItemToggleSystem.cs @@ -4,8 +4,6 @@ using Content.Shared.Interaction.Events; using Content.Shared.Item; using Content.Shared.Toggleable; using Content.Shared.Tools.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Weapons.Melee.ItemToggle; @@ -55,7 +53,7 @@ public sealed class ItemToggleSystem : EntitySystem if (TryComp(uid, out var malus)) malus.Malus -= comp.ActivatedDisarmMalus; - _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params); + _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params); comp.Activated = false; } @@ -68,7 +66,7 @@ public sealed class ItemToggleSystem : EntitySystem if (TryComp(uid, out var malus)) malus.Malus += comp.ActivatedDisarmMalus; - _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params); + _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params); comp.Activated = true; } diff --git a/Content.Server/Kitchen/Components/MicrowaveComponent.cs b/Content.Server/Kitchen/Components/MicrowaveComponent.cs index a92da9d2cb..538a069d16 100644 --- a/Content.Server/Kitchen/Components/MicrowaveComponent.cs +++ b/Content.Server/Kitchen/Components/MicrowaveComponent.cs @@ -29,8 +29,7 @@ namespace Content.Server.Kitchen.Components [DataField("ItemBreakSound")] public SoundSpecifier ItemBreakSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); - public EntityUid? PlayingStream; - + public IPlayingAudioStream? PlayingStream { get; set; } [DataField("loopingSound")] public SoundSpecifier LoopingSound = new SoundPathSpecifier("/Audio/Machines/microwave_loop.ogg"); #endregion diff --git a/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs b/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs index 2a028a8580..4b53049086 100644 --- a/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs +++ b/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs @@ -48,7 +48,7 @@ namespace Content.Server.Kitchen.Components [DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)] public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg"); - public EntityUid? AudioStream; + public IPlayingAudioStream? AudioStream; } [Access(typeof(ReagentGrinderSystem)), RegisterComponent] diff --git a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs index 0419e13d23..6e563ff45f 100644 --- a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs @@ -16,8 +16,6 @@ using Content.Shared.Nutrition.Components; using Content.Shared.Popups; using Content.Shared.Storage; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using static Content.Shared.Kitchen.Components.KitchenSpikeComponent; @@ -156,7 +154,7 @@ namespace Content.Server.Kitchen.EntitySystems QueueDel(gib); } - _audio.PlayEntity(component.SpikeSound, Filter.Pvs(uid), uid, true); + _audio.Play(component.SpikeSound, Filter.Pvs(uid), uid, true); } private bool TryGetPiece(EntityUid uid, EntityUid user, EntityUid used, diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index e46cc76a0e..1c8dbfb4df 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -24,7 +24,6 @@ using Content.Shared.Tag; using Robust.Server.Containers; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; @@ -74,7 +73,7 @@ namespace Content.Server.Kitchen.EntitySystems SetAppearance(uid, MicrowaveVisualState.Cooking, microwaveComponent); microwaveComponent.PlayingStream = - _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)).Value.Entity; + _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)); } private void OnCookStop(EntityUid uid, ActiveMicrowaveComponent component, ComponentShutdown args) @@ -83,7 +82,7 @@ namespace Content.Server.Kitchen.EntitySystems return; SetAppearance(uid, MicrowaveVisualState.Idle, microwaveComponent); - microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream); + microwaveComponent.PlayingStream?.Stop(); } /// diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index 3a6d5e4134..6ce53dc530 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -16,7 +16,6 @@ using Content.Shared.Stacks; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Timing; @@ -65,7 +64,7 @@ namespace Content.Server.Kitchen.EntitySystems if (active.EndTime > _timing.CurTime) continue; - reagentGrinder.AudioStream = _audioSystem.Stop(reagentGrinder.AudioStream); + reagentGrinder.AudioStream?.Stop(); RemCompDeferred(uid); var inputContainer = _containerSystem.EnsureContainer(uid, SharedReagentGrinder.InputContainerId); @@ -285,7 +284,7 @@ namespace Content.Server.Kitchen.EntitySystems active.Program = program; reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid, - AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)).Value.Entity; //slightly higher pitched + AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)); //slightly higher pitched _userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key, new ReagentGrinderWorkStartedMessage(program)); } diff --git a/Content.Server/Lathe/LatheSystem.cs b/Content.Server/Lathe/LatheSystem.cs index c6614fcd4f..309ee58316 100644 --- a/Content.Server/Lathe/LatheSystem.cs +++ b/Content.Server/Lathe/LatheSystem.cs @@ -16,8 +16,6 @@ using Content.Shared.Research.Components; using Content.Shared.Research.Prototypes; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Timing; diff --git a/Content.Server/Light/EntitySystems/ExpendableLightSystem.cs b/Content.Server/Light/EntitySystems/ExpendableLightSystem.cs index 40d212c6ad..f4db4216cf 100644 --- a/Content.Server/Light/EntitySystems/ExpendableLightSystem.cs +++ b/Content.Server/Light/EntitySystems/ExpendableLightSystem.cs @@ -9,9 +9,6 @@ using Content.Shared.Temperature; using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; using Robust.Shared.Utility; namespace Content.Server.Light.EntitySystems diff --git a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs index 70ce3c7488..f3e7eaca0e 100644 --- a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs +++ b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs @@ -9,10 +9,6 @@ using Content.Shared.Light.Components; using Content.Shared.Rounding; using Content.Shared.Toggleable; using Content.Shared.Verbs; -using JetBrains.Annotations; -using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Utility; diff --git a/Content.Server/Light/EntitySystems/LightBulbSystem.cs b/Content.Server/Light/EntitySystems/LightBulbSystem.cs index 5714bde3e5..43b0b4662c 100644 --- a/Content.Server/Light/EntitySystems/LightBulbSystem.cs +++ b/Content.Server/Light/EntitySystems/LightBulbSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Light.Components; using Content.Shared.Throwing; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Light.EntitySystems @@ -12,7 +11,6 @@ namespace Content.Server.Light.EntitySystems public sealed class LightBulbSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -70,7 +68,7 @@ namespace Content.Server.Light.EntitySystems if (!Resolve(uid, ref bulb)) return; - _audio.PlayPvs(bulb.BreakSound, uid); + SoundSystem.Play(bulb.BreakSound.GetSound(), Filter.Pvs(uid), uid); } private void UpdateAppearance(EntityUid uid, LightBulbComponent? bulb = null, diff --git a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs index 8347f14ea4..d37080a1e1 100644 --- a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs +++ b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs @@ -6,8 +6,6 @@ using Content.Shared.Light.Components; using Content.Shared.Popups; using Content.Shared.Storage; using JetBrains.Annotations; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; namespace Content.Server.Light.EntitySystems; diff --git a/Content.Server/Light/EntitySystems/MatchstickSystem.cs b/Content.Server/Light/EntitySystems/MatchstickSystem.cs index 2195c69b18..88f416ce9d 100644 --- a/Content.Server/Light/EntitySystems/MatchstickSystem.cs +++ b/Content.Server/Light/EntitySystems/MatchstickSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Smoking; using Content.Shared.Temperature; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Light.EntitySystems @@ -16,7 +15,6 @@ namespace Content.Server.Light.EntitySystems { [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedItemSystem _item = default!; [Dependency] private readonly SharedPointLightSystem _lights = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; @@ -81,7 +79,8 @@ namespace Content.Server.Light.EntitySystems var component = matchstick.Comp; // Play Sound - _audio.PlayPvs(component.IgniteSound, matchstick, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f)); + SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(matchstick), + matchstick, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f)); // Change state SetState(matchstick, component, SmokableState.Lit); diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index d157866c76..cd4322aa26 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -23,12 +23,6 @@ using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Timing; -using Content.Shared.DoAfter; -using Content.Server.Emp; -using Content.Server.DeviceLinking.Events; -using Content.Server.DeviceLinking.Systems; -using Content.Shared.Inventory; -using Robust.Shared.Audio.Systems; namespace Content.Server.Light.EntitySystems { @@ -136,7 +130,7 @@ namespace Content.Server.Light.EntitySystems if (damage != null) _adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage"); - _audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true); + _audio.Play(light.BurnHandSound, Filter.Pvs(uid), uid, true); args.Handled = true; return; @@ -287,7 +281,7 @@ namespace Content.Server.Light.EntitySystems if (time > light.LastThunk + ThunkDelay) { light.LastThunk = time; - _audio.PlayEntity(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f)); + _audio.Play(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f)); } } else diff --git a/Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs b/Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs index a1ed71ee4c..c24966aba8 100644 --- a/Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs +++ b/Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Light.Components; using Content.Shared.Mind.Components; using Content.Shared.Toggleable; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Utility; diff --git a/Content.Server/Lube/LubeSystem.cs b/Content.Server/Lube/LubeSystem.cs index 86921d222c..10a30dc25c 100644 --- a/Content.Server/Lube/LubeSystem.cs +++ b/Content.Server/Lube/LubeSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Lube; using Content.Shared.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Lube; diff --git a/Content.Server/Magic/MagicSystem.cs b/Content.Server/Magic/MagicSystem.cs index 42bae2ba6f..4fbd9e3ec7 100644 --- a/Content.Server/Magic/MagicSystem.cs +++ b/Content.Server/Magic/MagicSystem.cs @@ -19,7 +19,6 @@ using Content.Shared.Physics; using Content.Shared.Storage; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Random; using Robust.Shared.Serialization.Manager; diff --git a/Content.Server/MassMedia/Systems/NewsSystem.cs b/Content.Server/MassMedia/Systems/NewsSystem.cs index 07c1e11cef..5c539720a3 100644 --- a/Content.Server/MassMedia/Systems/NewsSystem.cs +++ b/Content.Server/MassMedia/Systems/NewsSystem.cs @@ -17,19 +17,6 @@ using Content.Shared.MassMedia.Components; using Content.Shared.MassMedia.Systems; using Content.Shared.PDA; using Robust.Server.GameObjects; -using System.Linq; -using Content.Server.Administration.Logs; -using Content.Server.CartridgeLoader.Cartridges; -using Content.Shared.CartridgeLoader; -using Content.Shared.CartridgeLoader.Cartridges; -using Content.Server.CartridgeLoader; -using Content.Server.GameTicking; -using Robust.Shared.Timing; -using Content.Server.Popups; -using Content.Server.StationRecords.Systems; -using Content.Shared.Database; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Timing; diff --git a/Content.Server/Materials/MaterialStorageSystem.cs b/Content.Server/Materials/MaterialStorageSystem.cs index 99b2116e25..b3626774c8 100644 --- a/Content.Server/Materials/MaterialStorageSystem.cs +++ b/Content.Server/Materials/MaterialStorageSystem.cs @@ -8,8 +8,6 @@ using Content.Server.Construction.Components; using Content.Server.Stack; using Content.Shared.Database; using JetBrains.Annotations; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Prototypes; diff --git a/Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs b/Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs index df94bc94ee..1424f880f3 100644 --- a/Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs +++ b/Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs @@ -43,7 +43,7 @@ public sealed partial class MechGrabberComponent : Component [DataField("grabSound")] public SoundSpecifier GrabSound = new SoundPathSpecifier("/Audio/Mecha/sound_mecha_hydraulic.ogg"); - public EntityUid? AudioStream; + public IPlayingAudioStream? AudioStream; [ViewVariables(VVAccess.ReadWrite)] public Container ItemContainer = default!; diff --git a/Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs b/Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs index 8b7a4c6204..499f833ac8 100644 --- a/Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs +++ b/Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Mech.Equipment.Components; using Content.Shared.Mobs.Components; using Content.Shared.Wall; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Physics; @@ -151,7 +149,7 @@ public sealed class MechGrabberSystem : EntitySystem return; args.Handled = true; - component.AudioStream = _audio.PlayPvs(component.GrabSound, uid).Value.Entity; + component.AudioStream = _audio.PlayPvs(component.GrabSound, uid); _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.GrabDelay, new GrabberDoAfterEvent(), uid, target: target, used: uid) { BreakOnTargetMove = true, @@ -163,7 +161,7 @@ public sealed class MechGrabberSystem : EntitySystem { if (args.Cancelled) { - component.AudioStream = _audio.Stop(component.AudioStream); + component.AudioStream?.Stop(); return; } diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index 20ac9420aa..f16d13c23c 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -24,8 +24,6 @@ using Content.Shared.Nutrition.Components; using Content.Shared.Popups; using Content.Shared.Throwing; using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Physics.Components; using Robust.Shared.Random; diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 320b71576e..d041f8ee9d 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -18,7 +18,6 @@ using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Timing; using Content.Shared.Toggleable; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Timing; diff --git a/Content.Server/Medical/HealingSystem.cs b/Content.Server/Medical/HealingSystem.cs index 57f66f2378..2e04e1b03c 100644 --- a/Content.Server/Medical/HealingSystem.cs +++ b/Content.Server/Medical/HealingSystem.cs @@ -16,8 +16,6 @@ using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Stacks; using Content.Server.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Random; namespace Content.Server.Medical; diff --git a/Content.Server/Medical/HealthAnalyzerSystem.cs b/Content.Server/Medical/HealthAnalyzerSystem.cs index fe3944b21e..cde361ec74 100644 --- a/Content.Server/Medical/HealthAnalyzerSystem.cs +++ b/Content.Server/Medical/HealthAnalyzerSystem.cs @@ -8,8 +8,6 @@ using Content.Shared.Mobs.Components; using Robust.Server.GameObjects; using Content.Server.Temperature.Components; using Content.Server.Body.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Medical diff --git a/Content.Server/Medical/VomitSystem.cs b/Content.Server/Medical/VomitSystem.cs index 974c1981b5..d754bfd05e 100644 --- a/Content.Server/Medical/VomitSystem.cs +++ b/Content.Server/Medical/VomitSystem.cs @@ -10,7 +10,6 @@ using Content.Shared.IdentityManagement; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.StatusEffect; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Prototypes; diff --git a/Content.Server/Mind/MindSystem.cs b/Content.Server/Mind/MindSystem.cs index 36b5d7ec33..f23e9b6407 100644 --- a/Content.Server/Mind/MindSystem.cs +++ b/Content.Server/Mind/MindSystem.cs @@ -324,8 +324,7 @@ public sealed class MindSystem : SharedMindSystem return; Dirty(mindId, mind); - var netMind = GetNetEntity(mindId); - _pvsOverride.ClearOverride(netMind); + _pvsOverride.ClearOverride(mindId); if (userId != null && !_players.TryGetPlayerData(userId.Value, out _)) { Log.Error($"Attempted to set mind user to invalid value {userId}"); @@ -367,7 +366,7 @@ public sealed class MindSystem : SharedMindSystem if (_players.TryGetSessionById(userId.Value, out var ret)) { mind.Session = ret; - _pvsOverride.AddSessionOverride(netMind, ret); + _pvsOverride.AddSessionOverride(mindId, ret); _actor.Attach(mind.CurrentEntity, ret); } diff --git a/Content.Server/Morgue/CrematoriumSystem.cs b/Content.Server/Morgue/CrematoriumSystem.cs index 7f3c7aa1e9..8d05d0abd1 100644 --- a/Content.Server/Morgue/CrematoriumSystem.cs +++ b/Content.Server/Morgue/CrematoriumSystem.cs @@ -14,8 +14,6 @@ using Content.Shared.Storage; using Content.Shared.Storage.Components; using Content.Shared.Verbs; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Morgue; diff --git a/Content.Server/Morgue/MorgueSystem.cs b/Content.Server/Morgue/MorgueSystem.cs index b05c4414bc..91fb0ab9f1 100644 --- a/Content.Server/Morgue/MorgueSystem.cs +++ b/Content.Server/Morgue/MorgueSystem.cs @@ -3,9 +3,6 @@ using Content.Shared.Body.Components; using Content.Shared.Examine; using Content.Shared.Morgue; using Content.Shared.Morgue.Components; -using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Morgue; diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs index 052262cac5..311fd23468 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs @@ -5,9 +5,6 @@ using Content.Shared.Damage; using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Silicons.Bots; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific; diff --git a/Content.Server/NPC/Systems/NPCCombatSystem.cs b/Content.Server/NPC/Systems/NPCCombatSystem.cs index 7b012300da..fe01b2fcbe 100644 --- a/Content.Server/NPC/Systems/NPCCombatSystem.cs +++ b/Content.Server/NPC/Systems/NPCCombatSystem.cs @@ -1,8 +1,6 @@ using Content.Server.Interaction; using Content.Server.Weapons.Ranged.Systems; using Content.Shared.Weapons.Melee; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics.Systems; using Robust.Shared.Random; diff --git a/Content.Server/Ninja/Systems/BatteryDrainerSystem.cs b/Content.Server/Ninja/Systems/BatteryDrainerSystem.cs index bae999faff..37bf0eade1 100644 --- a/Content.Server/Ninja/Systems/BatteryDrainerSystem.cs +++ b/Content.Server/Ninja/Systems/BatteryDrainerSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Ninja.Components; using Content.Shared.Ninja.Systems; using Content.Shared.Popups; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Ninja.Systems; diff --git a/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs b/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs index 79e504da0a..6de2d7dee0 100644 --- a/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs +++ b/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs @@ -24,9 +24,7 @@ using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Random; using System.Diagnostics.CodeAnalysis; -using System.Linq; using Content.Server.Objectives.Components; -using Robust.Shared.Audio.Systems; namespace Content.Server.Ninja.Systems; diff --git a/Content.Server/Ninja/Systems/StunProviderSystem.cs b/Content.Server/Ninja/Systems/StunProviderSystem.cs index a22794e17c..70182e0e36 100644 --- a/Content.Server/Ninja/Systems/StunProviderSystem.cs +++ b/Content.Server/Ninja/Systems/StunProviderSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Ninja.Systems; using Content.Shared.Popups; using Content.Shared.Whitelist; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Server.Ninja.Systems; diff --git a/Content.Server/Nuke/NukeComponent.cs b/Content.Server/Nuke/NukeComponent.cs index 16377d5f75..2b9c9fe01e 100644 --- a/Content.Server/Nuke/NukeComponent.cs +++ b/Content.Server/Nuke/NukeComponent.cs @@ -174,7 +174,7 @@ namespace Content.Server.Nuke /// public bool PlayedAlertSound = false; - public EntityUid? AlertAudioStream = default; + public IPlayingAudioStream? AlertAudioStream = default; /// /// The radius from the nuke for which there must be floor tiles for it to be anchorable. diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index 77689c4e2b..ca0b0e0113 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -14,7 +14,6 @@ using Content.Shared.Nuke; using Content.Shared.Popups; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Player; @@ -217,7 +216,7 @@ public sealed class NukeSystem : EntitySystem private void OnClearButtonPressed(EntityUid uid, NukeComponent component, NukeKeypadClearMessage args) { - _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true); + _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true); if (component.Status != NukeStatus.AWAIT_CODE) return; @@ -335,12 +334,12 @@ public sealed class NukeSystem : EntitySystem { component.Status = NukeStatus.AWAIT_ARM; component.RemainingTime = component.Timer; - _audio.PlayEntity(component.AccessGrantedSound, Filter.Pvs(uid), uid, true); + _audio.Play(component.AccessGrantedSound, Filter.Pvs(uid), uid, true); } else { component.EnteredCode = ""; - _audio.PlayEntity(component.AccessDeniedSound, Filter.Pvs(uid), uid, true); + _audio.Play(component.AccessDeniedSound, Filter.Pvs(uid), uid, true); } break; @@ -410,7 +409,7 @@ public sealed class NukeSystem : EntitySystem // Don't double-dip on the octave shifting component.LastPlayedKeypadSemitones = number == 0 ? component.LastPlayedKeypadSemitones : semitoneShift; - _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f)); + _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f)); } public string GenerateRandomNumberString(int length) @@ -501,7 +500,7 @@ public sealed class NukeSystem : EntitySystem // disable sound and reset it component.PlayedAlertSound = false; - component.AlertAudioStream = _audio.Stop(component.AlertAudioStream); + component.AlertAudioStream?.Stop(); // turn off the spinny light _pointLight.SetEnabled(uid, false); diff --git a/Content.Server/Nutrition/Components/FatExtractorComponent.cs b/Content.Server/Nutrition/Components/FatExtractorComponent.cs index 7bd9b85c79..61bb85f9ec 100644 --- a/Content.Server/Nutrition/Components/FatExtractorComponent.cs +++ b/Content.Server/Nutrition/Components/FatExtractorComponent.cs @@ -83,7 +83,7 @@ public sealed partial class FatExtractorComponent : Component [DataField("processSound")] public SoundSpecifier? ProcessSound; - public EntityUid? Stream; + public IPlayingAudioStream? Stream; /// /// A minium hunger threshold for extracting nutrition. diff --git a/Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs b/Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs index 1271c57a23..e8e456c0ea 100644 --- a/Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs +++ b/Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs @@ -9,9 +9,6 @@ using Content.Shared.Nutrition.AnimalHusbandry; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Storage; -using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -35,7 +32,6 @@ public sealed class AnimalHusbandrySystem : EntitySystem [Dependency] private readonly SharedTransformSystem _transform = default!; private readonly HashSet _failedAttempts = new(); - private readonly HashSet _birthQueue = new(); /// public override void Initialize() @@ -226,7 +222,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem { base.Update(frameTime); - _birthQueue.Clear(); + HashSet birthQueue = new(); _failedAttempts.Clear(); var query = EntityQueryEnumerator(); @@ -234,7 +230,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem { if (reproductive.GestationEndTime != null && _timing.CurTime >= reproductive.GestationEndTime) { - _birthQueue.Add(uid); + birthQueue.Add(uid); } if (_timing.CurTime < reproductive.NextBreedAttempt) @@ -248,7 +244,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem TryReproduceNearby(uid, reproductive); } - foreach (var queued in _birthQueue) + foreach (var queued in birthQueue) { Birth(queued); } diff --git a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs index eebe7f98d8..586f965096 100644 --- a/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs @@ -13,7 +13,6 @@ using Content.Shared.Throwing; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Nutrition.EntitySystems @@ -38,7 +37,7 @@ namespace Content.Server.Nutrition.EntitySystems protected override void SplattedCreamPie(EntityUid uid, CreamPieComponent creamPie) { - _audio.PlayPvs(_audio.GetSound(creamPie.Sound), uid, AudioParams.Default.WithVariation(0.125f)); + _audio.Play(_audio.GetSound(creamPie.Sound), Filter.Pvs(uid), uid, false, new AudioParams().WithVariation(0.125f)); if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp)) { diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index 1829dc32c8..e493a18ae7 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -27,7 +27,6 @@ using Content.Shared.Nutrition.Components; using Content.Shared.Throwing; using Content.Shared.Verbs; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs b/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs index 63ca590f5d..6ab432d490 100644 --- a/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Emag.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Storage.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Server.Nutrition.EntitySystems; @@ -92,7 +90,7 @@ public sealed class FatExtractorSystem : EntitySystem component.Processing = true; _appearance.SetData(uid, FatExtractorVisuals.Processing, true); - component.Stream = _audio.PlayPvs(component.ProcessSound, uid)?.Entity; + component.Stream = _audio.PlayPvs(component.ProcessSound, uid); component.NextUpdate = _timing.CurTime + component.UpdateTime; } @@ -106,7 +104,7 @@ public sealed class FatExtractorSystem : EntitySystem component.Processing = false; _appearance.SetData(uid, FatExtractorVisuals.Processing, false); - component.Stream = _audio.Stop(component.Stream); + component.Stream?.Stop(); } public bool TryGetValidOccupant(EntityUid uid, [NotNullWhen(true)] out EntityUid? occupant, FatExtractorComponent? component = null, EntityStorageComponent? storage = null) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 7bb550725f..ff4ec41dd9 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -28,9 +28,6 @@ using Content.Shared.Verbs; using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Utility; -using Content.Shared.Tag; -using Content.Shared.Storage; -using Robust.Shared.Audio.Systems; namespace Content.Server.Nutrition.EntitySystems; @@ -281,7 +278,7 @@ public sealed class FoodSystem : EntitySystem _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(uid):food}"); } - _audio.PlayPvs(component.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-1f)); + _audio.Play(component.UseSound, Filter.Pvs(args.Target.Value), args.Target.Value, true, AudioParams.Default.WithVolume(-1f)); // Try to break all used utensils foreach (var utensil in utensils) diff --git a/Content.Server/Nutrition/EntitySystems/OpenableSystem.cs b/Content.Server/Nutrition/EntitySystems/OpenableSystem.cs index fbe617eff4..dd6474bc74 100644 --- a/Content.Server/Nutrition/EntitySystems/OpenableSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/OpenableSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Interaction.Events; using Content.Shared.Nutrition.Components; using Content.Shared.Popups; using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameObjects; namespace Content.Server.Nutrition.EntitySystems; diff --git a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs index 9d255e013c..88916e4cf2 100644 --- a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs @@ -7,18 +7,16 @@ using Content.Shared.FixedPoint; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Player; namespace Content.Server.Nutrition.EntitySystems { - public sealed class SliceableFoodSystem : EntitySystem + internal sealed class SliceableFoodSystem : EntitySystem { [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; + [Dependency] private readonly SharedContainerSystem _containerSystem = default!; public override void Initialize() { @@ -77,7 +75,8 @@ namespace Content.Server.Nutrition.EntitySystems xform.LocalRotation = 0; } - _audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2)); + SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid), + transform.Coordinates, AudioParams.Default.WithVolume(-2)); // Decrease size of item based on count - Could implement in the future // Bug with this currently is the size in a container is not updated diff --git a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs index f5f34080cb..0f1576658b 100644 --- a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs @@ -2,7 +2,6 @@ using Content.Server.Nutrition.Components; using Content.Server.Popups; using Content.Shared.Interaction; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; @@ -16,7 +15,6 @@ namespace Content.Server.Nutrition.EntitySystems [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly FoodSystem _foodSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; public override void Initialize() @@ -68,8 +66,8 @@ namespace Content.Server.Nutrition.EntitySystems if (_robustRandom.Prob(component.BreakChance)) { - _audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f)); - EntityManager.DeleteEntity(uid); + SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f)); + EntityManager.DeleteEntity(component.Owner); } } } diff --git a/Content.Server/PDA/Ringer/RingerSystem.cs b/Content.Server/PDA/Ringer/RingerSystem.cs index f8aadac461..7494d5e12c 100644 --- a/Content.Server/PDA/Ringer/RingerSystem.cs +++ b/Content.Server/PDA/Ringer/RingerSystem.cs @@ -13,8 +13,6 @@ using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; using Robust.Shared.Utility; -using System.Linq; -using Robust.Server.Audio; namespace Content.Server.PDA.Ringer { @@ -205,7 +203,7 @@ namespace Content.Server.PDA.Ringer ringer.TimeElapsed -= NoteDelay; var ringerXform = Transform(uid); - _audio.PlayEntity( + _audio.Play( GetSound(ringer.Ringtone[ringer.NoteCount]), Filter.Empty().AddInRange(ringerXform.MapPosition, ringer.Range), uid, diff --git a/Content.Server/Paper/PaperSystem.cs b/Content.Server/Paper/PaperSystem.cs index 571d7aefc9..553bcaa0a2 100644 --- a/Content.Server/Paper/PaperSystem.cs +++ b/Content.Server/Paper/PaperSystem.cs @@ -9,9 +9,6 @@ using Content.Shared.Paper; using Content.Shared.Tag; using Robust.Server.GameObjects; using Robust.Shared.Player; -using Robust.Shared.Utility; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using static Content.Shared.Paper.SharedPaperComponent; namespace Content.Server.Paper diff --git a/Content.Server/Pinpointer/ProximityBeeperSystem.cs b/Content.Server/Pinpointer/ProximityBeeperSystem.cs index d4175a1af5..d52223e2b4 100644 --- a/Content.Server/Pinpointer/ProximityBeeperSystem.cs +++ b/Content.Server/Pinpointer/ProximityBeeperSystem.cs @@ -2,7 +2,6 @@ using Content.Shared.Interaction.Events; using Content.Shared.Pinpointer; using Content.Shared.PowerCell; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Timing; diff --git a/Content.Server/Plants/Systems/PottedPlantHideSystem.cs b/Content.Server/Plants/Systems/PottedPlantHideSystem.cs index 09571c60a1..91e544b796 100644 --- a/Content.Server/Plants/Systems/PottedPlantHideSystem.cs +++ b/Content.Server/Plants/Systems/PottedPlantHideSystem.cs @@ -5,16 +5,14 @@ using Content.Server.Storage.EntitySystems; using Content.Shared.Audio; using Content.Shared.Interaction; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Plants.Systems { public sealed class PottedPlantHideSystem : EntitySystem { - [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SecretStashSystem _stashSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; public override void Initialize() { @@ -60,7 +58,7 @@ namespace Content.Server.Plants.Systems if (!Resolve(uid, ref component)) return; - _audio.PlayPvs(component.RustleSound, uid, AudioParams.Default.WithVariation(0.25f)); + SoundSystem.Play(component.RustleSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f)); } } } diff --git a/Content.Server/Points/PointSystem.cs b/Content.Server/Points/PointSystem.cs index b5f94d097e..a71294db9d 100644 --- a/Content.Server/Points/PointSystem.cs +++ b/Content.Server/Points/PointSystem.cs @@ -25,7 +25,7 @@ public sealed class PointSystem : SharedPointSystem private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args) { - _pvsOverride.AddGlobalOverride(GetNetEntity(uid)); + _pvsOverride.AddGlobalOverride(uid); } /// diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.cs index 5531f65409..fbf4961f4f 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.cs @@ -15,7 +15,6 @@ using Content.Shared.Mobs.Systems; using Content.Shared.Polymorph; using Content.Shared.Popups; using JetBrains.Annotations; -using Robust.Server.Audio; using Robust.Server.Containers; using Robust.Server.GameObjects; using Robust.Shared.Map; diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 95b5d74a94..8d9a62cd73 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -10,7 +10,6 @@ using Content.Shared.Emag.Systems; using Content.Shared.Popups; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Server.Power.EntitySystems; diff --git a/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs b/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs index 5ed39d5178..f1f8bf0616 100644 --- a/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs +++ b/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Examine; using Content.Shared.Hands.Components; using Content.Shared.Power; using Content.Shared.Verbs; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Utility; diff --git a/Content.Server/Power/Generator/PortableGeneratorSystem.cs b/Content.Server/Power/Generator/PortableGeneratorSystem.cs index 031e19b65d..1180665ad1 100644 --- a/Content.Server/Power/Generator/PortableGeneratorSystem.cs +++ b/Content.Server/Power/Generator/PortableGeneratorSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Popups; using Content.Shared.DoAfter; using Content.Shared.Power.Generator; using Content.Shared.Verbs; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Player; using Robust.Shared.Random; @@ -98,7 +97,7 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem var clogged = _generator.GetIsClogged(uid); var sound = empty ? component.StartSoundEmpty : component.StartSound; - _audio.PlayEntity(sound, Filter.Pvs(uid), uid, true); + _audio.Play(sound, Filter.Pvs(uid), uid, true); if (!clogged && !empty && _random.Prob(component.StartChance)) { diff --git a/Content.Server/Power/Generator/PowerSwitchableSystem.cs b/Content.Server/Power/Generator/PowerSwitchableSystem.cs index 7c377ef66e..ae7960cf8f 100644 --- a/Content.Server/Power/Generator/PowerSwitchableSystem.cs +++ b/Content.Server/Power/Generator/PowerSwitchableSystem.cs @@ -6,7 +6,8 @@ using Content.Server.Power.Nodes; using Content.Shared.Power.Generator; using Content.Shared.Timing; using Content.Shared.Verbs; -using Robust.Shared.Audio.Systems; +using Robust.Server.GameObjects; +using Robust.Shared.Player; using Robust.Shared.Utility; namespace Content.Server.Power.Generator; @@ -19,9 +20,9 @@ namespace Content.Server.Power.Generator; /// public sealed class PowerSwitchableSystem : SharedPowerSwitchableSystem { + [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly NodeGroupSystem _nodeGroup = default!; [Dependency] private readonly PopupSystem _popup = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UseDelaySystem _useDelay = default!; public override void Initialize() diff --git a/Content.Server/PowerSink/PowerSinkSystem.cs b/Content.Server/PowerSink/PowerSinkSystem.cs index deb6693500..e5a118b07e 100644 --- a/Content.Server/PowerSink/PowerSinkSystem.cs +++ b/Content.Server/PowerSink/PowerSinkSystem.cs @@ -6,7 +6,6 @@ using Content.Server.Chat.Systems; using Content.Server.Station.Systems; using Robust.Shared.Timing; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.PowerSink { diff --git a/Content.Server/Radiation/Systems/GeigerSystem.cs b/Content.Server/Radiation/Systems/GeigerSystem.cs index f889336a06..3a2fe12549 100644 --- a/Content.Server/Radiation/Systems/GeigerSystem.cs +++ b/Content.Server/Radiation/Systems/GeigerSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.Interaction; using Content.Shared.Inventory.Events; using Content.Shared.Radiation.Components; using Content.Shared.Radiation.Systems; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Server.Player; @@ -150,7 +149,7 @@ public sealed class GeigerSystem : SharedGeigerSystem if (!Resolve(uid, ref component, false)) return; - component.Stream = _audio.Stop(component.Stream); + component.Stream?.Stop(); if (!component.Sounds.TryGetValue(component.DangerLevel, out var sounds)) return; @@ -164,7 +163,7 @@ public sealed class GeigerSystem : SharedGeigerSystem var sound = _audio.GetSound(sounds); var param = sounds.Params.WithLoop(true).WithVolume(-4f); - component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity; + component.Stream = _audio.PlayGlobal(sound, session, param); } public static GeigerDangerLevel RadsToLevel(float rads) diff --git a/Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs b/Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs index 8a65e0a8bc..0d60f0af4f 100644 --- a/Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs +++ b/Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Research.TechnologyDisk.Components; using Content.Server.UserInterface; using Content.Shared.Research; using Content.Shared.Research.Components; -using Robust.Server.Audio; using Robust.Server.GameObjects; using Robust.Shared.Timing; diff --git a/Content.Server/RoundEnd/RoundEndSystem.cs b/Content.Server/RoundEnd/RoundEndSystem.cs index 5068a1a232..6043f3fbf9 100644 --- a/Content.Server/RoundEnd/RoundEndSystem.cs +++ b/Content.Server/RoundEnd/RoundEndSystem.cs @@ -11,7 +11,6 @@ using Content.Server.Station.Systems; using Content.Shared.Database; using Content.Shared.GameTicking; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Prototypes; @@ -34,7 +33,6 @@ namespace Content.Server.RoundEnd [Dependency] private readonly ChatSystem _chatSystem = default!; [Dependency] private readonly GameTicker _gameTicker = default!; [Dependency] private readonly EmergencyShuttleSystem _shuttle = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StationSystem _stationSystem = default!; public TimeSpan DefaultCooldownDuration { get; set; } = TimeSpan.FromSeconds(30); @@ -156,7 +154,7 @@ namespace Content.Server.RoundEnd null, Color.Gold); - _audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true); + SoundSystem.Play("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast()); LastCountdownStart = _gameTiming.CurTime; ExpectedCountdownEnd = _gameTiming.CurTime + countdownTime; @@ -187,7 +185,7 @@ namespace Content.Server.RoundEnd _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"), Loc.GetString("Station"), false, colorOverride: Color.Gold); - _audio.PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast(), true); + SoundSystem.Play("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast()); LastCountdownStart = null; ExpectedCountdownEnd = null; diff --git a/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs b/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs index 6d3d831a2d..2bc00397bc 100644 --- a/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs +++ b/Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs @@ -39,7 +39,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition /// /// Countdown audio stream. /// - public EntityUid? Stream = null; + public IPlayingAudioStream? Stream = null; /// /// Sound that plays when the mission end is imminent. diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index f0d4661a07..f2be8cd500 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -73,7 +73,7 @@ public sealed partial class SalvageSystem private void OnExpeditionShutdown(EntityUid uid, SalvageExpeditionComponent component, ComponentShutdown args) { - component.Stream = _audio.Stop(component.Stream); + component.Stream?.Stop(); foreach (var (job, cancelToken) in _salvageJobs.ToArray()) { diff --git a/Content.Server/Salvage/SalvageSystem.Runner.cs b/Content.Server/Salvage/SalvageSystem.Runner.cs index 3b89135c58..0863362131 100644 --- a/Content.Server/Salvage/SalvageSystem.Runner.cs +++ b/Content.Server/Salvage/SalvageSystem.Runner.cs @@ -153,7 +153,7 @@ public sealed partial class SalvageSystem else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2)) { // TODO: Some way to play audio attached to a map for players. - comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp(uid).MapId), true).Value.Entity; + comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp(uid).MapId), true); comp.Stage = ExpeditionStage.MusicCountdown; Dirty(uid, comp); Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes))); diff --git a/Content.Server/Salvage/SalvageSystem.cs b/Content.Server/Salvage/SalvageSystem.cs index eb98e1f2e1..0da6207289 100644 --- a/Content.Server/Salvage/SalvageSystem.cs +++ b/Content.Server/Salvage/SalvageSystem.cs @@ -27,8 +27,6 @@ using Content.Shared.Random; using Content.Shared.Random.Helpers; using Content.Shared.Tools.Components; using Robust.Server.Maps; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map.Components; using Robust.Shared.Timing; diff --git a/Content.Server/Shuttles/Components/FTLComponent.cs b/Content.Server/Shuttles/Components/FTLComponent.cs index 105b9eae6d..43b702cd39 100644 --- a/Content.Server/Shuttles/Components/FTLComponent.cs +++ b/Content.Server/Shuttles/Components/FTLComponent.cs @@ -51,5 +51,5 @@ public sealed partial class FTLComponent : Component Params = AudioParams.Default.WithVolume(-3f).WithLoop(true) }; - public EntityUid? TravelStream; + public IPlayingAudioStream? TravelStream; } diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index 0f2b8b847c..3ef3d97a21 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -20,9 +20,6 @@ using Content.Shared.Tag; using Content.Shared.Tiles; using Robust.Server.GameObjects; using Robust.Server.Maps; -using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Map.Components; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index 3fe5c2b1ed..e19d88b1c2 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -227,7 +227,8 @@ public sealed partial class ShuttleSystem component = AddComp(uid); component.State = FTLState.Starting; - _audio.PlayPvs(_startupSound, uid); + // TODO: Need BroadcastGrid to not be bad. + SoundSystem.Play(_startupSound.GetSound(), Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), _startupSound.Params); // Make sure the map is setup before we leave to avoid pop-in (e.g. parallax). SetupHyperspace(); return true; @@ -283,8 +284,11 @@ public sealed partial class ShuttleSystem var ev = new FTLStartedEvent(uid, target, fromMapUid, fromMatrix, fromRotation); RaiseLocalEvent(uid, ref ev, true); - comp.TravelStream = _audio.PlayPvs(comp.TravelSound, uid)?.Entity; - + if (comp.TravelSound != null) + { + comp.TravelStream = SoundSystem.Play(comp.TravelSound.GetSound(), + Filter.Pvs(uid, 4f, entityManager: EntityManager), comp.TravelSound.Params); + } break; // Arriving, play effects case FTLState.Travelling: @@ -370,8 +374,13 @@ public sealed partial class ShuttleSystem _thruster.DisableLinearThrusters(shuttle); } - comp.TravelStream = _audio.Stop(comp.TravelStream); - _audio.PlayPvs(_arrivalSound, uid); + if (comp.TravelStream != null) + { + comp.TravelStream?.Stop(); + comp.TravelStream = null; + } + + _audio.PlayGlobal(_arrivalSound, Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), true); if (TryComp(uid, out var dest)) { diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs index f346398cda..73dc4b208c 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs @@ -54,6 +54,6 @@ public sealed partial class ShuttleSystem var volume = MathF.Min(10f, 1f * MathF.Pow(jungleDiff, 0.5f) - 5f); var audioParams = AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation).WithVolume(volume); - _audio.PlayPvs(_shuttleImpactSound, coordinates, audioParams); + _audio.Play(_shuttleImpactSound, Filter.Pvs(coordinates, rangeMultiplier: 4f, entityMan: EntityManager), coordinates, true, audioParams); } } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index cbd36f12b7..41e4cbc2be 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Shuttles.Systems; using Content.Shared.Throwing; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Map.Components; diff --git a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs index 6b4347740a..ddc63156bf 100644 --- a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs @@ -5,8 +5,6 @@ using Content.Shared.Singularity.Components; using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.Events; using Robust.Server.GameStates; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -206,9 +204,9 @@ public sealed class SingularitySystem : SharedSingularitySystem MetaDataComponent? metaData = null; if (Resolve(uid, ref metaData) && metaData.EntityLifeStage <= EntityLifeStage.Initializing) - _audio.PlayPvs(comp.FormationSound, uid); + _audio.Play(comp.FormationSound, Filter.Pvs(uid), uid, true); - comp.AmbientSoundStream = _audio.PlayPvs(comp.AmbientSound, uid)?.Entity; + comp.AmbientSoundStream = _audio.Play(comp.AmbientSound, Filter.Pvs(uid), uid, true); UpdateSingularityLevel(uid, comp); } @@ -221,7 +219,7 @@ public sealed class SingularitySystem : SharedSingularitySystem /// The event arguments. public void OnDistortionStartup(EntityUid uid, SingularityDistortionComponent comp, ComponentStartup args) { - _pvs.AddGlobalOverride(GetNetEntity(uid)); + _pvs.AddGlobalOverride(uid); } /// @@ -234,18 +232,11 @@ public sealed class SingularitySystem : SharedSingularitySystem /// The event arguments. public void OnSingularityShutdown(EntityUid uid, SingularityComponent comp, ComponentShutdown args) { - comp.AmbientSoundStream = _audio.Stop(comp.AmbientSoundStream); + comp.AmbientSoundStream?.Stop(); MetaDataComponent? metaData = null; if (Resolve(uid, ref metaData) && metaData.EntityLifeStage >= EntityLifeStage.Terminating) - { - var xform = Transform(uid); - var coordinates = xform.Coordinates; - - // I feel like IsValid should be checking this or something idk. - if (!TerminatingOrDeleted(coordinates.EntityId)) - _audio.PlayPvs(comp.DissipationSound, coordinates); - } + _audio.Play(comp.DissipationSound, Filter.Pvs(uid), uid, true); } /// diff --git a/Content.Server/Speech/EntitySystems/VocalSystem.cs b/Content.Server/Speech/EntitySystems/VocalSystem.cs index aedcbbd099..5dccb8bf9c 100644 --- a/Content.Server/Speech/EntitySystems/VocalSystem.cs +++ b/Content.Server/Speech/EntitySystems/VocalSystem.cs @@ -4,8 +4,6 @@ using Content.Server.Speech.Components; using Content.Shared.Chat.Prototypes; using Content.Shared.Humanoid; using Content.Shared.Speech; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Speech/SpeechNoiseSystem.cs b/Content.Server/Speech/SpeechNoiseSystem.cs index 4f66a0828b..c81d17caf2 100644 --- a/Content.Server/Speech/SpeechNoiseSystem.cs +++ b/Content.Server/Speech/SpeechNoiseSystem.cs @@ -2,7 +2,6 @@ using Robust.Shared.Audio; using Content.Server.Chat; using Content.Server.Chat.Systems; using Content.Shared.Speech; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -15,7 +14,6 @@ namespace Content.Server.Speech [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -68,7 +66,7 @@ namespace Content.Server.Speech var pitchedAudioParams = component.AudioParams.WithPitchScale(scale); component.LastTimeSoundPlayed = currentTime; - _audio.PlayPvs(contextSound, uid, pitchedAudioParams); + SoundSystem.Play(contextSound, Filter.Pvs(uid, entityManager: EntityManager), uid, pitchedAudioParams); } } } diff --git a/Content.Server/SprayPainter/SprayPainterSystem.cs b/Content.Server/SprayPainter/SprayPainterSystem.cs index fd8ff9ea28..763b7697d3 100644 --- a/Content.Server/SprayPainter/SprayPainterSystem.cs +++ b/Content.Server/SprayPainter/SprayPainterSystem.cs @@ -11,8 +11,6 @@ using Content.Shared.SprayPainter; using Content.Shared.Interaction; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.SprayPainter; diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index 537a7e7c22..41a7b153f5 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -8,8 +8,6 @@ using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Server.StationEvents.Components; using Content.Shared.Database; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Collections; using Robust.Shared.Map; using Robust.Shared.Map.Components; diff --git a/Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs b/Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs index a8144311bb..f51c215c6e 100644 --- a/Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs @@ -5,9 +5,6 @@ using Content.Shared.Storage.Components; using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Random; -using System.Linq; -using Content.Shared.Storage.Components; -using Robust.Shared.Audio.Systems; namespace Content.Server.Storage.EntitySystems; @@ -15,7 +12,6 @@ public sealed class CursedEntityStorageSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly EntityStorageSystem _entityStorage = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -51,7 +47,6 @@ public sealed class CursedEntityStorageSystem : EntitySystem storage.Contents.Remove(entity); _entityStorage.AddToContents(entity, lockerEnt); } - - _audio.PlayPvs(component.CursedSound, uid, AudioHelpers.WithVariation(0.125f, _random)); + SoundSystem.Play(component.CursedSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.125f, _random)); } } diff --git a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs index c49bfdec93..25c31e48ca 100644 --- a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs +++ b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.Database; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction.Events; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Random; @@ -19,7 +18,6 @@ namespace Content.Server.Storage.EntitySystems [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly PricingSystem _pricing = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { @@ -81,9 +79,7 @@ namespace Content.Server.Storage.EntitySystems } if (component.Sound != null) - { - _audio.PlayPvs(component.Sound, uid); - } + SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid), uid); component.Uses--; diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index 35b94b2d6d..8b4ae1c76f 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -93,7 +93,7 @@ public sealed partial class StorageSystem : SharedStorageSystem UpdateStorageVisualization(uid, storageComp); if (storageComp.StorageCloseSound is not null) - Audio.PlayEntity(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params); + Audio.Play(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params); } } diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index 32c9a05043..0435a6bea6 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -10,8 +10,6 @@ using Content.Shared.FixedPoint; using Content.Shared.Hands.EntitySystems; using Content.Shared.Store; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Store.Systems; diff --git a/Content.Server/Stunnable/Systems/StunbatonSystem.cs b/Content.Server/Stunnable/Systems/StunbatonSystem.cs index da2391a86b..f4a7448fa2 100644 --- a/Content.Server/Stunnable/Systems/StunbatonSystem.cs +++ b/Content.Server/Stunnable/Systems/StunbatonSystem.cs @@ -13,7 +13,6 @@ using Content.Shared.Stunnable; using Content.Shared.Toggleable; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; namespace Content.Server.Stunnable.Systems @@ -25,7 +24,7 @@ namespace Content.Server.Stunnable.Systems [Dependency] private readonly RiggableSystem _riggableSystem = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly BatterySystem _battery = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly AudioSystem _audio = default!; public override void Initialize() { @@ -98,6 +97,7 @@ namespace Content.Server.Stunnable.Systems private void TurnOn(EntityUid uid, StunbatonComponent comp, EntityUid user) { + if (comp.Activated) return; diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs index ce3d8568ab..d40303ab31 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs @@ -1,7 +1,5 @@ using Content.Server.Chat.Systems; using Content.Shared.Speech; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; diff --git a/Content.Server/Teleportation/HandTeleporterSystem.cs b/Content.Server/Teleportation/HandTeleporterSystem.cs index 29cde5d741..4bfe03ba42 100644 --- a/Content.Server/Teleportation/HandTeleporterSystem.cs +++ b/Content.Server/Teleportation/HandTeleporterSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Database; using Content.Shared.Interaction.Events; using Content.Shared.Teleportation.Components; using Content.Shared.Teleportation.Systems; -using Robust.Server.Audio; using Robust.Server.GameObjects; namespace Content.Server.Teleportation; diff --git a/Content.Server/Toilet/ToiletSystem.cs b/Content.Server/Toilet/ToiletSystem.cs index 8bf8457e07..b10feae453 100644 --- a/Content.Server/Toilet/ToiletSystem.cs +++ b/Content.Server/Toilet/ToiletSystem.cs @@ -17,7 +17,6 @@ using Content.Shared.Tools; using Content.Shared.Tools.Components; using Content.Shared.Verbs; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem; diff --git a/Content.Server/Tools/ToolSystem.cs b/Content.Server/Tools/ToolSystem.cs index de6a7fefc1..88a96dc1e8 100644 --- a/Content.Server/Tools/ToolSystem.cs +++ b/Content.Server/Tools/ToolSystem.cs @@ -5,8 +5,6 @@ using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Maps; using Content.Shared.Tools; using Robust.Server.GameObjects; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem; diff --git a/Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs b/Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs index 45c6a3d9d5..d7864ba16c 100644 --- a/Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs +++ b/Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs @@ -4,8 +4,6 @@ using Content.Shared.IdentityManagement; using Content.Shared.Popups; using Content.Shared.Tag; using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Weapons.Melee.Balloon; diff --git a/Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs b/Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs index ca2a367d9b..fcd42f5a28 100644 --- a/Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs +++ b/Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs @@ -12,8 +12,6 @@ using Content.Shared.Weapons.Melee; using Content.Shared.Weapons.Melee.Events; using Content.Shared.Wieldable; using Content.Shared.Wieldable.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; @@ -118,7 +116,7 @@ public sealed class EnergySwordSystem : EntitySystem if (comp.IsSharp) RemComp(uid); - _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params); + _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params); comp.Activated = false; } @@ -145,7 +143,7 @@ public sealed class EnergySwordSystem : EntitySystem malus.Malus += comp.LitDisarmMalus; } - _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params); + _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params); comp.Activated = true; } diff --git a/Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs b/Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs index 8cb22ca8bd..6236040a83 100644 --- a/Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs +++ b/Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs @@ -1,8 +1,6 @@ using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Random; using Content.Shared.Cluwne; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Server.Weapons.Melee.WeaponRandom; diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index cb019e3d64..b6452efa8a 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -16,9 +16,6 @@ using Content.Shared.Tools; using Content.Shared.Tools.Components; using Content.Shared.Wires; using Robust.Server.GameObjects; -using Robust.Server.Player; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs index 63095c7827..9200928d66 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs @@ -18,7 +18,6 @@ using Content.Shared.Xenoarchaeology.XenoArtifacts; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Robust.Shared.Utility; diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index b8b2fba9d3..0791924caa 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -9,8 +9,6 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components; using Content.Shared.CCVar; using Content.Shared.Xenoarchaeology.XenoArtifacts; using JetBrains.Annotations; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Random; using Robust.Shared.Timing; diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs index 662abfee62..ba2786f32d 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs @@ -3,7 +3,6 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components; using Content.Server.Xenoarchaeology.XenoArtifacts.Events; using Content.Shared.Humanoid; using Content.Shared.Mobs.Systems; -using Robust.Shared.Audio.Systems; namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems; diff --git a/Content.Server/Zombies/ZombieSystem.Transform.cs b/Content.Server/Zombies/ZombieSystem.Transform.cs index f35adf1294..3014edd1b9 100644 --- a/Content.Server/Zombies/ZombieSystem.Transform.cs +++ b/Content.Server/Zombies/ZombieSystem.Transform.cs @@ -32,7 +32,6 @@ using Content.Shared.Weapons.Melee; using Content.Shared.Zombies; using Robust.Shared.Audio; using Content.Shared.Prying.Components; -using Robust.Shared.Audio.Systems; namespace Content.Server.Zombies { diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 8750089764..00a17ace25 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Database; using Content.Shared.Hands; using Content.Shared.Interaction; using Content.Shared.Inventory.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Map; diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index e2218091ce..4b2b3ada70 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -5,8 +5,6 @@ using Content.Shared.Database; using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Random; using Robust.Shared.Timing; diff --git a/Content.Shared/Audio/SharedAmbientSoundSystem.cs b/Content.Shared/Audio/SharedAmbientSoundSystem.cs index 6318ba2557..30fdc946ed 100644 --- a/Content.Shared/Audio/SharedAmbientSoundSystem.cs +++ b/Content.Shared/Audio/SharedAmbientSoundSystem.cs @@ -19,7 +19,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem ambience.Enabled = value; QueueUpdate(uid, ambience); - Dirty(uid, ambience); + Dirty(ambience); } public virtual void SetRange(EntityUid uid, float value, AmbientSoundComponent? ambience = null) @@ -29,7 +29,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem ambience.Range = value; QueueUpdate(uid, ambience); - Dirty(uid, ambience); + Dirty(ambience); } protected virtual void QueueUpdate(EntityUid uid, AmbientSoundComponent ambience) @@ -43,7 +43,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem return; ambience.Volume = value; - Dirty(uid, ambience); + Dirty(ambience); } public virtual void SetSound(EntityUid uid, SoundSpecifier sound, AmbientSoundComponent? ambience = null) @@ -53,7 +53,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem ambience.Sound = sound; QueueUpdate(uid, ambience); - Dirty(uid, ambience); + Dirty(ambience); } private void HandleCompState(EntityUid uid, AmbientSoundComponent component, ref ComponentHandleState args) diff --git a/Content.Shared/Audio/SharedContentAudioSystem.cs b/Content.Shared/Audio/SharedContentAudioSystem.cs index 3563f2f846..7151ef2c17 100644 --- a/Content.Shared/Audio/SharedContentAudioSystem.cs +++ b/Content.Shared/Audio/SharedContentAudioSystem.cs @@ -1,12 +1,10 @@ using Content.Shared.Physics; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Audio; public abstract class SharedContentAudioSystem : EntitySystem { - [Dependency] protected readonly SharedAudioSystem Audio = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; /// /// Standard variation to use for sounds. @@ -16,6 +14,6 @@ public abstract class SharedContentAudioSystem : EntitySystem public override void Initialize() { base.Initialize(); - Audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable; + _audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable; } } diff --git a/Content.Shared/Blocking/BlockingSystem.User.cs b/Content.Shared/Blocking/BlockingSystem.User.cs index 2d721390e6..bfefaf2b92 100644 --- a/Content.Shared/Blocking/BlockingSystem.User.cs +++ b/Content.Shared/Blocking/BlockingSystem.User.cs @@ -1,7 +1,6 @@ using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; namespace Content.Shared.Blocking; @@ -52,7 +51,7 @@ public sealed partial class BlockingSystem if (blocking.IsBlocking) { - _audio.PlayPvs(blocking.BlockSound, uid); + _audio.PlayPvs(blocking.BlockSound, uid, AudioParams.Default.WithVariation(0.2f)); } } } diff --git a/Content.Shared/Blocking/Components/BlockingComponent.cs b/Content.Shared/Blocking/Components/BlockingComponent.cs index f869c20679..9a379a29e9 100644 --- a/Content.Shared/Blocking/Components/BlockingComponent.cs +++ b/Content.Shared/Blocking/Components/BlockingComponent.cs @@ -57,11 +57,8 @@ public sealed partial class BlockingComponent : Component /// /// The sound to be played when you get hit while actively blocking /// - [DataField("blockSound")] public SoundSpecifier BlockSound = - new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg") - { - Params = AudioParams.Default.WithVariation(0.25f) - }; + [DataField("blockSound")] + public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg"); /// /// Fraction of original damage shield will take instead of user diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 90b8a28011..6add066133 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -493,10 +493,8 @@ public abstract partial class SharedBuckleSystem _joints.RefreshRelay(buckleUid); Appearance.SetData(strapUid, StrapVisuals.State, strapComp.BuckledEntities.Count != 0); - - // TODO: Buckle listening to moveevents is sussy anyway. - if (!TerminatingOrDeleted(strapUid)) - _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, userUid); + var audioSourceUid = userUid != buckleUid ? userUid : strapUid; + _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, audioSourceUid); var ev = new BuckleChangeEvent(strapUid, buckleUid, false); RaiseLocalEvent(buckleUid, ref ev); diff --git a/Content.Shared/Buckle/SharedBuckleSystem.cs b/Content.Shared/Buckle/SharedBuckleSystem.cs index 8f68335663..1441745b5d 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Mobs.Systems; using Content.Shared.Popups; using Content.Shared.Pulling; using Content.Shared.Standing; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Network; diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 89dfdf15c9..eb74a4994f 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -69,8 +69,6 @@ namespace Content.Shared.CCVar public static readonly CVarDef AmbienceVolume = CVarDef.Create("ambience.volume", 0.0f, CVar.ARCHIVE | CVar.CLIENTONLY); - public const float MasterMultiplier = 2f; - // Midi is on engine so deal public const float MidiMultiplier = 3f; diff --git a/Content.Shared/Cabinet/SharedItemCabinetSystem.cs b/Content.Shared/Cabinet/SharedItemCabinetSystem.cs index 92af6a4f8a..f2f03c1334 100644 --- a/Content.Shared/Cabinet/SharedItemCabinetSystem.cs +++ b/Content.Shared/Cabinet/SharedItemCabinetSystem.cs @@ -3,7 +3,6 @@ using Content.Shared.Interaction; using Content.Shared.Lock; using Content.Shared.Verbs; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -118,7 +117,7 @@ public abstract class SharedItemCabinetSystem : EntitySystem return; cabinet.Opened = !cabinet.Opened; - Dirty(uid, cabinet); + Dirty(cabinet); _itemSlots.SetLock(uid, cabinet.CabinetSlot, !cabinet.Opened); if (_timing.IsFirstTimePredicted) diff --git a/Content.Shared/Chasm/ChasmSystem.cs b/Content.Shared/Chasm/ChasmSystem.cs index 4045a27078..7353bd0e9c 100644 --- a/Content.Shared/Chasm/ChasmSystem.cs +++ b/Content.Shared/Chasm/ChasmSystem.cs @@ -2,8 +2,6 @@ using Content.Shared.Buckle.Components; using Content.Shared.Movement.Events; using Content.Shared.StepTrigger.Systems; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; diff --git a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs index 1a55408916..ed53b78466 100644 --- a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs +++ b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs @@ -4,8 +4,6 @@ using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; using Content.Shared.Database; using Content.Shared.FixedPoint; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; namespace Content.Shared.Chemistry.Reaction diff --git a/Content.Shared/Climbing/Systems/BonkSystem.cs b/Content.Shared/Climbing/Systems/BonkSystem.cs index b18d54cf78..6ded524b19 100644 --- a/Content.Shared/Climbing/Systems/BonkSystem.cs +++ b/Content.Shared/Climbing/Systems/BonkSystem.cs @@ -8,8 +8,6 @@ using Content.Shared.Interaction; using Content.Shared.Interaction.Components; using Content.Shared.Popups; using Content.Shared.Stunnable; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Serialization; diff --git a/Content.Shared/Climbing/Systems/ClimbSystem.cs b/Content.Shared/Climbing/Systems/ClimbSystem.cs index 652834e0f8..46255e4337 100644 --- a/Content.Shared/Climbing/Systems/ClimbSystem.cs +++ b/Content.Shared/Climbing/Systems/ClimbSystem.cs @@ -18,7 +18,6 @@ using Content.Shared.Physics; using Content.Shared.Popups; using Content.Shared.Stunnable; using Content.Shared.Verbs; -using Robust.Shared.Audio.Systems; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index ad27101cc1..9194a8208e 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Network; diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 3ad85d9579..4951bb7f1c 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -29,8 +29,6 @@ using Content.Shared.Rejuvenate; using Content.Shared.Stunnable; using Content.Shared.Verbs; using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Network; using Robust.Shared.Player; diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 33f1b0375b..40c4f7eb8f 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -16,7 +16,6 @@ using Content.Shared.Throwing; using Content.Shared.Weapons.Melee.Events; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Random; diff --git a/Content.Shared/Devour/SharedDevourSystem.cs b/Content.Shared/Devour/SharedDevourSystem.cs index 3d406843f5..192fd20078 100644 --- a/Content.Shared/Devour/SharedDevourSystem.cs +++ b/Content.Shared/Devour/SharedDevourSystem.cs @@ -4,8 +4,6 @@ using Content.Shared.DoAfter; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Content.Shared.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Serialization; diff --git a/Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs b/Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs index 7c5ef45275..a9a52010fd 100644 --- a/Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs @@ -1,8 +1,6 @@ using Content.Shared.Doors.Components; using Content.Shared.Popups; using Content.Shared.Prying.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Doors.Systems; diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index 85bb399b48..084c3b4ea2 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -14,8 +14,6 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; -using Content.Shared.Prying.Components; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Doors.Systems; diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index d249bb861b..90c9f0e1e0 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -11,7 +11,6 @@ using Content.Shared.Movement.Systems; using Content.Shared.Popups; using Content.Shared.Strip.Components; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Network; using Robust.Shared.Player; @@ -24,7 +23,6 @@ public abstract partial class InventorySystem [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; @@ -208,10 +206,10 @@ public abstract partial class InventorySystem filter.RemoveWhereAttachedEntity(entity => entity == actor); } - _audio.PlayPredicted(clothing.EquipSound, target, actor); + SoundSystem.Play(clothing.EquipSound.GetSound(), filter, target, clothing.EquipSound.Params.WithVolume(-2f)); } - Dirty(target, inventory); + inventory.Dirty(); _movementSpeed.RefreshMovementSpeedModifiers(target); @@ -395,11 +393,10 @@ public abstract partial class InventorySystem filter.RemoveWhereAttachedEntity(entity => entity == actor); } - _audio.PlayPredicted(clothing.UnequipSound, target, actor); + SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f)); } Dirty(target, inventory); - _movementSpeed.RefreshMovementSpeedModifiers(target); return true; diff --git a/Content.Shared/Light/SharedHandheldLightSystem.cs b/Content.Shared/Light/SharedHandheldLightSystem.cs index 2fa15800a3..d530b07b18 100644 --- a/Content.Shared/Light/SharedHandheldLightSystem.cs +++ b/Content.Shared/Light/SharedHandheldLightSystem.cs @@ -3,8 +3,6 @@ using Content.Shared.Clothing.EntitySystems; using Content.Shared.Item; using Content.Shared.Light.Components; using Content.Shared.Toggleable; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; namespace Content.Shared.Light; diff --git a/Content.Shared/Lock/LockComponent.cs b/Content.Shared/Lock/LockComponent.cs index 174818c4e8..31187a96cb 100644 --- a/Content.Shared/Lock/LockComponent.cs +++ b/Content.Shared/Lock/LockComponent.cs @@ -30,19 +30,13 @@ public sealed partial class LockComponent : Component /// The sound played when unlocked. /// [DataField("unlockingSound"), ViewVariables(VVAccess.ReadWrite)] - public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg") - { - Params = AudioParams.Default.WithVolume(-5f), - }; + public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg"); /// /// The sound played when locked. /// [DataField("lockingSound"), ViewVariables(VVAccess.ReadWrite)] - public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg") - { - Params = AudioParams.Default.WithVolume(-5f) - }; + public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg"); /// /// Whether or not an emag disables it. diff --git a/Content.Shared/Lock/LockSystem.cs b/Content.Shared/Lock/LockSystem.cs index 7babc6a9c0..97baa28bf9 100644 --- a/Content.Shared/Lock/LockSystem.cs +++ b/Content.Shared/Lock/LockSystem.cs @@ -11,7 +11,6 @@ using Content.Shared.Storage.Components; using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; namespace Content.Shared.Lock; @@ -103,11 +102,11 @@ public sealed class LockSystem : EntitySystem _sharedPopupSystem.PopupClient(Loc.GetString("lock-comp-do-lock-success", ("entityName", Identity.Name(uid, EntityManager))), uid, user); - _audio.PlayPredicted(lockComp.LockSound, uid, user); + _audio.PlayPredicted(lockComp.LockSound, uid, user, AudioParams.Default.WithVolume(-5)); lockComp.Locked = true; _appearanceSystem.SetData(uid, StorageVisuals.Locked, true); - Dirty(uid, lockComp); + Dirty(lockComp); var ev = new LockToggledEvent(true); RaiseLocalEvent(uid, ref ev, true); @@ -131,11 +130,11 @@ public sealed class LockSystem : EntitySystem ("entityName", Identity.Name(uid, EntityManager))), uid, user.Value); } - _audio.PlayPredicted(lockComp.UnlockSound, uid, user); + _audio.PlayPredicted(lockComp.UnlockSound, uid, user, AudioParams.Default.WithVolume(-5)); lockComp.Locked = false; _appearanceSystem.SetData(uid, StorageVisuals.Locked, false); - Dirty(uid, lockComp); + Dirty(lockComp); var ev = new LockToggledEvent(false); RaiseLocalEvent(uid, ref ev, true); @@ -214,7 +213,7 @@ public sealed class LockSystem : EntitySystem { if (!component.Locked || !component.BreakOnEmag) return; - _audio.PlayPredicted(component.UnlockSound, uid, null); + _audio.PlayPredicted(component.UnlockSound, uid, null, AudioParams.Default.WithVolume(-5)); _appearanceSystem.SetData(uid, StorageVisuals.Locked, false); RemComp(uid); //Literally destroys the lock as a tell it was emagged args.Handled = true; diff --git a/Content.Shared/Materials/MaterialReclaimerComponent.cs b/Content.Shared/Materials/MaterialReclaimerComponent.cs index eda5cc4058..761469f99a 100644 --- a/Content.Shared/Materials/MaterialReclaimerComponent.cs +++ b/Content.Shared/Materials/MaterialReclaimerComponent.cs @@ -126,7 +126,7 @@ public sealed partial class MaterialReclaimerComponent : Component [DataField] public TimeSpan SoundCooldown = TimeSpan.FromSeconds(0.8f); - public EntityUid? Stream; + public IPlayingAudioStream? Stream; /// /// A counter of how many items have been processed diff --git a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs index 31df11fa8b..c3c712b617 100644 --- a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs +++ b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs @@ -8,8 +8,6 @@ using Content.Shared.Emag.Systems; using Content.Shared.Examine; using Content.Shared.Mobs.Components; using Content.Shared.Stacks; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Physics.Events; using Robust.Shared.Timing; @@ -50,7 +48,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args) { - _audio.Stop(component.Stream); + component.Stream?.Stop(); } private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args) @@ -118,7 +116,8 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem if (Timing.CurTime > component.NextSound) { - component.Stream = _audio.PlayPredicted(component.Sound, uid, user)?.Entity; + component.Stream = _audio.PlayPredicted(component.Sound, uid, user); + component.NextSound = Timing.CurTime + component.SoundCooldown; } @@ -168,11 +167,9 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem component.ItemsProcessed++; if (component.CutOffSound) - { - _audio.Stop(component.Stream); - } + component.Stream?.Stop(); - Dirty(uid, component); + Dirty(component); } /// @@ -184,7 +181,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem return; component.Enabled = enabled; AmbientSound.SetAmbience(uid, enabled && component.Powered); - Dirty(uid, component); + Dirty(component); } /// diff --git a/Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs b/Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs index 1440a6ef1f..b4254fe079 100644 --- a/Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs +++ b/Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Mech.Equipment.Systems; using Content.Shared.Timing; using Robust.Shared.Audio; using System.Linq; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Mech.Equipment.Systems; diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 6e8d47fd3e..af065d0dec 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -12,7 +12,6 @@ using Content.Shared.Movement.Events; using Content.Shared.Pulling.Components; using Content.Shared.Tag; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Containers; using Robust.Shared.Map; diff --git a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs index f9e5d4a1f6..d376d05724 100644 --- a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs +++ b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs @@ -6,7 +6,6 @@ using Content.Shared.Interaction; using Content.Shared.Ninja.Components; using Content.Shared.Physics; using Content.Shared.Popups; -using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; namespace Content.Shared.Ninja.Systems; diff --git a/Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs b/Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs index 224152a402..473e29cc94 100644 --- a/Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs +++ b/Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Clothing.EntitySystems; using Content.Shared.Inventory.Events; using Content.Shared.Ninja.Components; using Content.Shared.Timing; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Ninja.Systems; diff --git a/Content.Shared/Projectiles/SharedProjectileSystem.cs b/Content.Shared/Projectiles/SharedProjectileSystem.cs index 3b9eded288..63b4cb13aa 100644 --- a/Content.Shared/Projectiles/SharedProjectileSystem.cs +++ b/Content.Shared/Projectiles/SharedProjectileSystem.cs @@ -4,9 +4,6 @@ using Content.Shared.DoAfter; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Throwing; -using Content.Shared.Weapons.Ranged.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Physics; diff --git a/Content.Shared/Prying/Systems/PryingSystem.cs b/Content.Shared/Prying/Systems/PryingSystem.cs index bc37ab035a..5fd94c3438 100644 --- a/Content.Shared/Prying/Systems/PryingSystem.cs +++ b/Content.Shared/Prying/Systems/PryingSystem.cs @@ -8,8 +8,6 @@ using Content.Shared.Doors.Components; using System.Diagnostics.CodeAnalysis; using Content.Shared.Interaction; using Content.Shared.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using PryUnpoweredComponent = Content.Shared.Prying.Components.PryUnpoweredComponent; namespace Content.Shared.Prying.Systems; diff --git a/Content.Shared/RCD/Systems/RCDSystem.cs b/Content.Shared/RCD/Systems/RCDSystem.cs index d7126716ed..ccc47a2fde 100644 --- a/Content.Shared/RCD/Systems/RCDSystem.cs +++ b/Content.Shared/RCD/Systems/RCDSystem.cs @@ -13,7 +13,6 @@ using Content.Shared.RCD.Components; using Content.Shared.Tag; using Content.Shared.Tiles; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Network; diff --git a/Content.Shared/Radiation/Components/GeigerComponent.cs b/Content.Shared/Radiation/Components/GeigerComponent.cs index 71edb70b37..585c1a51dc 100644 --- a/Content.Shared/Radiation/Components/GeigerComponent.cs +++ b/Content.Shared/Radiation/Components/GeigerComponent.cs @@ -82,7 +82,7 @@ public sealed partial class GeigerComponent : Component /// Current stream of geiger counter audio. /// Played only for current user. /// - public EntityUid? Stream; + public IPlayingAudioStream? Stream; } [Serializable, NetSerializable] diff --git a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs index 31856eefac..eb97fe4113 100644 --- a/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs +++ b/Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Radio.Components; using Content.Shared.Tools; using Content.Shared.Tools.Components; using Content.Shared.Wires; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Network; using Robust.Shared.Prototypes; diff --git a/Content.Shared/RatKing/SharedRatKingSystem.cs b/Content.Shared/RatKing/SharedRatKingSystem.cs index 5ae01ebb98..93293d09be 100644 --- a/Content.Shared/RatKing/SharedRatKingSystem.cs +++ b/Content.Shared/RatKing/SharedRatKingSystem.cs @@ -3,8 +3,6 @@ using Content.Shared.DoAfter; using Content.Shared.Random; using Content.Shared.Random.Helpers; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs b/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs index d678b14b92..cbc54c91e3 100644 --- a/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs +++ b/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs @@ -6,8 +6,6 @@ using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Stacks; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Prototypes; diff --git a/Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs b/Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs index a75d6113c9..47fb940786 100644 --- a/Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs +++ b/Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs @@ -33,8 +33,6 @@ public sealed partial class EmaggableMedibotComponent : Component /// /// Sound to play when the bot has been emagged /// - [DataField("sparkSound")] public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks") - { - Params = AudioParams.Default.WithVolume(8f), - }; + [DataField("sparkSound")] + public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks"); } diff --git a/Content.Shared/Silicons/Bots/MedibotSystem.cs b/Content.Shared/Silicons/Bots/MedibotSystem.cs index 464e95b77f..fe88cbae5c 100644 --- a/Content.Shared/Silicons/Bots/MedibotSystem.cs +++ b/Content.Shared/Silicons/Bots/MedibotSystem.cs @@ -1,6 +1,5 @@ using Content.Shared.Emag.Systems; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; namespace Content.Shared.Silicons.Bots; @@ -23,7 +22,7 @@ public sealed class MedibotSystem : EntitySystem if (!TryComp(uid, out var medibot)) return; - _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid); + _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid, AudioParams.Default.WithVolume(8)); medibot.StandardMed = comp.StandardMed; medibot.StandardMedAmount = comp.StandardMedAmount; diff --git a/Content.Shared/Singularity/Components/SingularityComponent.cs b/Content.Shared/Singularity/Components/SingularityComponent.cs index 3bab8d80b0..fe5cd0377f 100644 --- a/Content.Shared/Singularity/Components/SingularityComponent.cs +++ b/Content.Shared/Singularity/Components/SingularityComponent.cs @@ -61,7 +61,7 @@ public sealed partial class SingularityComponent : Component /// The audio stream that plays the sound specified by on loop. /// [ViewVariables(VVAccess.ReadWrite)] - public EntityUid? AmbientSoundStream = null; + public IPlayingAudioStream? AmbientSoundStream = null; /// /// The sound that the singularity produces when it forms. diff --git a/Content.Shared/Slippery/SlipperySystem.cs b/Content.Shared/Slippery/SlipperySystem.cs index 60d53eb16f..00f023f9a3 100644 --- a/Content.Shared/Slippery/SlipperySystem.cs +++ b/Content.Shared/Slippery/SlipperySystem.cs @@ -5,8 +5,6 @@ using Content.Shared.StatusEffect; using Content.Shared.StepTrigger.Systems; using Content.Shared.Stunnable; using JetBrains.Annotations; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; diff --git a/Content.Shared/Sound/SharedEmitSoundSystem.cs b/Content.Shared/Sound/SharedEmitSoundSystem.cs index e9ae86ed2a..ea42b4bff9 100644 --- a/Content.Shared/Sound/SharedEmitSoundSystem.cs +++ b/Content.Shared/Sound/SharedEmitSoundSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Sound.Components; using Content.Shared.Throwing; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Physics.Components; @@ -143,11 +142,8 @@ public abstract class SharedEmitSoundSystem : EntitySystem var fraction = MathF.Min(1f, (physics.LinearVelocity.Length() - component.MinimumVelocity) / MaxVolumeVelocity); var volume = MinVolume + (MaxVolume - MinVolume) * fraction; component.NextSound = _timing.CurTime + EmitSoundOnCollideComponent.CollideCooldown; - var sound = component.Sound; - if (_netMan.IsServer && sound != null) - { - _audioSystem.PlayPvs(_audioSystem.GetSound(sound), uid, AudioParams.Default.WithVolume(volume)); - } + if (_netMan.IsServer) + _audioSystem.PlayPvs(component.Sound, uid, AudioParams.Default.WithVolume(volume)); } } diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index 517831b8a1..bb74a088b3 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -2,7 +2,6 @@ using Content.Shared.Hands.Components; using Content.Shared.Physics; using Content.Shared.Rotation; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Physics; using Robust.Shared.Physics.Systems; @@ -82,7 +81,7 @@ namespace Content.Shared.Standing if (playSound) { - _audio.PlayPredicted(standingState.DownSound, uid, uid); + _audio.PlayPredicted(standingState.DownSound, uid, uid, AudioParams.Default.WithVariation(0.25f)); } return true; diff --git a/Content.Shared/Storage/EntitySystems/DumpableSystem.cs b/Content.Shared/Storage/EntitySystems/DumpableSystem.cs index 1672e27214..ad86a52665 100644 --- a/Content.Shared/Storage/EntitySystems/DumpableSystem.cs +++ b/Content.Shared/Storage/EntitySystems/DumpableSystem.cs @@ -5,8 +5,6 @@ using Content.Shared.Interaction; using Content.Shared.Placeable; using Content.Shared.Storage.Components; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Random; using Robust.Shared.Utility; diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index 0122e5b53a..2d85f79e03 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -15,8 +15,6 @@ using Content.Shared.Storage.Components; using Content.Shared.Tools.Systems; using Content.Shared.Verbs; using Content.Shared.Wall; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Map; diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index 1c74b0f973..5faec99fd5 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -17,8 +17,6 @@ using Content.Shared.Stacks; using Content.Shared.Storage.Components; using Content.Shared.Timing; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Random; diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index c447f8c8bc..4875f2f68f 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -18,7 +18,6 @@ using Content.Shared.Standing; using Content.Shared.StatusEffect; using Content.Shared.Throwing; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.GameStates; using Robust.Shared.Player; diff --git a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs index 1afaab3539..e614a2c040 100644 --- a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs +++ b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs @@ -6,8 +6,6 @@ using Content.Shared.Pulling; using Content.Shared.Pulling.Components; using Content.Shared.Teleportation.Components; using Content.Shared.Verbs; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Physics.Dynamics; diff --git a/Content.Shared/Tiles/FloorTileComponent.cs b/Content.Shared/Tiles/FloorTileComponent.cs index 92208a76d4..6d497c003d 100644 --- a/Content.Shared/Tiles/FloorTileComponent.cs +++ b/Content.Shared/Tiles/FloorTileComponent.cs @@ -15,10 +15,7 @@ namespace Content.Shared.Tiles [DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer))] public List? OutputTiles; - [DataField("placeTileSound")] public SoundSpecifier PlaceTileSound = - new SoundPathSpecifier("/Audio/Items/genhit.ogg") - { - Params = AudioParams.Default.WithVariation(0.125f), - }; + [DataField("placeTileSound")] + public SoundSpecifier PlaceTileSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg"); } } diff --git a/Content.Shared/Tiles/FloorTileSystem.cs b/Content.Shared/Tiles/FloorTileSystem.cs index 21e21fa9e9..dcf914ccf8 100644 --- a/Content.Shared/Tiles/FloorTileSystem.cs +++ b/Content.Shared/Tiles/FloorTileSystem.cs @@ -10,7 +10,6 @@ using Content.Shared.Physics; using Content.Shared.Popups; using Content.Shared.Stacks; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Network; @@ -179,7 +178,7 @@ public sealed class FloorTileSystem : EntitySystem var variant = (byte) (_timing.CurTick.Value % ((ContentTileDefinition) _tileDefinitionManager[tileId]).Variants); mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId, 0, variant)); - _audio.PlayPredicted(placeSound, location, user); + _audio.PlayPredicted(placeSound, location, user, AudioHelpers.WithVariation(0.125f, _random)); } public bool CanPlaceTile(EntityUid gridUid, MapGridComponent component, [NotNullWhen(false)] out string? reason) diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.cs b/Content.Shared/Tools/Systems/SharedToolSystem.cs index 91984d29e3..c1a2bdc2dd 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.cs @@ -3,8 +3,6 @@ using Content.Shared.DoAfter; using Content.Shared.Interaction; using Content.Shared.Maps; using Content.Shared.Tools.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Prototypes; @@ -54,7 +52,7 @@ public abstract partial class SharedToolSystem : EntitySystem if (tool.UseSound == null) return; - _audioSystem.PlayPredicted(tool.UseSound, uid, user); + _audioSystem.PlayPredicted(tool.UseSound, uid, user, tool.UseSound.Params.WithVariation(0.175f).AddVolume(-5f)); } /// diff --git a/Content.Shared/Traits/Assorted/ParacusiaComponent.cs b/Content.Shared/Traits/Assorted/ParacusiaComponent.cs index 1db698359b..51a7471f1e 100644 --- a/Content.Shared/Traits/Assorted/ParacusiaComponent.cs +++ b/Content.Shared/Traits/Assorted/ParacusiaComponent.cs @@ -43,5 +43,5 @@ public sealed partial class ParacusiaComponent : Component [DataField("timeBetweenIncidents", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan NextIncidentTime; - public EntityUid? Stream; + public IPlayingAudioStream? Stream; } diff --git a/Content.Shared/Vehicle/Components/VehicleComponent.cs b/Content.Shared/Vehicle/Components/VehicleComponent.cs index a4a4d89a25..509581cc32 100644 --- a/Content.Shared/Vehicle/Components/VehicleComponent.cs +++ b/Content.Shared/Vehicle/Components/VehicleComponent.cs @@ -45,7 +45,7 @@ public sealed partial class VehicleComponent : Component }; [ViewVariables] - public EntityUid? HonkPlayingStream; + public IPlayingAudioStream? HonkPlayingStream; /// Use ambient sound component for the idle sound. diff --git a/Content.Shared/Vehicle/SharedVehicleSystem.cs b/Content.Shared/Vehicle/SharedVehicleSystem.cs index 475675f22e..c211ec57f0 100644 --- a/Content.Shared/Vehicle/SharedVehicleSystem.cs +++ b/Content.Shared/Vehicle/SharedVehicleSystem.cs @@ -12,8 +12,6 @@ using Content.Shared.Movement.Systems; using Content.Shared.Popups; using Content.Shared.Tag; using Content.Shared.Vehicle.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Network; using Robust.Shared.Physics.Systems; @@ -176,7 +174,8 @@ public abstract partial class SharedVehicleSystem : EntitySystem // TODO: Need audio refactor maybe, just some way to null it when the stream is over. // For now better to just not loop to keep the code much cleaner. - vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid)?.Entity; + vehicle.HonkPlayingStream?.Stop(); + vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid); args.Handled = true; } diff --git a/Content.Shared/VendingMachines/SharedVendingMachineSystem.cs b/Content.Shared/VendingMachines/SharedVendingMachineSystem.cs index 50803e8ee2..522138eb8b 100644 --- a/Content.Shared/VendingMachines/SharedVendingMachineSystem.cs +++ b/Content.Shared/VendingMachines/SharedVendingMachineSystem.cs @@ -4,8 +4,6 @@ using System.Linq; using Content.Shared.DoAfter; using Content.Shared.Interaction; using Content.Shared.Popups; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; namespace Content.Shared.VendingMachines; diff --git a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs index 3a6afce363..119b10218d 100644 --- a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs +++ b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs @@ -1,8 +1,6 @@ using Content.Shared.Damage; using Content.Shared.Projectiles; using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Physics.Events; using Robust.Shared.Timing; diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index 5eac283ef1..62af6067d0 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -20,7 +20,6 @@ using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; using Content.Shared.Weapons.Ranged.Systems; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Systems; diff --git a/Content.Shared/Weapons/Misc/BaseForceGunComponent.cs b/Content.Shared/Weapons/Misc/BaseForceGunComponent.cs index 9ee705061a..61c84f7d3d 100644 --- a/Content.Shared/Weapons/Misc/BaseForceGunComponent.cs +++ b/Content.Shared/Weapons/Misc/BaseForceGunComponent.cs @@ -52,5 +52,5 @@ public abstract partial class BaseForceGunComponent : Component Params = AudioParams.Default.WithLoop(true).WithVolume(-8f), }; - public EntityUid? Stream; + public IPlayingAudioStream? Stream; } diff --git a/Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs b/Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs index 3aa82c411c..7713c98955 100644 --- a/Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs @@ -9,8 +9,6 @@ using Content.Shared.Projectiles; using Content.Shared.Timing; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Systems; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; @@ -63,13 +61,13 @@ public abstract class SharedGrapplingGunSystem : EntitySystem // At least show the visuals. component.Projectile = shotUid.Value; - Dirty(uid, component); + Dirty(component); var visuals = EnsureComp(shotUid.Value); visuals.Sprite = new SpriteSpecifier.Rsi(new ResPath("Objects/Weapons/Guns/Launchers/grappling_gun.rsi"), "rope"); visuals.OffsetA = new Vector2(0f, 0.5f); visuals.Target = uid; - Dirty(shotUid.Value, visuals); + Dirty(visuals); } TryComp(uid, out var appearance); @@ -135,7 +133,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem } component.Projectile = null; - Dirty(uid, component); + Dirty(component); } } @@ -147,18 +145,19 @@ public abstract class SharedGrapplingGunSystem : EntitySystem if (value) { if (Timing.IsFirstTimePredicted) - component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user)?.Entity; + component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user); } else { if (Timing.IsFirstTimePredicted) { - component.Stream = _audio.Stop(component.Stream); + component.Stream?.Stop(); + component.Stream = null; } } component.Reeling = value; - Dirty(uid, component); + Dirty(component); } public override void Update(float frameTime) @@ -174,7 +173,8 @@ public abstract class SharedGrapplingGunSystem : EntitySystem if (Timing.IsFirstTimePredicted) { // Just in case. - grappling.Stream = _audio.Stop(grappling.Stream); + grappling.Stream?.Stop(); + grappling.Stream = null; } continue; @@ -200,7 +200,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem _physics.WakeBody(jointComp.Relay.Value); } - Dirty(uid, jointComp); + Dirty(jointComp); if (distance.MaxLength.Equals(distance.MinLength)) { @@ -221,7 +221,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem joint.MinLength = 0.35f; // Setting velocity directly for mob movement fucks this so need to make them aware of it. // joint.Breakpoint = 4000f; - Dirty(uid, jointComp); + Dirty(jointComp); } [Serializable, NetSerializable] diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index 177cb310d1..984ae832fb 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -7,8 +7,6 @@ using Content.Shared.Mobs.Systems; using Content.Shared.Movement.Events; using Content.Shared.Throwing; using Content.Shared.Toggleable; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Network; @@ -234,10 +232,10 @@ public abstract partial class SharedTetherGunSystem : EntitySystem // Sad... if (_netManager.IsServer && component.Stream == null) - component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null)?.Entity; + component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null); - Dirty(target, tethered); - Dirty(gunUid, component); + Dirty(tethered); + Dirty(component); } protected virtual void StopTether(EntityUid gunUid, BaseForceGunComponent component, bool land = true, bool transfer = false) @@ -271,7 +269,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem if (!transfer) { - _audio.Stop(component.Stream); + component.Stream?.Stop(); component.Stream = null; } diff --git a/Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs b/Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs index 3ca52b2878..51f3e835b7 100644 --- a/Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs @@ -24,5 +24,5 @@ public sealed partial class GrapplingGunComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("cycleSound"), AutoNetworkedField] public SoundSpecifier? CycleSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/kinetic_reload.ogg"); - public EntityUid? Stream; + public IPlayingAudioStream? Stream; } diff --git a/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs b/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs index 536f3da811..ded4ce34a2 100644 --- a/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs @@ -1,7 +1,5 @@ using Content.Shared.Examine; using Content.Shared.Weapons.Ranged.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Timing; diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 06667857b3..6f764bb9f4 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -20,7 +20,6 @@ using Content.Shared.Weapons.Melee.Events; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Network; diff --git a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs index 4986f9a341..ffa8180e1a 100644 --- a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs +++ b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs @@ -10,8 +10,6 @@ using Content.Shared.Popups; using Content.Shared.Projectiles; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; diff --git a/Content.Shared/Weather/SharedWeatherSystem.cs b/Content.Shared/Weather/SharedWeatherSystem.cs index d34893f8aa..c7040515c8 100644 --- a/Content.Shared/Weather/SharedWeatherSystem.cs +++ b/Content.Shared/Weather/SharedWeatherSystem.cs @@ -1,6 +1,4 @@ using Content.Shared.Maps; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; @@ -17,11 +15,13 @@ public abstract class SharedWeatherSystem : EntitySystem [Dependency] protected readonly IPrototypeManager ProtoMan = default!; [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; [Dependency] private readonly MetaDataSystem _metadata = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; + + protected ISawmill Sawmill = default!; public override void Initialize() { base.Initialize(); + Sawmill = Logger.GetSawmill("weather"); SubscribeLocalEvent(OnWeatherUnpaused); } @@ -123,7 +123,7 @@ public abstract class SharedWeatherSystem : EntitySystem // Admin messed up or the likes. if (!ProtoMan.TryIndex(proto, out var weatherProto)) { - Log.Error($"Unable to find weather prototype for {comp.Weather}, ending!"); + Sawmill.Error($"Unable to find weather prototype for {comp.Weather}, ending!"); EndWeather(uid, comp, proto); continue; } @@ -156,8 +156,7 @@ public abstract class SharedWeatherSystem : EntitySystem /// public void SetWeather(MapId mapId, WeatherPrototype? proto, TimeSpan? endTime) { - var mapUid = MapManager.GetMapEntityId(mapId); - var weatherComp = EnsureComp(mapUid); + var weatherComp = EnsureComp(MapManager.GetMapEntityId(mapId)); foreach (var (eProto, weather) in weatherComp.Weather) { @@ -169,7 +168,7 @@ public abstract class SharedWeatherSystem : EntitySystem if (weather.State == WeatherState.Ending) weather.State = WeatherState.Running; - Dirty(mapUid, weatherComp); + Dirty(weatherComp); continue; } @@ -179,7 +178,7 @@ public abstract class SharedWeatherSystem : EntitySystem if (weather.EndTime == null || weather.EndTime > end) { weather.EndTime = end; - Dirty(mapUid, weatherComp); + Dirty(weatherComp); } } @@ -212,10 +211,10 @@ public abstract class SharedWeatherSystem : EntitySystem if (!component.Weather.TryGetValue(proto, out var data)) return; - _audio.Stop(data.Stream); + data.Stream?.Stop(); data.Stream = null; component.Weather.Remove(proto); - Dirty(uid, component); + Dirty(component); } protected virtual bool SetState(WeatherState state, WeatherComponent component, WeatherData weather, WeatherPrototype weatherProto) diff --git a/Content.Shared/Weather/WeatherComponent.cs b/Content.Shared/Weather/WeatherComponent.cs index bdc7bfdbf9..6166ea0c64 100644 --- a/Content.Shared/Weather/WeatherComponent.cs +++ b/Content.Shared/Weather/WeatherComponent.cs @@ -24,7 +24,7 @@ public sealed partial class WeatherData { // Client audio stream. [NonSerialized] - public EntityUid? Stream; + public IPlayingAudioStream? Stream; /// /// When the weather started if relevant. diff --git a/Content.Shared/Wieldable/WieldableSystem.cs b/Content.Shared/Wieldable/WieldableSystem.cs index 399d9b5168..ba87d54aa2 100644 --- a/Content.Shared/Wieldable/WieldableSystem.cs +++ b/Content.Shared/Wieldable/WieldableSystem.cs @@ -12,8 +12,6 @@ using Content.Shared.Weapons.Melee.Components; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Systems; using Content.Shared.Wieldable.Components; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Content.Shared.Timing; diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index 7922a27f80..1b601c9f95 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -533,13 +533,13 @@ path: /Audio/Machines/Nuke/nuke_alarm.ogg params: volume: -5 - maxDistance: 10 + maxdistance: 10 - type: EmitSoundOnActivate sound: path: /Audio/Machines/Nuke/nuke_alarm.ogg params: volume: -5 - maxDistance: 10 + maxdistance: 10 - type: entity parent: BasePlushie diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index a8c3703d78..132d6b7aff 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -580,7 +580,7 @@ path: /Audio/Items/Stamp/thick_stamp_sub.ogg params: volume: -2 - maxDistance: 5 + maxdistance: 5 - type: Sprite sprite: Objects/Misc/bureaucracy.rsi state: stamp-mime @@ -600,7 +600,7 @@ path: /Audio/Items/Stamp/automatic_stamp.ogg params: volume: -2 - maxDistance: 5 + maxdistance: 5 - type: entity name: captain's rubber stamp diff --git a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml index 69a81f9f46..e78d8dd150 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml @@ -50,7 +50,7 @@ beepSound: path: "/Audio/Items/locator_beep.ogg" params: - maxDistance: 1 + maxdistance: 1 volume: -8 - type: entity @@ -103,4 +103,4 @@ - type: ItemSlots slots: cell_slot: - name: power-cell-slot-component-slot-name-default + name: power-cell-slot-component-slot-name-default \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml b/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml index 33186f0a1d..d574b286c4 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml @@ -9,7 +9,7 @@ path: /Audio/Machines/microwave_loop.ogg params: loop: true - maxDistance: 5 + maxdistance: 5 - type: Sprite sprite: Structures/Machines/fat_sucker.rsi snapCardinals: true diff --git a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml index 699c3491f1..b7886b7ca5 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml @@ -81,7 +81,7 @@ path: /Audio/Ambience/Objects/crushing.ogg params: volume: 5 - maxDistance: 5 + maxdistance: 5 loop: true - type: MaterialStorage insertOnInteract: false diff --git a/Resources/Prototypes/Voice/speech_emote_sounds.yml b/Resources/Prototypes/Voice/speech_emote_sounds.yml index e37f9c24c9..3cbb0665b8 100644 --- a/Resources/Prototypes/Voice/speech_emote_sounds.yml +++ b/Resources/Prototypes/Voice/speech_emote_sounds.yml @@ -218,7 +218,7 @@ collection: Whistles params: variation: 0.125 - pitch: 0.75 + pitchscale: 0.75 - type: emoteSounds id: FemaleDwarf @@ -253,7 +253,7 @@ collection: Whistles params: variation: 0.125 - pitch: 0.75 + pitchscale: 0.75 - type: emoteSounds id: UnisexMoth diff --git a/RobustToolbox b/RobustToolbox index 9b04270178..f5874ea402 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 9b04270178714e0ee26481a1a60c5674ea81c2c0 +Subproject commit f5874ea402430bb902a5d5d1f47953679d79d781