Skip to content

Commit

Permalink
Merge pull request #230 from new-frontiers-14/mailfix
Browse files Browse the repository at this point in the history
Mail Job Icon Fix
  • Loading branch information
Cheackraze authored Aug 19, 2023
2 parents ba968c6 + 139d5eb commit 8b44928
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Content.Client/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Robust.Client.GameObjects;
using Content.Shared.Mail;
using Content.Shared.StatusIcon;
using Robust.Client.Utility;
using Robust.Shared.Prototypes;

namespace Content.Client.Mail
{
Expand Down Expand Up @@ -27,13 +30,17 @@ namespace Content.Client.Mail
/// </remarks>
public sealed class MailJobVisualizerSystem : VisualizerSystem<MailComponent>
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
protected override void OnAppearanceChange(EntityUid uid, MailComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;

if (args.Component.TryGetData(MailVisuals.JobIcon, out string job))
args.Sprite.LayerSetState(MailVisualLayers.JobStamp, job);
{
var jobIcon = _prototype.Index<StatusIconPrototype>(job);
args.Sprite.LayerSetTexture(MailVisualLayers.JobStamp, jobIcon.Icon.Frame0());
}
}
}

Expand Down

0 comments on commit 8b44928

Please sign in to comment.