Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lost and Found Storage to Cryosleep #31

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a51d5ac
Add lost and found and sleep pod
vaketola Jan 16, 2024
73dd581
Fix spacing error
vaketola Jan 16, 2024
df63e85
Unbreak namespaces
vaketola Jan 16, 2024
845d2de
Add cryo sound effects
vaketola Jan 16, 2024
39ac47f
Flatten nested UI in cs
vaketola Jan 19, 2024
d74544f
Merge remote-tracking branch 'upstream/master' into cryopod
vaketola Jan 19, 2024
d526351
Fix sounds
vaketola Jan 19, 2024
a538ff3
Fix some naming and spacing uniformity issues
vaketola Jan 19, 2024
759a401
Fix more names and spacing
vaketola Jan 19, 2024
523e575
Change sprite
vaketola Jan 19, 2024
d34582d
Fix UI not closing
vaketola Jan 19, 2024
d67a5bc
Update Content.Client/CosmaticDrift/CryoSleep/AcceptCryoWindow.cs
Finket Jan 20, 2024
d6d6764
Update Content.Client/CosmaticDrift/CryoSleep/AcceptCryoWindow.cs
Finket Jan 20, 2024
ff21a84
Update Resources/Textures/Structures/cryosleep_pod.rsi/meta.json
Finket Jan 20, 2024
e765683
Merge branch 'master' into cryopod
vaketola Jan 28, 2024
c4684ea
Merge branch 'cryopod' of https://github.com/Finket/Parkstation-Frien…
vaketola Jan 28, 2024
bf6970e
Resolve rsi locations and fix spacing
vaketola Feb 2, 2024
8e6bbae
Merge branch 'master' into cryopod
vaketola Feb 21, 2024
84cbb9a
Replace CosmaticDrift code with modification of Wizden code
vaketola Feb 21, 2024
8f80035
Update lost and found yaml
vaketola Feb 21, 2024
3d05478
Add pausedMap checks to lost and found systems instead
vaketola Feb 21, 2024
fef065c
Change UI window title
vaketola Feb 22, 2024
bcf2442
Cryopod drops items if no lost and found available
vaketola Feb 24, 2024
ce5bc4f
Move LostAndFound to be handled in original cryostorage systems
vaketola Feb 26, 2024
42a4524
Update lost and found sprite
vaketola Feb 26, 2024
e691b27
Animate lost and found sprite screen
vaketola Feb 26, 2024
84eb666
Update sprite again
vaketola Feb 26, 2024
71a3af2
Merge branch 'master' into cryopod
vaketola Mar 18, 2024
2d801d6
Move from SimpleStation14 to Parkstation namespaces
vaketola Mar 18, 2024
9abc874
Fix reference to parkstation audio
vaketola Mar 18, 2024
936fc79
Apply suggestions from code review
Finket Apr 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Content.Client/CosmaticDrift/CryoSleep/AcceptCryoWindow.cs
Finket marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using static Robust.Client.UserInterface.Controls.BoxContainer;

namespace Content.Client.CryoSleep;
public sealed class AcceptCryoWindow : DefaultWindow
Finket marked this conversation as resolved.
Show resolved Hide resolved
{
public readonly Button DenyButton;
public readonly Button AcceptButton;
public readonly BoxContainer ButtonBox;
public readonly BoxContainer InnerBox;

public AcceptCryoWindow()
{

Finket marked this conversation as resolved.
Show resolved Hide resolved
Title = Loc.GetString("accept-cryo-window-title");

AcceptButton = new Button() {Text = Loc.GetString("accept-cryo-window-accept-button")};
DenyButton = new Button() { Text = Loc.GetString("accept-cryo-window-deny-button")};
Finket marked this conversation as resolved.
Show resolved Hide resolved

// This one holds the buttons
ButtonBox = new BoxContainer()
{
Orientation = LayoutOrientation.Horizontal,
Align = AlignMode.Center,
Children = {AcceptButton, (new Control() { MinSize = new Vector2i(20, 0) }), DenyButton}
Finket marked this conversation as resolved.
Show resolved Hide resolved
};

// This one holds the button container
InnerBox = new BoxContainer()
{
Orientation = LayoutOrientation.Vertical,
Children = {(new Label() {Text = Loc.GetString("accept-cryo-window-prompt-text-part")}), ButtonBox}
Finket marked this conversation as resolved.
Show resolved Hide resolved
};

// Put it all together
Contents.AddChild(new BoxContainer { Orientation = LayoutOrientation.Vertical, Children = { InnerBox } });
}
}
39 changes: 39 additions & 0 deletions Content.Client/CosmaticDrift/CryoSleep/CryoSleepEui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Content.Client.Eui;
using Content.Shared.CryoSleep;
using Robust.Client.Graphics;

namespace Content.Client.CryoSleep;

public sealed class CryoSleepEui : BaseEui
{
private readonly AcceptCryoWindow _window;

public CryoSleepEui()
{
_window = new AcceptCryoWindow();

_window.DenyButton.OnPressed += _ =>
{
SendMessage(new AcceptCryoChoiceMessage(AcceptCryoUiButton.Deny));
_window.Close();
};

_window.AcceptButton.OnPressed += _ =>
{
SendMessage(new AcceptCryoChoiceMessage(AcceptCryoUiButton.Accept));
_window.Close();
};
}

public override void Opened()
{
IoCManager.Resolve<IClyde>().RequestWindowAttention();
_window.OpenCentered();
}

public override void Closed()
{
_window.Close();
}

}
30 changes: 30 additions & 0 deletions Content.Server/CosmaticDrift/CryoSleep/CryoSleepComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Numerics;
using Robust.Shared.Audio;
using Robust.Shared.Containers;

namespace Content.Server.CryoSleep;
[RegisterComponent]
public sealed partial class CryoSleepComponent : Component
{
public ContainerSlot BodyContainer = default!;

/// <summary>
/// Whether or not spawns are routed through the cryopod.
/// </summary>
[DataField("doSpawns"), ViewVariables(VVAccess.ReadWrite)]
public bool DoSpawns = false;
Finket marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// The sound that is played when a player spawns in the pod.
/// </summary>
[DataField("arrivalSound")]
public SoundSpecifier ArrivalSound = new SoundPathSpecifier("/Audio/Effects/teleport_arrival.ogg");

/// <summary>
/// How long the entity initially is asleep for upon joining.
/// </summary>
[DataField("initialSleepDurationRange")]
public Vector2 InitialSleepDurationRange = new (5, 10);

public CryoSleepEui eui = default!;
}
36 changes: 36 additions & 0 deletions Content.Server/CosmaticDrift/CryoSleep/CryoSleepEui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Content.Server.EUI;
using Content.Shared.CryoSleep;
using Content.Shared.Eui;

namespace Content.Server.CryoSleep;

public sealed class CryoSleepEui : BaseEui
{
private readonly CryoSleepSystem _cryoSystem;
private readonly EntityUid _mind;

public CryoSleepEui(EntityUid mind, CryoSleepSystem cryoSys)
{
_mind = mind;
_cryoSystem = cryoSys;
}

public override void HandleMessage(EuiMessageBase msg)
{
base.HandleMessage(msg);

if (msg is not AcceptCryoChoiceMessage choice ||
choice.Button == AcceptCryoUiButton.Deny)
{
Close();
return;
}

if (_mind is { Valid: true } body)
{
_cryoSystem.CryoStoreBody(body);
}

Close();
}
}
Loading
Loading