diff --git a/Content.Client/Backmen/Body/BodySystem.cs b/Content.Client/Backmen/Body/BodySystem.cs index bee569c1011..10dc057a8fd 100644 --- a/Content.Client/Backmen/Body/BodySystem.cs +++ b/Content.Client/Backmen/Body/BodySystem.cs @@ -22,9 +22,7 @@ private void ApplyMarkingToPart(MarkingPrototype markingPrototype, var markingSprite = markingPrototype.Sprites[j]; if (markingSprite is not SpriteSpecifier.Rsi rsi) - { continue; - } var layerId = $"{markingPrototype.ID}-{rsi.RsiState}"; @@ -38,21 +36,14 @@ private void ApplyMarkingToPart(MarkingPrototype markingPrototype, sprite.LayerSetVisible(layerId, visible); if (!visible) - { continue; - } // Okay so if the marking prototype is modified but we load old marking data this may no longer be valid - // and we need to check the index is correct. - // So if that happens just default to white? + // and we need to check the index is correct. So if that happens just default to white? if (colors != null && j < colors.Count) - { sprite.LayerSetColor(layerId, colors[j]); - } else - { sprite.LayerSetColor(layerId, Color.White); - } } } @@ -65,7 +56,6 @@ protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceCo sprite.Color = component.Color.Value; foreach (var (visualLayer, markingList) in component.Markings) - { foreach (var marking in markingList) { if (!_markingManager.TryGetMarking(marking, out var markingPrototype)) @@ -73,10 +63,9 @@ protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceCo ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite); } - } } - protected override void RemovePartMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance) + protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance) { return; } diff --git a/Content.Client/Backmen/Surgery/SurgeryBui.cs b/Content.Client/Backmen/Surgery/SurgeryBui.cs index 31389d31f13..6e396d40cc3 100644 --- a/Content.Client/Backmen/Surgery/SurgeryBui.cs +++ b/Content.Client/Backmen/Surgery/SurgeryBui.cs @@ -3,16 +3,11 @@ using Content.Shared.Backmen.Surgery; using Content.Shared.Body.Components; using Content.Shared.Body.Part; -using Content.Client.Hands.Systems; using JetBrains.Annotations; using Robust.Client.GameObjects; using Robust.Client.Player; using Robust.Shared.Prototypes; using Robust.Shared.Utility; -using Robust.Shared.Timing; -using Robust.Client.Timing; -using static Robust.Client.UserInterface.Control; -using OpenToolkit.GraphicsLibraryFramework; namespace Content.Client.Backmen.Surgery; @@ -22,37 +17,30 @@ public sealed class SurgeryBui : BoundUserInterface [Dependency] private readonly IEntityManager _entities = default!; [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IClientGameTiming _gameTiming = default!; - [Dependency] private readonly IGameTiming _timing = default!; - private readonly SurgerySystem _system; [ViewVariables] private SurgeryWindow? _window; - private EntityUid? _part; - private bool _isBody = false; + private bool _isBody; private (EntityUid Ent, EntProtoId Proto)? _surgery; private readonly List _previousSurgeries = new(); - private DateTime _lastRefresh = DateTime.UtcNow; - private (string handName, EntityUid item) _throttling = ("", new EntityUid()); - public SurgeryBui(EntityUid owner, Enum uiKey) : base(owner, uiKey) - { - _system = _entities.System(); - } + public SurgeryBui(EntityUid owner, Enum uiKey) : base(owner, uiKey) => _system = _entities.System(); protected override void ReceiveMessage(BoundUserInterfaceMessage message) { - if (_window == null) + if (_window is null + || message is not SurgeryBuiRefreshMessage) return; - if (message is SurgeryBuiRefreshMessage) - RefreshUI(); + RefreshUI(); } protected override void UpdateState(BoundUserInterfaceState state) { - if (state is SurgeryBuiState s) - Update(s); + if (state is not SurgeryBuiState s) + return; + + Update(s); } protected override void Dispose(bool disposing) @@ -64,8 +52,7 @@ protected override void Dispose(bool disposing) private void Update(SurgeryBuiState state) { - //Logger.Debug($"Attempting to update surgerybuistate with {state}, {_player.LocalEntity}, first predicted? {_timing.IsFirstTimePredicted}, surgeryTargetComp? {_entities.TryGetComponent(_player.LocalEntity, out var surgeryTargetComp2)} {surgeryTargetComp2?.CanOperate}"); - if (!_entities.TryGetComponent(_player.LocalEntity, out var surgeryTargetComp) + if (!_entities.TryGetComponent(_player.LocalEntity, out SurgeryTargetComponent? surgeryTargetComp) || !surgeryTargetComp.CanOperate) return; if (_window == null) @@ -88,32 +75,26 @@ private void Update(SurgeryBuiState state) _surgery = null; _previousSurgeries.Clear(); - if (!_entities.TryGetNetEntity(_part, out var netPart) || - State is not SurgeryBuiState s || - !s.Choices.TryGetValue(netPart.Value, out var surgeries)) - { + if (!_entities.TryGetNetEntity(_part, out var netPart) + || State is not SurgeryBuiState s + || !s.Choices.TryGetValue(netPart.Value, out var surgeries)) return; - } OnPartPressed(netPart.Value, surgeries); }; _window.StepsButton.OnPressed += _ => { - if (!_entities.TryGetNetEntity(_part, out var netPart) || - _previousSurgeries.Count == 0) - { + if (!_entities.TryGetNetEntity(_part, out var netPart) + || _previousSurgeries.Count == 0) return; - } var last = _previousSurgeries[^1]; _previousSurgeries.RemoveAt(_previousSurgeries.Count - 1); - if (_system.GetSingleton(last) is not { } previousId || - !_entities.TryGetComponent(previousId, out SurgeryComponent? previous)) - { + if (_system.GetSingleton(last) is not { } previousId + || !_entities.TryGetComponent(previousId, out SurgeryComponent? previous)) return; - } OnSurgeryPressed((previousId, previous), netPart.Value, last); }; @@ -131,7 +112,6 @@ State is not SurgeryBuiState s || var options = new List<(NetEntity netEntity, EntityUid entity, string Name, BodyPartType? PartType)>(); foreach (var choice in state.Choices.Keys) - { if (_entities.TryGetEntity(choice, out var ent)) { if (_entities.TryGetComponent(ent, out BodyPartComponent? part)) @@ -139,7 +119,6 @@ State is not SurgeryBuiState s || else if (_entities.TryGetComponent(ent, out BodyComponent? body)) options.Add((choice, ent.Value, _entities.GetComponent(ent.Value).EntityName, null)); } - } options.Sort((a, b) => { @@ -197,11 +176,10 @@ int GetScore(BodyPartType? partType) private void AddStep(EntProtoId stepId, NetEntity netPart, EntProtoId surgeryId) { - if (_window == null || - _system.GetSingleton(stepId) is not { } step) - { + if (_window == null + || _system.GetSingleton(stepId) is not { } step) return; - } + var stepName = new FormattedMessage(); stepName.AddText(_entities.GetComponent(step).EntityName); var stepButton = new SurgeryStepButton { Step = step }; @@ -242,9 +220,7 @@ private void OnSurgeryPressed(Entity surgery, NetEntity netPar _window.Steps.AddChild(new HSeparator { Margin = new Thickness(0, 0, 0, 1) }); } foreach (var stepId in surgery.Comp.Steps) - { AddStep(stepId, netPart, surgeryId); - } View(ViewType.Steps); RefreshUI(); @@ -300,11 +276,10 @@ private void RefreshUI() || !_window.IsOpen || _part == null || !_entities.HasComponent(_surgery?.Ent) - || !_entities.TryGetComponent(_player.LocalEntity ?? EntityUid.Invalid, out var surgeryComp) + || !_entities.TryGetComponent(_player.LocalEntity ?? EntityUid.Invalid, out SurgeryTargetComponent? surgeryComp) || !surgeryComp.CanOperate) - { return; - } + var next = _system.GetNextStep(Owner, _part.Value, _surgery.Value.Ent); var i = 0; foreach (var child in _window.Steps.Children) @@ -314,21 +289,13 @@ private void RefreshUI() var status = StepStatus.Incomplete; if (next == null) - { status = StepStatus.Complete; - } else if (next.Value.Surgery.Owner != _surgery.Value.Ent) - { status = StepStatus.Incomplete; - } else if (next.Value.Step == i) - { status = StepStatus.Next; - } else if (i < next.Value.Step) - { status = StepStatus.Complete; - } stepButton.Button.Disabled = status != StepStatus.Next; @@ -336,9 +303,7 @@ private void RefreshUI() stepName.AddText(_entities.GetComponent(stepButton.Step).EntityName); if (status == StepStatus.Complete) - { stepButton.Button.Modulate = Color.Green; - } else { stepButton.Button.Modulate = Color.White; @@ -372,17 +337,11 @@ private void View(ViewType type) if (_entities.TryGetComponent(_part, out MetaDataComponent? partMeta) && _entities.TryGetComponent(_surgery?.Ent, out MetaDataComponent? surgeryMeta)) - { _window.Title = $"Surgery - {partMeta.EntityName}, {surgeryMeta.EntityName}"; - } else if (partMeta != null) - { _window.Title = $"Surgery - {partMeta.EntityName}"; - } else - { _window.Title = "Surgery"; - } } private enum ViewType diff --git a/Content.Client/Backmen/Targeting/TargetingSystem.cs b/Content.Client/Backmen/Targeting/TargetingSystem.cs index 7be8c61bef8..b2791143e25 100644 --- a/Content.Client/Backmen/Targeting/TargetingSystem.cs +++ b/Content.Client/Backmen/Targeting/TargetingSystem.cs @@ -31,12 +31,20 @@ public override void Initialize() InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.Torso))) .Bind(ContentKeyFunctions.TargetLeftArm, InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftArm))) +/* .Bind(ContentKeyFunctions.TargetLeftHand, + InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftHand))) SOON :TM: */ .Bind(ContentKeyFunctions.TargetRightArm, InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightArm))) +/* .Bind(ContentKeyFunctions.TargetRightHand, + InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightHand)))*/ .Bind(ContentKeyFunctions.TargetLeftLeg, InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftLeg))) +/* .Bind(ContentKeyFunctions.TargetLeftFoot, + InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftFoot)))*/ .Bind(ContentKeyFunctions.TargetRightLeg, InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightLeg))) +/* .Bind(ContentKeyFunctions.TargetRightFoot, + InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightFoot)))*/ .Register(); } @@ -54,28 +62,28 @@ private void HandlePlayerDetached(EntityUid uid, TargetingComponent component, L private void OnTargetingStartup(EntityUid uid, TargetingComponent component, ComponentStartup args) { - if (_playerManager.LocalEntity == uid) - { - TargetingStartup?.Invoke(component); - PartStatusStartup?.Invoke(component); - } + if (_playerManager.LocalEntity != uid) + return; + + TargetingStartup?.Invoke(component); + PartStatusStartup?.Invoke(component); } private void OnTargetingShutdown(EntityUid uid, TargetingComponent component, ComponentShutdown args) { - if (_playerManager.LocalEntity == uid) - { - TargetingShutdown?.Invoke(); - PartStatusShutdown?.Invoke(); - } + if (_playerManager.LocalEntity != uid) + return; + + TargetingShutdown?.Invoke(); + PartStatusShutdown?.Invoke(); } private void OnTargetIntegrityChange(TargetIntegrityChangeEvent args) { if (!TryGetEntity(args.Uid, out var uid) - || !_playerManager.LocalEntity.Equals(uid) - || !TryComp(uid, out TargetingComponent? component) - || !args.RefreshUi) + || !_playerManager.LocalEntity.Equals(uid) + || !TryComp(uid, out TargetingComponent? component) + || !args.RefreshUi) return; PartStatusUpdate?.Invoke(component); diff --git a/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml b/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml index 90461b31a93..6cb13deaa66 100644 --- a/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml +++ b/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml @@ -12,26 +12,46 @@ Name="DollHead" Stretch="KeepAspectCentered" SetSize="64 64"/> + + + + + diff --git a/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml.cs b/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml.cs index 70c67865f74..f405b5ca7bc 100644 --- a/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml.cs +++ b/Content.Client/Backmen/UserInterface/Systems/PartStatus/Widgets/PartStatusControl.xaml.cs @@ -20,10 +20,15 @@ public PartStatusControl() { { TargetBodyPart.Head, DollHead }, { TargetBodyPart.Torso, DollTorso }, + { TargetBodyPart.Groin, DollGroin }, { TargetBodyPart.LeftArm, DollLeftArm }, + { TargetBodyPart.LeftHand, DollLeftHand }, { TargetBodyPart.RightArm, DollRightArm }, + { TargetBodyPart.RightHand, DollRightHand }, { TargetBodyPart.LeftLeg, DollLeftLeg }, - { TargetBodyPart.RightLeg, DollRightLeg } + { TargetBodyPart.LeftFoot, DollLeftFoot }, + { TargetBodyPart.RightLeg, DollRightLeg }, + { TargetBodyPart.RightFoot, DollRightFoot } }; } @@ -38,8 +43,6 @@ public void SetTextures(Dictionary state) } } - public void SetVisible(bool visible) - { - this.Visible = visible; - } + public void SetVisible(bool visible) => this.Visible = visible; + } diff --git a/Content.Client/Backmen/UserInterface/Systems/Targeting/TargetingUIController.cs b/Content.Client/Backmen/UserInterface/Systems/Targeting/TargetingUIController.cs index 4ccf46fb6da..1e767706a2f 100644 --- a/Content.Client/Backmen/UserInterface/Systems/Targeting/TargetingUIController.cs +++ b/Content.Client/Backmen/UserInterface/Systems/Targeting/TargetingUIController.cs @@ -32,13 +32,13 @@ public void OnSystemUnloaded(TargetingSystem system) public void OnStateEntered(GameplayState state) { - if (TargetingControl != null) - { - TargetingControl.SetVisible(_targetingComponent != null); + if (TargetingControl == null) + return; - if (_targetingComponent != null) - TargetingControl.SetColors(_targetingComponent.Target); - } + TargetingControl.SetTargetDollVisible(_targetingComponent != null); + + if (_targetingComponent != null) + TargetingControl.SetBodyPartsVisible(_targetingComponent.Target); } public void AddTargetingControl(TargetingComponent component) @@ -47,10 +47,10 @@ public void AddTargetingControl(TargetingComponent component) if (TargetingControl != null) { - TargetingControl.SetVisible(_targetingComponent != null); + TargetingControl.SetTargetDollVisible(_targetingComponent != null); if (_targetingComponent != null) - TargetingControl.SetColors(_targetingComponent.Target); + TargetingControl.SetBodyPartsVisible(_targetingComponent.Target); } } @@ -58,7 +58,7 @@ public void AddTargetingControl(TargetingComponent component) public void RemoveTargetingControl() { if (TargetingControl != null) - TargetingControl.SetVisible(false); + TargetingControl.SetTargetDollVisible(false); _targetingComponent = null; } @@ -66,8 +66,8 @@ public void RemoveTargetingControl() public void CycleTarget(TargetBodyPart bodyPart) { if (_playerManager.LocalEntity is not { } user - || _entManager.GetComponent(user) is not { } targetingComponent - || TargetingControl == null) + || _entManager.GetComponent(user) is not { } targetingComponent + || TargetingControl == null) return; var player = _entManager.GetNetEntity(user); @@ -75,9 +75,7 @@ public void CycleTarget(TargetBodyPart bodyPart) { var msg = new TargetChangeEvent(player, bodyPart); _net.SendSystemNetworkMessage(msg); - TargetingControl?.SetColors(bodyPart); + TargetingControl?.SetBodyPartsVisible(bodyPart); } } - - } diff --git a/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml b/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml index 8be5992e5db..afd36901354 100644 --- a/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml +++ b/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml @@ -4,63 +4,215 @@ xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" xmlns:widgets="clr-namespace:Content.Client.Backmen.UserInterface.Systems.Targeting.Widgets" Name="TargetingButton" + VerticalExpand="True" VerticalAlignment="Bottom" HorizontalAlignment="Right"> - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - + + - - - - - - + + + + + - - - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + diff --git a/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml.cs b/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml.cs index 19df6fc1b06..ad92cd9616d 100644 --- a/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml.cs +++ b/Content.Client/Backmen/UserInterface/Systems/Targeting/Widgets/TargetingControl.xaml.cs @@ -11,46 +11,48 @@ namespace Content.Client.Backmen.UserInterface.Systems.Targeting.Widgets; public sealed partial class TargetingControl : UIWidget { private readonly TargetingUIController _controller; - private readonly Dictionary _bodyPartControls; + private readonly Dictionary _bodyPartControls; public TargetingControl() { RobustXamlLoader.Load(this); _controller = UserInterfaceManager.GetUIController(); - _bodyPartControls = new Dictionary + _bodyPartControls = new Dictionary { - { TargetBodyPart.Head, (HeadButton, (PanelContainer)HeadButton.Children.First()) }, - { TargetBodyPart.Torso, (TorsoButton, (PanelContainer)TorsoButton.Children.First()) }, - { TargetBodyPart.LeftArm, (LeftArmButton, (PanelContainer)LeftArmButton.Children.First()) }, - { TargetBodyPart.RightArm, (RightArmButton, (PanelContainer)RightArmButton.Children.First()) }, - { TargetBodyPart.LeftLeg, (LeftLegButton, (PanelContainer)LeftLegButton.Children.First()) }, - { TargetBodyPart.RightLeg, (RightLegButton, (PanelContainer)RightLegButton.Children.First()) } + // TODO: ADD EYE AND MOUTH TARGETING + { TargetBodyPart.Head, HeadButton }, + { TargetBodyPart.Torso, ChestButton }, + { TargetBodyPart.Groin, GroinButton }, + { TargetBodyPart.LeftArm, LeftArmButton }, + { TargetBodyPart.LeftHand, LeftHandButton }, + { TargetBodyPart.RightArm, RightArmButton }, + { TargetBodyPart.RightHand, RightHandButton }, + { TargetBodyPart.LeftLeg, LeftLegButton }, + { TargetBodyPart.LeftFoot, LeftFootButton }, + { TargetBodyPart.RightLeg, RightLegButton }, + { TargetBodyPart.RightFoot, RightFootButton }, }; - foreach (var buttonPair in _bodyPartControls) + foreach (var bodyPartButton in _bodyPartControls) { - buttonPair.Value.Button.MouseFilter = MouseFilterMode.Stop; - buttonPair.Value.Button.OnPressed += args => SetActiveBodyPart(buttonPair.Key); - } - } - private void SetActiveBodyPart(TargetBodyPart bodyPart) - { - _controller.CycleTarget(bodyPart); - } + bodyPartButton.Value.MouseFilter = MouseFilterMode.Stop; + bodyPartButton.Value.OnPressed += _ => SetActiveBodyPart(bodyPartButton.Key); - public void SetColors(TargetBodyPart bodyPart) - { - foreach (var buttonPair in _bodyPartControls) - { - var styleBox = (StyleBoxFlat) buttonPair.Value.Panel.PanelOverride!; - styleBox.BackgroundColor = buttonPair.Key == bodyPart ? new Color(243, 10, 12, 51) : new Color(0, 0, 0, 0); - styleBox.BorderColor = buttonPair.Key == bodyPart ? new Color(243, 10, 12, 255) : new Color(0, 0, 0, 0); + TargetDoll.Texture = Theme.ResolveTexture("target_doll"); } } - public void SetVisible(bool visible) + private void SetActiveBodyPart(TargetBodyPart bodyPart) => _controller.CycleTarget(bodyPart); + + public void SetBodyPartsVisible(TargetBodyPart bodyPart) { - this.Visible = visible; + foreach (var bodyPartButton in _bodyPartControls) + bodyPartButton.Value.Children.First().Visible = bodyPartButton.Key == bodyPart; } + + protected override void OnThemeUpdated() => TargetDoll.Texture = Theme.ResolveTexture("target_doll"); + + public void SetTargetDollVisible(bool visible) => Visible = visible; + } diff --git a/Content.Client/Hands/Systems/HandsSystem.cs b/Content.Client/Hands/Systems/HandsSystem.cs index 07803690c21..4534baf73d2 100644 --- a/Content.Client/Hands/Systems/HandsSystem.cs +++ b/Content.Client/Hands/Systems/HandsSystem.cs @@ -52,6 +52,7 @@ public override void Initialize() SubscribeLocalEvent(HandleComponentState); SubscribeLocalEvent(OnVisualsChanged); SubscribeLocalEvent(HandleBodyPartRemoved); + SubscribeLocalEvent(HandleBodyPartDisabled); OnHandSetActive += OnHandActivated; } @@ -244,30 +245,33 @@ public void UIHandAltActivateItem(string handName) #endregion #region visuals - private void HandleBodyPartRemoved(EntityUid uid, HandsComponent component, ref BodyPartRemovedEvent args) + + private void HideLayers(EntityUid uid, HandsComponent component, Entity part, SpriteComponent? sprite = null) { - if (args.Part.Comp.PartType != BodyPartType.Hand || !TryComp(uid, out SpriteComponent? sprite)) + if (part.Comp.PartType != BodyPartType.Hand || !Resolve(uid, ref sprite, logMissing: false)) return; - var location = args.Part.Comp.Symmetry switch + var location = part.Comp.Symmetry switch { BodyPartSymmetry.None => HandLocation.Middle, BodyPartSymmetry.Left => HandLocation.Left, BodyPartSymmetry.Right => HandLocation.Right, - _ => throw new ArgumentOutOfRangeException(nameof(args.Part.Comp.Symmetry)) + _ => throw new ArgumentOutOfRangeException(nameof(part.Comp.Symmetry)) }; if (component.RevealedLayers.TryGetValue(location, out var revealedLayers)) { foreach (var key in revealedLayers) - { sprite.RemoveLayer(key); - } revealedLayers.Clear(); } } + private void HandleBodyPartRemoved(EntityUid uid, HandsComponent component, ref BodyPartRemovedEvent args) => HideLayers(uid, component, args.Part); + + private void HandleBodyPartDisabled(EntityUid uid, HandsComponent component, ref BodyPartDisabledEvent args) => HideLayers(uid, component, args.Part); + protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args) { base.HandleEntityInserted(uid, hands, args); @@ -467,4 +471,4 @@ private void OnHandActivated(Entity? ent) OnPlayerSetActiveHand?.Invoke(hand.Comp.ActiveHand.Name); } } -} \ No newline at end of file +} diff --git a/Content.Client/Inventory/ClientInventorySystem.cs b/Content.Client/Inventory/ClientInventorySystem.cs index b4d7db8eed2..5b76d5581ad 100644 --- a/Content.Client/Inventory/ClientInventorySystem.cs +++ b/Content.Client/Inventory/ClientInventorySystem.cs @@ -184,9 +184,11 @@ public void UpdateSlot(EntityUid owner, InventorySlotsComponent component, strin public void OnRefreshInventorySlots(EntityUid owner, InventorySlotsComponent component, RefreshInventorySlotsEvent args) { - if (component.SlotData.TryGetValue(args.SlotName, out var slotData) - && _playerManager.LocalEntity == owner) - OnSlotRemoved?.Invoke(slotData); + if (!component.SlotData.TryGetValue(args.SlotName, out var slotData) + || _playerManager.LocalEntity != owner) + return; + + OnSlotRemoved?.Invoke(slotData); } public bool TryAddSlotDef(EntityUid owner, InventorySlotsComponent component, SlotDefinition newSlotDef) diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index ccd36c35e82..11ed7d9db96 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -1627,6 +1627,60 @@ public StyleNano(IResourceCache resCache) : base(resCache) BackgroundColor = FancyTreeSelectedRowColor, }), + // Shitmed Edit Start + Element().Class("TargetDollButtonHead") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/head_hover.png")), + + Element().Class("TargetDollButtonChest") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/torso_hover.png")), + + Element().Class("TargetDollButtonGroin") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/groin_hover.png")), + + Element().Class("TargetDollButtonLeftArm") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/leftarm_hover.png")), + + Element().Class("TargetDollButtonLeftHand") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/lefthand_hover.png")), + + Element().Class("TargetDollButtonRightArm") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/rightarm_hover.png")), + + Element().Class("TargetDollButtonRightHand") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/righthand_hover.png")), + + Element().Class("TargetDollButtonLeftLeg") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/leftleg_hover.png")), + + Element().Class("TargetDollButtonLeftFoot") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/leftfoot_hover.png")), + + Element().Class("TargetDollButtonRightLeg") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/rightleg_hover.png")), + + Element().Class("TargetDollButtonRightFoot") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/rightfoot_hover.png")), + + Element().Class("TargetDollButtonEyes") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/eyes_hover.png")), + + Element().Class("TargetDollButtonMouth") + .Pseudo(TextureButton.StylePseudoClassHover) + .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Targeting/Doll/mouth_hover.png")), + // Shitmed Edit End + // Silicon law edit ui Element