Skip to content

Commit

Permalink
Use SharedAppearanceSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Nov 16, 2024
1 parent 93b2242 commit e2f3a84
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Content.Client/Explosion/ExplosionOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed class ExplosionOverlay : Overlay
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;

public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;

Expand All @@ -41,7 +42,7 @@ protected override void Draw(in OverlayDrawArgs args)
if (visuals.Epicenter.MapId != args.MapId)
continue;

if (!appearance.TryGetData(ExplosionAppearanceData.Progress, out int index))
if (!_appearanceSystem.TryGetData(appearance.Owner, ExplosionAppearanceData.Progress, out int index))
continue;

index = Math.Min(index, visuals.Intensity.Count - 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Content.Client.Kitchen.Visualizers
{
public sealed class DeepFriedVisualizerSystem : VisualizerSystem<DeepFriedComponent>
{
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
private readonly static string ShaderName = "Crispy";

public override void Initialize()
Expand All @@ -26,7 +27,7 @@ protected override void OnAppearanceChange(EntityUid uid, DeepFriedComponent com
if (args.Sprite == null)
return;

if (!args.Component.TryGetData(DeepFriedVisuals.Fried, out bool isFried))
if (!_appearanceSystem.TryGetData(uid, DeepFriedVisuals.Fried, out bool isFried))
return;

for (var i = 0; i < args.Sprite.AllLayers.Count(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ namespace Content.Client.Kitchen.Visualizers
{
public sealed class DeepFryerVisualizerSystem : VisualizerSystem<DeepFryerComponent>
{
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;

protected override void OnAppearanceChange(EntityUid uid, DeepFryerComponent component, ref AppearanceChangeEvent args)
{
if (!args.Component.TryGetData(DeepFryerVisuals.Bubbling, out bool isBubbling) ||
if (!_appearanceSystem.TryGetData(uid, DeepFryerVisuals.Bubbling, out bool isBubbling) ||
!TryComp<SolutionContainerVisualsComponent>(uid, out var scvComponent))
{
return;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ public sealed class MailJobVisualizerSystem : VisualizerSystem<MailComponent>
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SpriteSystem _stateManager = default!;
[Dependency] private readonly SpriteSystem _spriteSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;

protected override void OnAppearanceChange(EntityUid uid, MailComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;

args.Component.TryGetData(MailVisuals.JobIcon, out string job);
_appearanceSystem.TryGetData(uid, MailVisuals.JobIcon, out string job);

if (string.IsNullOrEmpty(job))
job = "JobIconUnknown";
Expand Down

0 comments on commit e2f3a84

Please sign in to comment.