diff --git a/Content.Client/Alerts/ClientAlertsSystem.cs b/Content.Client/Alerts/ClientAlertsSystem.cs index 9c4ebb9cd2..223bf7876a 100644 --- a/Content.Client/Alerts/ClientAlertsSystem.cs +++ b/Content.Client/Alerts/ClientAlertsSystem.cs @@ -4,7 +4,6 @@ using JetBrains.Annotations; using Robust.Client.Player; using Robust.Shared.Player; using Robust.Shared.Prototypes; -using Robust.Shared.Timing; namespace Content.Client.Alerts; @@ -13,7 +12,6 @@ public sealed class ClientAlertsSystem : AlertsSystem { public AlertOrderPrototype? AlertOrder { get; set; } - [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; diff --git a/Content.Client/Alerts/UpdateAlertSpriteEvent.cs b/Content.Client/Alerts/UpdateAlertSpriteEvent.cs new file mode 100644 index 0000000000..4f182c458c --- /dev/null +++ b/Content.Client/Alerts/UpdateAlertSpriteEvent.cs @@ -0,0 +1,21 @@ +using Content.Shared.Alert; +using Robust.Client.GameObjects; + +namespace Content.Client.Alerts; + +/// +/// Event raised on an entity with alerts in order to allow it to update visuals for the alert sprite entity. +/// +[ByRefEvent] +public record struct UpdateAlertSpriteEvent +{ + public Entity SpriteViewEnt; + + public AlertPrototype Alert; + + public UpdateAlertSpriteEvent(Entity spriteViewEnt, AlertPrototype alert) + { + SpriteViewEnt = spriteViewEnt; + Alert = alert; + } +} diff --git a/Content.Client/Audio/AmbientSoundSystem.cs b/Content.Client/Audio/AmbientSoundSystem.cs index 9d30cabb1e..0206017bae 100644 --- a/Content.Client/Audio/AmbientSoundSystem.cs +++ b/Content.Client/Audio/AmbientSoundSystem.cs @@ -50,7 +50,6 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem private static AudioParams _params = AudioParams.Default .WithVariation(0.01f) .WithLoop(true) - .WithAttenuation(Attenuation.LinearDistance) .WithMaxDistance(7f); /// diff --git a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs index 0fdcc7a86d..92c5b7a419 100644 --- a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs +++ b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs @@ -23,8 +23,8 @@ public sealed partial class ContentAudioSystem [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; - private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f); - private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f); + private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f); + private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, 0, 0, 0, false, 0f); /// /// EntityUid of lobby restart sound component. diff --git a/Content.Client/Clothing/ClientClothingSystem.cs b/Content.Client/Clothing/ClientClothingSystem.cs index fbe9d5ec5b..7e78ac7d70 100644 --- a/Content.Client/Clothing/ClientClothingSystem.cs +++ b/Content.Client/Clothing/ClientClothingSystem.cs @@ -133,7 +133,7 @@ public sealed class ClientClothingSystem : ClothingSystem else if (TryComp(uid, out SpriteComponent? sprite)) rsi = sprite.BaseRSI; - if (rsi == null || rsi.Path == null) + if (rsi == null) return false; var correctedSlot = slot; diff --git a/Content.Client/Doors/DoorSystem.cs b/Content.Client/Doors/DoorSystem.cs index 473ae97059..bc52730b0e 100644 --- a/Content.Client/Doors/DoorSystem.cs +++ b/Content.Client/Doors/DoorSystem.cs @@ -4,14 +4,12 @@ using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Client.ResourceManagement; using Robust.Shared.Serialization.TypeSerializers.Implementations; -using Robust.Shared.Timing; namespace Content.Client.Doors; public sealed class DoorSystem : SharedDoorSystem { [Dependency] private readonly AnimationPlayerSystem _animationSystem = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; public override void Initialize() diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index 085a0a35f4..bbef67181b 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -108,7 +108,6 @@ namespace Content.Client.Entry _prototypeManager.RegisterIgnore("gameMap"); _prototypeManager.RegisterIgnore("gameMapPool"); _prototypeManager.RegisterIgnore("lobbyBackground"); - _prototypeManager.RegisterIgnore("advertisementsPack"); _prototypeManager.RegisterIgnore("gamePreset"); _prototypeManager.RegisterIgnore("noiseChannel"); _prototypeManager.RegisterIgnore("spaceBiome"); diff --git a/Content.Client/IconSmoothing/IconSmoothSystem.cs b/Content.Client/IconSmoothing/IconSmoothSystem.cs index 20a80c42a3..4b02560846 100644 --- a/Content.Client/IconSmoothing/IconSmoothSystem.cs +++ b/Content.Client/IconSmoothing/IconSmoothSystem.cs @@ -16,8 +16,6 @@ namespace Content.Client.IconSmoothing [UsedImplicitly] public sealed partial class IconSmoothSystem : EntitySystem { - [Dependency] private readonly IMapManager _mapManager = default!; - private readonly Queue _dirtyEntities = new(); private readonly Queue _anchorChangedEntities = new(); diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 03f4f3f38b..589de6d6a7 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -32,6 +32,7 @@ namespace Content.Client.Input common.AddFunction(ContentKeyFunctions.ToggleFullscreen); common.AddFunction(ContentKeyFunctions.MoveStoredItem); common.AddFunction(ContentKeyFunctions.RotateStoredItem); + common.AddFunction(ContentKeyFunctions.SaveItemLocation); common.AddFunction(ContentKeyFunctions.Point); common.AddFunction(ContentKeyFunctions.ZoomOut); common.AddFunction(ContentKeyFunctions.ZoomIn); diff --git a/Content.Client/Items/Systems/ItemSystem.cs b/Content.Client/Items/Systems/ItemSystem.cs index e406ba2b55..5e60d06d0c 100644 --- a/Content.Client/Items/Systems/ItemSystem.cs +++ b/Content.Client/Items/Systems/ItemSystem.cs @@ -93,7 +93,7 @@ public sealed class ItemSystem : SharedItemSystem else if (TryComp(uid, out SpriteComponent? sprite)) rsi = sprite.BaseRSI; - if (rsi == null || rsi.Path == null) + if (rsi == null) return false; var state = (item.HeldPrefix == null) diff --git a/Content.Client/Kitchen/UI/GrinderMenu.xaml b/Content.Client/Kitchen/UI/GrinderMenu.xaml index b83128d004..dacddd0df6 100644 --- a/Content.Client/Kitchen/UI/GrinderMenu.xaml +++ b/Content.Client/Kitchen/UI/GrinderMenu.xaml @@ -3,10 +3,12 @@ xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" Title="{Loc grinder-menu-title}" MinSize="768 256"> - - public void SetSeverity(short? severity) { - if (_severity != severity) - { - _severity = severity; - _icon.SetFromSpriteSpecifier(Alert.GetIcon(_severity)); - } + if (_severity == severity) + return; + _severity = severity; + + if (!_entityManager.TryGetComponent(_spriteViewEntity, out var sprite)) + return; + var icon = Alert.GetIcon(_severity); + if (sprite.LayerMapTryGet(AlertVisualLayers.Base, out var layer)) + sprite.LayerSetSprite(layer, icon); } protected override void FrameUpdate(FrameEventArgs args) { base.FrameUpdate(args); + UserInterfaceManager.GetUIController().UpdateAlertSpriteEntity(_spriteViewEntity, Alert); + if (!Cooldown.HasValue) { _cooldownGraphic.Visible = false; @@ -91,5 +113,17 @@ namespace Content.Client.UserInterface.Systems.Alerts.Controls _cooldownGraphic.FromTime(Cooldown.Value.Start, Cooldown.Value.End); } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + _entityManager.DeleteEntity(_spriteViewEntity); + } + } + + public enum AlertVisualLayers : byte + { + Base } } diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/StorageContainer.cs b/Content.Client/UserInterface/Systems/Storage/Controls/StorageContainer.cs index bd952fe957..e39ac5d322 100644 --- a/Content.Client/UserInterface/Systems/Storage/Controls/StorageContainer.cs +++ b/Content.Client/UserInterface/Systems/Storage/Controls/StorageContainer.cs @@ -12,6 +12,7 @@ using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.Timing; +using Robust.Shared.Utility; namespace Content.Client.UserInterface.Systems.Storage.Controls; @@ -355,6 +356,40 @@ public sealed class StorageContainer : BaseWindow origin, currentLocation.Rotation); + foreach (var locations in storageComponent.SavedLocations) + { + if (!_entity.TryGetComponent(currentEnt, out var meta) || meta.EntityName != locations.Key) + continue; + + float spot = 0; + var marked = new List(); + + foreach (var location in locations.Value) + { + var shape = itemSystem.GetAdjustedItemShape(currentEnt, location); + var bound = shape.GetBoundingBox(); + + var spotFree = storageSystem.ItemFitsInGridLocation(currentEnt, StorageEntity.Value, location); + + if (spotFree) + spot++; + + for (var y = bound.Bottom; y <= bound.Top; y++) + { + for (var x = bound.Left; x <= bound.Right; x++) + { + if (TryGetBackgroundCell(x, y, out var cell) && shape.Contains(x, y) && !marked.Contains(cell)) + { + marked.Add(cell); + cell.ModulateSelfOverride = spotFree + ? Color.FromHsv((0.18f, 1 / spot, 0.5f / spot + 0.5f, 1f)) + : Color.FromHex("#2222CC"); + } + } + } + } + } + var validColor = usingInHand ? Color.Goldenrod : Color.FromHex("#1E8000"); for (var y = itemBounding.Bottom; y <= itemBounding.Top; y++) diff --git a/Content.Client/UserInterface/Systems/Storage/StorageUIController.cs b/Content.Client/UserInterface/Systems/Storage/StorageUIController.cs index 5f3ae3a2da..b865b54dd0 100644 --- a/Content.Client/UserInterface/Systems/Storage/StorageUIController.cs +++ b/Content.Client/UserInterface/Systems/Storage/StorageUIController.cs @@ -240,6 +240,16 @@ public sealed class StorageUIController : UIController, IOnSystemChanged().DoExamine(control.Entity); diff --git a/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs b/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs index 74593b6670..715bc48bb3 100644 --- a/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs +++ b/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs @@ -1,10 +1,13 @@ using Content.Shared.VoiceMask; using Robust.Client.GameObjects; +using Robust.Shared.Prototypes; namespace Content.Client.VoiceMask; public sealed class VoiceMaskBoundUserInterface : BoundUserInterface { + [Dependency] private readonly IPrototypeManager _proto = default!; + [ViewVariables] private VoiceMaskNameChangeWindow? _window; @@ -16,11 +19,12 @@ public sealed class VoiceMaskBoundUserInterface : BoundUserInterface { base.Open(); - _window = new(); + _window = new(_proto); _window.OpenCentered(); _window.OnNameChange += OnNameSelected; - _window.OnVoiceChange += (value) => SendMessage(new VoiceMaskChangeVoiceMessage(value)); // Corvax-TTS + _window.OnVerbChange += verb => SendMessage(new VoiceMaskChangeVerbMessage(verb)); + _window.OnVoiceChange += voice => SendMessage(new VoiceMaskChangeVoiceMessage(voice)); // Corvax-TTS _window.OnClose += Close; } @@ -36,7 +40,7 @@ public sealed class VoiceMaskBoundUserInterface : BoundUserInterface return; } - _window.UpdateState(cast.Name, cast.Voice); // Corvax-TTS + _window.UpdateState(cast.Name, cast.Voice, cast.Verb); // Corvax-TTS } protected override void Dispose(bool disposing) diff --git a/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml b/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml index 0a4af81fd6..c51834b596 100644 --- a/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml +++ b/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml @@ -1,17 +1,22 @@ - - + MinSize="5 30"> +