Skip to content

Commit 4570fe0

Browse files
Merge branch 'master' into solar-salvager
2 parents 9f75d5e + 84270c4 commit 4570fe0

File tree

41 files changed

+452
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+452
-182
lines changed

Content.Client/_NF/CryoSleep/CryoSleepEui.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Content.Shared._NF.Shipyard.Components;
1111
using Content.Shared.Access.Components;
1212
using Content.Shared.Eui;
13+
using Content.Shared.FixedPoint;
1314
using Content.Shared.IdentityManagement;
1415
using Content.Shared.Inventory;
1516
using Content.Shared.PDA;
@@ -84,7 +85,7 @@ public override void HandleMessage(EuiMessageBase msg)
8485
slotsComp);
8586
//Uplink
8687
string? uplinkWarningLoc = warningMsg.FoundUplink.HasValue
87-
? GetUplinkWarningLocMessage(warningMsg.FoundUplink.Value, slotsComp)
88+
? GetUplinkWarningLocMessage(warningMsg.FoundUplink.Value, slotsComp, warningMsg.UplinkBalance)
8889
: null;
8990
//Items
9091
string? itemWarningLoc = GetImportantItemWarningLocMessage(warningMsg.ImportantItems, slotsComp);
@@ -108,17 +109,23 @@ public override void HandleMessage(EuiMessageBase msg)
108109

109110
private string GetStorageName(CryoSleepWarningMessage.NetworkedWarningItem item, InventorySlotsComponent inventoryComp)
110111
{
111-
if (item.SlotId == null)
112+
if (item.Container is not null)
112113
{
113114
return Identity.Name(_entityManager.GetEntity(item.Container!.Value), _entityManager);
114115
}
115-
else
116+
else if (item.SlotId is not null)
116117
{
117118
//Lowercase this just to make the name not look weird in the popup
118119
var returnVal = inventoryComp.SlotData[item.SlotId].SlotDisplayName;
119120
//I can't execute without assigning it first
120121
return returnVal.ToLower();
121122
}
123+
else if (item.HandId is not null)
124+
//Hand IDs are not human readable, with no reliable way to get a human readable name. This is a bit hardcodey, but it should work in 95% of situations
125+
//If someone has a way to convert to a human name, go for it
126+
return Loc.GetString("accept-cryo-window-prompt-hand-slot-name");
127+
128+
return "ERROR";
122129
}
123130

124131
//All of these message get methods were moved to be separate to make the code less rigid, and easier to read.
@@ -211,20 +218,20 @@ private string GetStorageName(CryoSleepWarningMessage.NetworkedWarningItem item,
211218
//Grab any needed uplink warnings.
212219
//Returns null if no warning is needed
213220
private string? GetUplinkWarningLocMessage(CryoSleepWarningMessage.NetworkedWarningItem foundUplink,
214-
InventorySlotsComponent slotsComp)
221+
InventorySlotsComponent slotsComp,
222+
FixedPoint2 balance)
215223
{
216224
var localUplink = _entityManager.GetEntity(foundUplink.Item);
217225
if (!_entityManager.TryGetComponent<StoreComponent>(localUplink, out var store))
218226
return null;
219227
var currencyProtoId = store.Balance.Keys.First();
220-
var amount = store.Balance[currencyProtoId];
221-
if (amount == 0
228+
if (balance.Equals(0)
222229
|| !_prototypeManager.TryIndex(currencyProtoId, out var currencyProto))
223230
return null;
224231
return Loc.GetString("accept-cryo-window-prompt-uplink-warning",
225232
("uplink", Identity.Name(_entityManager.GetEntity(foundUplink.Item), _entityManager)),
226233
("storage", GetStorageName(foundUplink, slotsComp)),
227-
("amount", amount),
234+
("amount", balance),
228235
("currency", Loc.GetString(currencyProto.DisplayName)));
229236
}
230237

Content.Server/_NF/CryoSleep/CryoSleepSystem.cs

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Diagnostics.CodeAnalysis;
2+
using System.Linq;
23
using System.Numerics;
34
using Content.Server._NF.Shipyard.Systems;
45
using Content.Server.DoAfter;
56
using Content.Server.EUI;
67
using Content.Server.Ghost;
8+
using Content.Server.Hands.Systems;
79
using Content.Server.Interaction;
810
using Content.Server.Mind;
911
using Content.Server.Popups;
@@ -17,6 +19,7 @@
1719
using Content.Shared.DoAfter;
1820
using Content.Shared.DragDrop;
1921
using Content.Shared.Examine;
22+
using Content.Shared.FixedPoint;
2023
using Content.Shared.GameTicking;
2124
using Content.Shared.Hands.Components;
2225
using Content.Shared.Interaction.Events;
@@ -61,6 +64,7 @@ public sealed partial class CryoSleepSystem : EntitySystem
6164
[Dependency] private readonly IGameTiming _timing = default!;
6265
[Dependency] private readonly IPlayerManager _player = default!;
6366
[Dependency] private readonly InventorySystem _inventory = default!; //For cryosleep warnings
67+
[Dependency] private readonly HandsSystem _hands = default!;
6468

6569
private readonly Dictionary<NetUserId, StoredBody?> _storedBodies = new();
6670
private EntityUid? _storageMap;
@@ -292,39 +296,54 @@ public bool IsBodyInCryoPod(EntityUid body, Entity<CryoSleepComponent?> cryopod)
292296
}
293297

294298
/// <summary>
295-
/// Scans the inventory of an entity about to cryo in order to contrusct a warning message of all appropriate items.
299+
/// Scans the inventory of an entity about to cryo in order to construct a warning message of all appropriate items.
296300
/// </summary>
297301
/// <returns>A warning message to be used with CryoSleepEui</returns>
298302
private CryoSleepWarningMessage? GetWarningMessages(EntityUid entity)
299303
{
300304
if (!TryComp<InventoryComponent>(entity, out var inventoryComp))
301305
return null;
302306
//Items check
303-
SlotDefinition[] slotsToCheck = inventoryComp.Slots;
307+
var slotsToCheck = inventoryComp.Slots;
304308
List<WarningItem> warningItemsList = [];
305309
//Doing the conversion to WarningItem all at once makes more sense to me
306-
List<StorageHelper.FoundItem> unconvertedFoundItem = [];
310+
List<StorageHelper.FoundItem> unconvertedFoundItems = [];
307311
foreach (var slotDefinition in slotsToCheck)
308312
{
309313
//The ID is manually checked for a shuttle deed later, and since your PDA *technically* has an uplink in it, this has to be skipped manually.
310314
if (slotDefinition.Name == "id")
311315
continue;
312-
//TODO: Check hand slots for important items
313316
if (_inventory.TryGetSlotEntity(entity, slotDefinition.Name, out var slotItem))
314317
{
315318
if (ShouldItemWarnOnCryo(slotItem.Value))
316-
warningItemsList.Add(new WarningItem(slotDefinition.Name, null, slotItem.Value));
319+
warningItemsList.Add(new WarningItem(slotDefinition.Name, null, null, slotItem.Value));
317320
else if (_entityManager.HasComponent<StorageComponent>(slotItem.Value))
318-
StorageHelper.ScanStorageForCondition(slotItem.Value, ShouldItemWarnOnCryo, ref unconvertedFoundItem);
321+
StorageHelper.ScanStorageForCondition(slotItem.Value, ShouldItemWarnOnCryo, ref unconvertedFoundItems);
319322
}
320323
}
324+
//Check hands (Thank you Alkheemist for the original form of this code)
325+
if (TryComp<HandsComponent>(entity, out var handsComp))
326+
{
327+
foreach (var hand in handsComp.Hands)
328+
{
329+
if (!_hands.TryGetHeldItem(entity, hand.Key, out var heldEntity))
330+
continue;
331+
332+
if (ShouldItemWarnOnCryo(heldEntity.Value))
333+
warningItemsList.Add(new WarningItem(null, null, hand.Key, heldEntity.Value));
334+
else if (_entityManager.HasComponent<StorageComponent>(heldEntity))
335+
StorageHelper.ScanStorageForCondition(heldEntity.Value, ShouldItemWarnOnCryo, ref unconvertedFoundItems);
336+
}
337+
}
338+
321339
//Convert all FoundItem to a WarningItem
322-
foreach (var found in unconvertedFoundItem)
340+
foreach (var found in unconvertedFoundItems)
323341
{
324-
warningItemsList.Add(new WarningItem(null, found.Container, found.Item));
342+
warningItemsList.Add(new WarningItem(null, found.Container, null, found.Item));
325343
}
326344
//Now, we extract the uplinks and shuttle deeds.
327345
WarningItem? uplink = null;
346+
FixedPoint2 currencyAmount = 0;
328347
WarningItem? backpackShuttleDeed = null;
329348
//Listing every point where a shuttle deed was found runs you out of space very fast.
330349
var foundMoreShuttles = false;
@@ -344,10 +363,13 @@ public bool IsBodyInCryoPod(EntityUid body, Entity<CryoSleepComponent?> cryopod)
344363

345364
warningItemsList.RemoveAt(i);
346365
}
347-
else if (HasComp<StoreComponent>(itemStruct.Item) && !uplink.HasValue)
366+
else if (TryComp<StoreComponent>(itemStruct.Item, out var uplinkComp) && !uplink.HasValue)
348367
{
349368
uplink = itemStruct;
350369
warningItemsList.RemoveAt(i);
370+
var currencyProtoId = uplinkComp.Balance.Keys.First();
371+
currencyAmount = uplinkComp.Balance[currencyProtoId];
372+
351373
}
352374
}
353375

@@ -361,6 +383,7 @@ public bool IsBodyInCryoPod(EntityUid body, Entity<CryoSleepComponent?> cryopod)
361383
nwBackpackShuttleDeed,
362384
foundMoreShuttles,
363385
nwUplink,
386+
currencyAmount,
364387
networkedWarningItems);
365388
}
366389

@@ -387,18 +410,20 @@ private bool TryGetIdCard(EntityUid ent, [NotNullWhen(true)] out EntityUid? idCa
387410
return false;
388411
}
389412

390-
private readonly struct WarningItem(string? slotId, EntityUid? container, EntityUid item)
413+
private readonly struct WarningItem(string? slotId, EntityUid? container, string? handId, EntityUid item)
391414
{
392-
//Exactly one of these two values should be null
415+
//Exactly one of these three values should not be null
393416
public readonly string? SlotId = slotId;
394417
public readonly EntityUid? Container = container;
418+
public readonly string? HandId = handId;
395419

396420
public readonly EntityUid Item = item;
397421

398422
public CryoSleepWarningMessage.NetworkedWarningItem ToNetworked(IEntityManager manager)
399423
{
400424
return new CryoSleepWarningMessage.NetworkedWarningItem(SlotId,
401425
manager.GetNetEntity(Container),
426+
HandId,
402427
manager.GetNetEntity(Item));
403428
}
404429
}

Content.Shared/Atmos/Rotting/SharedRottingSystem.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public override void Initialize()
2525
SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
2626
SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnPerishableExamined);
2727

28-
SubscribeLocalEvent<RottingComponent, ComponentShutdown>(OnShutdown);
2928
SubscribeLocalEvent<RottingComponent, MobStateChangedEvent>(OnRottingMobStateChanged);
3029
SubscribeLocalEvent<RottingComponent, RejuvenateEvent>(OnRejuvenate);
3130
SubscribeLocalEvent<RottingComponent, ExaminedEvent>(OnExamined);
@@ -62,14 +61,6 @@ private void OnPerishableExamined(Entity<PerishableComponent> perishable, ref Ex
6261
args.PushMarkup(Loc.GetString(description, ("target", Identity.Entity(perishable, EntityManager))));
6362
}
6463

65-
private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args)
66-
{
67-
if (TryComp<PerishableComponent>(uid, out var perishable))
68-
{
69-
perishable.RotNextUpdate = TimeSpan.Zero;
70-
}
71-
}
72-
7364
private void OnRottingMobStateChanged(EntityUid uid, RottingComponent component, MobStateChangedEvent args)
7465
{
7566
if (args.NewMobState == MobState.Dead)

Content.Shared/_NF/CryoSleep/CryoSleepWarningMessage.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
using Content.Shared.Eui;
2+
using Content.Shared.FixedPoint;
23
using Robust.Shared.Serialization;
34

45
namespace Content.Shared._NF.CryoSleep;
56

67
/// <summary>
78
/// A message for CryoSleepEui containing all the items the server found, along with some other data to build the clientside warning messages.
89
/// </summary>
9-
[Serializable] [NetSerializable]
10+
[Serializable, NetSerializable]
1011
public sealed class CryoSleepWarningMessage(
1112
bool shuttleOnPda,
1213
CryoSleepWarningMessage.NetworkedWarningItem? inventoryShuttleDeed,
1314
bool foundMoreShuttles,
1415
CryoSleepWarningMessage.NetworkedWarningItem? foundUplink,
16+
FixedPoint2 uplinkBalance,
1517
List<CryoSleepWarningMessage.NetworkedWarningItem> importantItems)
1618
: EuiMessageBase
1719
{
1820
public readonly bool ShuttleOnPDA = shuttleOnPda;
1921
public readonly NetworkedWarningItem? InventoryShuttleDeed = inventoryShuttleDeed;
2022
public readonly bool FoundMoreShuttles = foundMoreShuttles;
2123
public readonly NetworkedWarningItem? FoundUplink = foundUplink;
24+
public readonly FixedPoint2 UplinkBalance = uplinkBalance;
2225
public readonly List<NetworkedWarningItem> ImportantItems = importantItems;
2326

24-
[Serializable] [NetSerializable]
27+
28+
[Serializable, NetSerializable]
2529
public struct NetworkedWarningItem
2630
{
27-
public NetworkedWarningItem(string? slotId, NetEntity? container, NetEntity item)
31+
public NetworkedWarningItem(string? slotId, NetEntity? container, string? handId, NetEntity item)
2832
{
29-
if (slotId == null && !container.HasValue)
33+
if (slotId is null && !container.HasValue && handId is null)
3034
{
3135
throw new ArgumentException(
32-
"CryoSleepWarningMessage.NetworkedWarningItem was attempted to be created with both slotId and container as null values");
36+
"CryoSleepWarningMessage.NetworkedWarningItem was attempted to be created with all values as null values");
3337
}
3438

3539
SlotId = slotId;
40+
HandId = handId;
3641
Container = container;
3742
Item = item;
38-
}
39-
//Exactly one of these two values should be null
43+
}
44+
//Exactly one of these values should not be null
4045
public readonly string? SlotId;
4146
public readonly NetEntity? Container;
47+
public readonly string? HandId;
4248

4349
public readonly NetEntity Item;
4450
}
26.2 MB
Binary file not shown.
1010 KB
Binary file not shown.
236 KB
Binary file not shown.
10.8 KB
Binary file not shown.

Resources/Changelog/Frontier.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7462,3 +7462,66 @@ Entries:
74627462
id: 6556
74637463
time: '2026-02-07T07:16:04.0000000+00:00'
74647464
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4300
7465+
- author: RogueVoidling and Alkheemist
7466+
changes:
7467+
- type: Fix
7468+
message: >-
7469+
Cryosleep warnings now properly check your hands and report correct
7470+
values for uplinks.
7471+
id: 6557
7472+
time: '2026-02-08T03:32:27.0000000+00:00'
7473+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4122
7474+
- author: ray-boop
7475+
changes:
7476+
- type: Add
7477+
message: Art and Sounds... you will see... maybe..
7478+
id: 6558
7479+
time: '2026-02-14T23:12:37.0000000+00:00'
7480+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4234
7481+
- author: the-hivequeen
7482+
changes:
7483+
- type: Remove
7484+
message: Trade Mall holiday trees taken down. NT-allotted cheer season is over.
7485+
id: 6559
7486+
time: '2026-02-18T17:35:33.0000000+00:00'
7487+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4309
7488+
- author: Bartholemew Dingleberry
7489+
changes:
7490+
- type: Tweak
7491+
message: >-
7492+
Solar Research now includes Solar Assembly Flatpacks, which can be made
7493+
at Circuit Imprinters
7494+
id: 6560
7495+
time: '2026-02-18T17:36:18.0000000+00:00'
7496+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4307
7497+
- author: JojyAsmir, FairlySadPanda and VasilisThePikachu
7498+
changes:
7499+
- type: Fix
7500+
message: Updated soundfonts for less janky MIDI playback
7501+
id: 6561
7502+
time: '2026-02-19T00:29:56.0000000+00:00'
7503+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4324
7504+
- author: arimah
7505+
changes:
7506+
- type: Tweak
7507+
message: >-
7508+
The Hammer's wiring now goes all the way to the space door, for ease of
7509+
construction. Consult the power monitoring computer or a t-ray scanner
7510+
for exact wire layout.
7511+
id: 6562
7512+
time: '2026-02-19T04:17:03.0000000+00:00'
7513+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4312
7514+
- author: Bartholemew Dingleberry
7515+
changes:
7516+
- type: Tweak
7517+
message: The DC McCargo now has a Guidebook illustration inside!
7518+
id: 6563
7519+
time: '2026-02-19T04:25:16.0000000+00:00'
7520+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4244
7521+
- author: Marlyn
7522+
changes:
7523+
- type: Fix
7524+
message: Opporozidone no longer has instarot bugs
7525+
id: 6564
7526+
time: '2026-02-19T12:11:17.0000000+00:00'
7527+
url: https://github.com/new-frontiers-14/frontier-station-14/pull/4251

Resources/Locale/en-US/_NF/cryosleep/cryosleep-component.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ accept-cryo-window-prompt-two-items-warning = You have {$item1} in your {$storag
1919
accept-cryo-window-prompt-many-items-warning = You have {$item1} in your {$storage1}, {$item2} in your {$storage2}, and {$num-extra-items} important items elsewhere!
2020
accept-cryo-window-prompt-uplink-warning = You have a {$uplink} in your {$storage} with {$amount} {$currency}!
2121
accept-cryo-window-prompt-unable-to-scan = Your inventory couldn't be scanned for important items due to an error.
22+
accept-cryo-window-prompt-hand-slot-name = hand
2223
2324
cryo-wakeup-window-title = Waking Up
2425
cryo-wakeup-window-accept-button = Accept

0 commit comments

Comments
 (0)