mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* add SaveItemLocation keybind
* make item direction public to avoid having to change between Angle for no reason
* add item location saving
* show
* Added a better save keybind, made it draw saved positions, and trying to save in a position it has already been saved in removes that position.
* w
* code style
* Make taken spots appear blue
* style
* !
---------
Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: notquitehadouken <tripwiregamer@gmail.com>
Co-authored-by: I.K <45953835+notquitehadouken@users.noreply.github.com>
(cherry picked from commit 6863a7cc26)
41 lines
992 B
C#
41 lines
992 B
C#
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Storage;
|
|
|
|
[DataDefinition, Serializable, NetSerializable]
|
|
public partial record struct ItemStorageLocation
|
|
{
|
|
/// <summary>
|
|
/// The rotation, stored a cardinal direction in order to reduce rounding errors.
|
|
/// </summary>
|
|
[DataField("_rotation")]
|
|
public Direction Direction;
|
|
|
|
/// <summary>
|
|
/// The rotation of the piece in storage.
|
|
/// </summary>
|
|
public Angle Rotation
|
|
{
|
|
get => Direction.ToAngle();
|
|
set => Direction = value.GetCardinalDir();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Where the item is located in storage.
|
|
/// </summary>
|
|
[DataField]
|
|
public Vector2i Position;
|
|
|
|
public ItemStorageLocation(Angle rotation, Vector2i position)
|
|
{
|
|
Rotation = rotation;
|
|
Position = position;
|
|
}
|
|
|
|
public bool Equals(ItemStorageLocation? other)
|
|
{
|
|
return Rotation == other?.Rotation &&
|
|
Position == other.Value.Position;
|
|
}
|
|
};
|