using Content.Shared.Input;
using Content.Shared.PDA;
using Content.Shared.Storage;
+using Content.Shared.Timing;
using Robust.Client.UserInterface;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
Assert.That(IsUiOpen(StorageComponent.StorageUiKey.Key), Is.False);
Assert.That(IsUiOpen(PdaUiKey.Key), Is.False);
+ await Server.WaitPost(() => SEntMan.RemoveComponent<UseDelayComponent>(STarget!.Value));
+ await RunTicks(5);
+
// Activating the backpack opens the UI
await Activate();
Assert.That(IsUiOpen(StorageComponent.StorageUiKey.Key), Is.True);
Assert.That(IsUiOpen(PdaUiKey.Key), Is.False);
+ // Activating it again closes the UI
+ await Activate();
+ Assert.That(IsUiOpen(StorageComponent.StorageUiKey.Key), Is.False);
+
+ // Open it again
+ await Activate();
+ Assert.That(IsUiOpen(StorageComponent.StorageUiKey.Key), Is.True);
+
// Pick up a PDA
var pda = await PlaceInHands("PassengerPDA");
var sPda = ToServer(pda);
return;
// prevent spamming bag open / honkerton honk sound
- silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && UseDelay.IsDelayed((uid, useDelay));
+ silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && UseDelay.IsDelayed((uid, useDelay), id: OpenUiUseDelayID);
if (!CanInteract(entity, (uid, storageComp), silent: silent))
return;
Audio.PlayPredicted(storageComp.StorageOpenSound, uid, entity);
if (useDelay != null)
- UseDelay.TryResetDelay((uid, useDelay));
+ UseDelay.TryResetDelay((uid, useDelay), id: OpenUiUseDelayID);
}
_ui.OpenUi(uid, StorageComponent.StorageUiKey.Key, entity);