Skip to content

Commit

Permalink
Lots of nonfunctional clean up of tabletop stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Centronias committed Feb 7, 2025
1 parent 1f5fab5 commit 7148e45
Show file tree
Hide file tree
Showing 28 changed files with 1,095 additions and 1,179 deletions.
30 changes: 30 additions & 0 deletions Content.Client/Tabletop/TabletopDraggableVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Numerics;
using Content.Shared.Tabletop;
using Content.Shared.Tabletop.Components;
using Robust.Client.GameObjects;

namespace Content.Client.Tabletop;

public sealed class TabletopDraggableVisualizerSystem : VisualizerSystem<TabletopDraggableComponent>
{
private static readonly Vector2 DraggedScale = new(1.25f);
private static readonly Vector2 NotDraggedScale = Vector2.Zero;

private const int DraggedDrawDepth = (int)Shared.DrawDepth.DrawDepth.Items + 1;
private const int NotDraggedDrawDepth = (int)Shared.DrawDepth.DrawDepth.Items;

protected override void OnAppearanceChange(EntityUid uid,
TabletopDraggableComponent comp,
ref AppearanceChangeEvent args)
{
if (args.Sprite != null &&
AppearanceSystem.TryGetData<bool>(uid,
TabletopItemVisuals.BeingDragged,
out var beingDragged,
args.Component))
{
args.Sprite.Scale = beingDragged ? DraggedScale : NotDraggedScale;
args.Sprite.DrawDepth = beingDragged ? DraggedDrawDepth : NotDraggedDrawDepth;
}
}
}
Loading

0 comments on commit 7148e45

Please sign in to comment.