Skip to content

Commit

Permalink
VSCode had a stupid moment.
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Nov 15, 2024
1 parent e58d88a commit 2ca3d68
Show file tree
Hide file tree
Showing 39 changed files with 136 additions and 303 deletions.
11 changes: 3 additions & 8 deletions Content.Client/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Robust.Shared.GameStates;
namespace Content.Client.Body.Components;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class BrainComponent : Component
{
}
}
[RegisterComponent]
public sealed partial class BrainComponent : Component { }
11 changes: 3 additions & 8 deletions Content.Client/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Robust.Shared.GameStates;
namespace Content.Client.Body.Components;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class LungComponent : Component
{
}
}
[RegisterComponent]
public sealed partial class LungComponent : Component { }
11 changes: 3 additions & 8 deletions Content.Client/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Robust.Shared.GameStates;
namespace Content.Client.Body.Components;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class StomachComponent : Component
{
}
}
[RegisterComponent]
public sealed partial class StomachComponent : Component { }
10 changes: 0 additions & 10 deletions Content.Client/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";

Expand All @@ -38,21 +36,15 @@ 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?
if (colors != null && j < colors.Count)
{
sprite.LayerSetColor(layerId, colors[j]);
}
else
{
sprite.LayerSetColor(layerId, Color.White);
}
}
}

Expand All @@ -65,15 +57,13 @@ 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))
continue;

ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite);
}
}
}

protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
Expand Down
12 changes: 2 additions & 10 deletions Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,23 +260,15 @@ private void HideLayers(EntityUid uid, HandsComponent component, Entity<BodyPart
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 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);
}
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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ protected override void ReceiveMessage(BoundUserInterfaceMessage message)
}

private void SendBodyPartMessage(TargetBodyPart? part, EntityUid target)
{
if (part == null)
SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), null));
else
SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part.Value));
}
=> SendMessage(new HealthAnalyzerPartMessage(EntMan.GetNetEntity(target), part ?? null));

protected override void Dispose(bool disposing)
{
Expand Down
21 changes: 3 additions & 18 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
using System.Numerics;
using Content.Client.Message;
using Content.Shared.Atmos;
using Content.Shared.Body.Part; // Shitmed
using Content.Client.UserInterface.Controls;
using Content.Shared.Alert;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Targeting; // Shitmed
using Content.Shared.Targeting;
using Content.Shared.FixedPoint;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Prototypes;
Expand Down Expand Up @@ -37,8 +36,6 @@ public sealed partial class HealthAnalyzerWindow : FancyWindow
private readonly SpriteSystem _spriteSystem;
private readonly IPrototypeManager _prototypes;
private readonly IResourceCache _cache;

// Start-Shitmed
public event Action<TargetBodyPart?, EntityUid>? OnBodyPartSelected;
private EntityUid _spriteViewEntity;

Expand All @@ -48,8 +45,6 @@ public sealed partial class HealthAnalyzerWindow : FancyWindow
private readonly Dictionary<TargetBodyPart, TextureButton> _bodyPartControls;
private EntityUid? _target;

// End-Shitmed

public HealthAnalyzerWindow()
{
RobustXamlLoader.Load(this);
Expand All @@ -59,7 +54,6 @@ public HealthAnalyzerWindow()
_spriteSystem = _entityManager.System<SpriteSystem>();
_prototypes = dependencies.Resolve<IPrototypeManager>();
_cache = dependencies.Resolve<IResourceCache>();
// Start-Shitmed
_bodyPartControls = new Dictionary<TargetBodyPart, TextureButton>
{
{ TargetBodyPart.Head, HeadButton },
Expand All @@ -81,19 +75,15 @@ public HealthAnalyzerWindow()
bodyPartButton.Value.OnPressed += _ => SetActiveBodyPart(bodyPartButton.Key, bodyPartButton.Value);
}
ReturnButton.OnPressed += _ => ResetBodyPart();
// End-Shitmed
}

public void SetActiveBodyPart(TargetBodyPart part, TextureButton button)
{
if (_target == null)
if (_target is null)
return;

// Bit of the ole shitcode until we have Groins in the prototypes.
if (part == TargetBodyPart.Groin)
OnBodyPartSelected?.Invoke(TargetBodyPart.Torso, _target.Value);
else
OnBodyPartSelected?.Invoke(part, _target.Value);
OnBodyPartSelected?.Invoke(part == TargetBodyPart.Groin ? TargetBodyPart.Torso : part, _target.Value);
}

public void ResetBodyPart()
Expand All @@ -112,7 +102,6 @@ public void SetActiveButtons(bool isHumanoid)

public void Populate(HealthAnalyzerScannedUserMessage msg)
{
// Start-Shitmed
_target = _entityManager.GetEntity(msg.TargetEntity);
EntityUid? part = msg.Part != null ? _entityManager.GetEntity(msg.Part.Value) : null;
var isPart = part != null;
Expand Down Expand Up @@ -183,7 +172,6 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)

// Total Damage


DamageLabel.Text = damageable.TotalDamage.ToString();

// Alerts
Expand Down Expand Up @@ -227,7 +215,6 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)
IReadOnlyDictionary<string, FixedPoint2> damagePerType = damageable.Damage.DamageDict;

DrawDiagnosticGroups(damageSortedGroups, damagePerType);
// End-Shitmed
}

private static string GetStatus(MobState mobState)
Expand Down Expand Up @@ -329,7 +316,6 @@ private BoxContainer CreateDiagnosticGroupTitle(string text, string id)
return rootContainer;
}

// Start-Shitmed
/// <summary>
/// Sets up the Body Doll using Alert Entity to use in Health Analyzer.
/// </summary>
Expand Down Expand Up @@ -363,6 +349,5 @@ private BoxContainer CreateDiagnosticGroupTitle(string text, string id)
}
return _spriteViewEntity;
}
// End-Shitmed
}
}
1 change: 0 additions & 1 deletion Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ private void UpdateLayers(HumanoidAppearanceComponent component, SpriteComponent
foreach (var (key, info) in component.CustomBaseLayers)
{
oldLayers.Remove(key);
// Shitmed modification: For whatever reason these weren't actually ignoring the skin color as advertised.
SetLayerData(component, sprite, key, info.Id, sexMorph: false, color: info.Color, overrideSkin: true);
}

Expand Down
8 changes: 5 additions & 3 deletions Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 2ca3d68

Please sign in to comment.