-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of nonfunctional clean up of tabletop stuff
- Loading branch information
1 parent
1f5fab5
commit 7148e45
Showing
28 changed files
with
1,095 additions
and
1,179 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
Content.Client/Tabletop/TabletopDraggableVisualizerSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.