diff --git a/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs b/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs index efb1a8d46e8..ebdd3c650ae 100644 --- a/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs +++ b/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs @@ -1,6 +1,6 @@ +using Content.Shared._White.Body.Components; using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Effects; -using Content.Shared.Body.Components; using Robust.Client.GameObjects; namespace Content.Client.Anomaly.Effects; @@ -25,8 +25,7 @@ private void OnAfterHandleState(Entity ent, ref After index = sprite.LayerMapReserveBlank(ent.Comp.LayerMap); if (TryComp(ent, out var body) && - body.Prototype is not null && - ent.Comp.SpeciesSprites.TryGetValue(body.Prototype.Value, out var speciesSprite)) + ent.Comp.SpeciesSprites.TryGetValue(body.Prototype, out var speciesSprite)) // WD EDIT { sprite.LayerSetSprite(index, speciesSprite); } diff --git a/Content.Client/Body/Systems/BodySystem.cs b/Content.Client/Body/Systems/BodySystem.cs deleted file mode 100644 index 3198ce664c9..00000000000 --- a/Content.Client/Body/Systems/BodySystem.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Content.Shared.Body.Systems; -// Shitmed Change Start -using Content.Shared._Shitmed.Body.Part; -using Content.Shared.Humanoid; -using Content.Shared.Humanoid.Markings; -using Robust.Client.GameObjects; -using Robust.Shared.Utility; -using Content.Shared.Body.Components; -// Shitmed Change End - -namespace Content.Client.Body.Systems; - -public sealed class BodySystem : SharedBodySystem -{ - // Shitmed Change Start - [Dependency] private readonly MarkingManager _markingManager = default!; - - private void ApplyMarkingToPart(MarkingPrototype markingPrototype, - IReadOnlyList? colors, - bool visible, - SpriteComponent sprite) - { - for (var j = 0; j < markingPrototype.Sprites.Count; j++) - { - var markingSprite = markingPrototype.Sprites[j]; - - if (markingSprite is not SpriteSpecifier.Rsi rsi) - continue; - - var layerId = $"{markingPrototype.ID}-{rsi.RsiState}"; - - if (!sprite.LayerMapTryGet(layerId, out _)) - { - var layer = sprite.AddLayer(markingSprite, j + 1); - sprite.LayerMapSet(layerId, layer); - sprite.LayerSetSprite(layerId, rsi); - } - - 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? - if (colors != null && j < colors.Count) - sprite.LayerSetColor(layerId, colors[j]); - else - sprite.LayerSetColor(layerId, Color.White); - - var shaders = markingPrototype.Shaders; - if (shaders is not null && shaders.ContainsKey(rsi.RsiState)) - sprite.LayerSetShader(layerId, shaders[rsi.RsiState]); - } - } - - protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceComponent component) - { - if (!TryComp(target, out SpriteComponent? sprite)) - return; - - if (component.Color != null) - sprite.Color = component.Color.Value; - - foreach (var (visualLayer, markingList) in component.Markings) - foreach (var marking in markingList) - { - if (!_markingManager.TryGetMarking(marking, out var markingPrototype)) - continue; - - ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite); - } - } - - protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance) - { - return; - } - // Shitmed Change End -} diff --git a/Content.Client/CardboardBox/CardboardBoxSystem.cs b/Content.Client/CardboardBox/CardboardBoxSystem.cs index 925013db109..d52a7966d8a 100644 --- a/Content.Client/CardboardBox/CardboardBoxSystem.cs +++ b/Content.Client/CardboardBox/CardboardBoxSystem.cs @@ -1,5 +1,5 @@ using System.Numerics; -using Content.Shared.Body.Components; +using Content.Shared._White.Body.Components; using Content.Shared.CardboardBox; using Content.Shared.CardboardBox.Components; using Content.Shared.Examine; diff --git a/Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs b/Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs index 0d34d4b0cc5..8baca8aa1be 100644 --- a/Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs +++ b/Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs @@ -1,7 +1,7 @@ using System.Linq; +using Content.Shared._White.Body.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Atmos.Prototypes; -using Content.Shared.Body.Part; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components.SolutionManager; diff --git a/Content.Client/Commands/HideMechanismsCommand.cs b/Content.Client/Commands/HideMechanismsCommand.cs index 97d792628a6..84947adbd1c 100644 --- a/Content.Client/Commands/HideMechanismsCommand.cs +++ b/Content.Client/Commands/HideMechanismsCommand.cs @@ -1,4 +1,4 @@ -using Content.Shared.Body.Organ; +using Content.Shared._White.Body.Components; using Robust.Client.GameObjects; using Robust.Shared.Console; using Robust.Shared.Containers; diff --git a/Content.Client/Commands/ShowMechanismsCommand.cs b/Content.Client/Commands/ShowMechanismsCommand.cs index 4e3bb17cb6e..9bfa74a7537 100644 --- a/Content.Client/Commands/ShowMechanismsCommand.cs +++ b/Content.Client/Commands/ShowMechanismsCommand.cs @@ -1,4 +1,4 @@ -using Content.Shared.Body.Organ; +using Content.Shared._White.Body.Components; using Robust.Client.GameObjects; using Robust.Shared.Console; diff --git a/Content.Client/Guidebook/Controls/GuideReagentEmbed.xaml.cs b/Content.Client/Guidebook/Controls/GuideReagentEmbed.xaml.cs index d8a6f54e81f..e12b98623d3 100644 --- a/Content.Client/Guidebook/Controls/GuideReagentEmbed.xaml.cs +++ b/Content.Client/Guidebook/Controls/GuideReagentEmbed.xaml.cs @@ -4,9 +4,9 @@ using Content.Client.Guidebook.Richtext; using Content.Client.Message; using Content.Client.UserInterface.ControlExtensions; -using Content.Shared.Body.Prototypes; using Content.Shared.Chemistry.Reaction; using Content.Shared.Chemistry.Reagent; +using Content.Shared.Localizations; using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Graphics; @@ -119,17 +119,25 @@ private void GenerateControl(ReagentPrototype reagent) #region Effects if (_chemistryGuideData.ReagentGuideRegistry.TryGetValue(reagent.ID, out var guideEntryRegistry) && guideEntryRegistry.GuideEntries != null && - guideEntryRegistry.GuideEntries.Values.Any(pair => pair.EffectDescriptions.Any())) + guideEntryRegistry.GuideEntries.Values.Any(pair => pair.EffectDescriptions.Any() || pair.Metabolites?.Any() == true)) // WD EDI { EffectsDescriptionContainer.Children.Clear(); - foreach (var (group, effect) in guideEntryRegistry.GuideEntries) + foreach (var (stage, effect) in guideEntryRegistry.GuideEntries) // WD EDIT { - if (!effect.EffectDescriptions.Any()) + // WD EDIT START + var hasMetabolites = effect.Metabolites.Any(); + if (!effect.EffectDescriptions.Any() && !hasMetabolites) + // WD EDIT END continue; var groupLabel = new RichTextLabel(); - groupLabel.SetMarkup(Loc.GetString("guidebook-reagent-effects-metabolism-group-rate", - ("group", _prototype.Index(group).LocalizedName), ("rate", effect.MetabolismRate))); + // WD EDIT START + groupLabel.SetMarkup( + Loc.GetString( + "guidebook-reagent-effects-metabolism-stage-rate", + ("group", _prototype.Index(stage).LocalizedName), + ("stage", effect.MetabolismRate))); + // WD EDIT END var descriptionLabel = new RichTextLabel { Margin = new Thickness(25, 0, 10, 0) @@ -142,9 +150,24 @@ private void GenerateControl(ReagentPrototype reagent) { descMsg.AddMarkupOrThrow(effectString); i++; - if (i < descriptionsCount) + if (i < descriptionsCount || hasMetabolites) // WD EDIT descMsg.PushNewline(); } + + // WD EDIT START + if (hasMetabolites) + { + var metabolites = new List(); + foreach (var (metabolite, ratio) in effect.Metabolites) + { + metabolites.Add(Loc.GetString("guidebook-reagent-effects-metabolite-item", ("rate", (double)ratio), ("reagent", _prototype.Index(metabolite).LocalizedName))); + } + metabolites.Sort(); + + descMsg.AddMarkupOrThrow(Loc.GetString("guidebook-reagent-effects-metabolites", ("items", ContentLocalizationManager.FormatList(metabolites)))); + } + // WD EDIT END + descriptionLabel.SetMessage(descMsg); EffectsDescriptionContainer.AddChild(groupLabel); diff --git a/Content.Client/Hands/Systems/HandsSystem.cs b/Content.Client/Hands/Systems/HandsSystem.cs index c0091ed5b4a..287ce88d586 100644 --- a/Content.Client/Hands/Systems/HandsSystem.cs +++ b/Content.Client/Hands/Systems/HandsSystem.cs @@ -5,10 +5,8 @@ using Content.Client.Examine; using Content.Client.Strip; using Content.Client.Verbs.UI; -using Content.Shared._Shitmed.Body.Events; using Content.Shared._White.Hands; -using Content.Shared._White.Hands.Components; // Shitmed Change -using Content.Shared.Body.Part; // Shitmed Change +using Content.Shared._White.Hands.Components; using Content.Shared.Hands; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; @@ -58,8 +56,6 @@ public override void Initialize() SubscribeLocalEvent(OnHandsShutdown); SubscribeLocalEvent(HandleComponentState); SubscribeLocalEvent(OnVisualsChanged); - SubscribeLocalEvent(HandleBodyPartRemoved); // Shitmed Change - SubscribeLocalEvent(HandleBodyPartDisabled); // Shitmed Change SubscribeLocalEvent(HoldingDropComponentInit); // WWDP SubscribeLocalEvent(HoldingDropComponentShutdown); // WWDP @@ -287,34 +283,6 @@ public void UIHandAltActivateItem(string handName) #region visuals - // Shitmed Change Start - private void HideLayers(EntityUid uid, HandsComponent component, Entity part, SpriteComponent? sprite = null) - { - if (part.Comp.PartType != BodyPartType.Hand || !Resolve(uid, ref sprite, logMissing: false)) - return; - - var location = part.Comp.Symmetry switch - { - BodyPartSymmetry.None => HandLocation.Middle, - BodyPartSymmetry.Left => HandLocation.Left, - BodyPartSymmetry.Right => HandLocation.Right, - _ => 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); - - // Shitmed Change End protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args) { base.HandleEntityInserted(uid, hands, args); diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs index 3261a109e73..baea03c8923 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs @@ -1,5 +1,4 @@ using Content.Shared.MedicalScanner; -using Content.Shared._Shitmed.Targeting; // Shitmed Change using JetBrains.Annotations; using Robust.Client.UserInterface; @@ -20,11 +19,10 @@ protected override void Open() base.Open(); _window = this.CreateWindow(); - _window.OnBodyPartSelected += SendBodyPartMessage; // Shitmed Change + _window.Title = EntMan.GetComponent(Owner).EntityName; } - protected override void ReceiveMessage(BoundUserInterfaceMessage message) { if (_window == null) @@ -35,21 +33,5 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message) _window.Populate(cast); } - - // Shitmed Change Start - private void SendBodyPartMessage(TargetBodyPart? part, EntityUid target) => SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part ?? null)); - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - if (!disposing) - return; - - if (_window != null) - _window.OnBodyPartSelected -= SendBodyPartMessage; - - _window?.Dispose(); - } - - // Shitmed Change End } } diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml index 95229dc40ea..97968c4b990 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml @@ -2,7 +2,7 @@ xmlns="https://spacestation14.io" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" MaxHeight="525" - MinWidth="350"> + MinWidth="300">