-
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.
- Loading branch information
1 parent
7ee4205
commit 58f562d
Showing
24 changed files
with
384 additions
and
430 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; | ||
} | ||
} | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
namespace Content.Server.Tabletop.Components; | ||
|
||
/// <summary> | ||
/// Component for marking an entity as currently playing a tabletop. | ||
/// Component for marking an entity as currently playing a tabletop. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(TabletopSystem))] | ||
public sealed partial class TabletopGamerComponent : Component | ||
{ | ||
[DataField("tabletop")] | ||
public EntityUid Tabletop { get; set; } = EntityUid.Invalid; | ||
} | ||
[DataField] | ||
public EntityUid Tabletop = EntityUid.Invalid; | ||
} |
7 changes: 2 additions & 5 deletions
7
...ver/Tabletop/TabletopHologramComponent.cs → ...p/Components/TabletopHologramComponent.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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
namespace Content.Server.Tabletop; | ||
namespace Content.Server.Tabletop.Components; | ||
|
||
/// <summary> | ||
/// This is used for tracking pieces that are simply "holograms" shown on the tabletop | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class TabletopHologramComponent : Component | ||
{ | ||
|
||
} | ||
public sealed partial class TabletopHologramComponent : Component; |
Oops, something went wrong.