Make storage implant closable using the action again (#31381)

This commit is contained in:
slarticodefast
2024-08-24 03:31:02 +02:00
committed by GitHub
parent 8c55057a10
commit 8f4ee7ac96
2 changed files with 22 additions and 15 deletions

View File

@@ -403,7 +403,13 @@ public abstract class SharedStorageSystem : EntitySystem
if (args.Handled) if (args.Handled)
return; return;
var uiOpen = _ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, args.Performer);
if (uiOpen)
_ui.CloseUi(uid, StorageComponent.StorageUiKey.Key, args.Performer);
else
OpenStorageUI(uid, args.Performer, storageComp, false); OpenStorageUI(uid, args.Performer, storageComp, false);
args.Handled = true; args.Handled = true;
} }

View File

@@ -44,8 +44,8 @@
- type: entity - type: entity
id: ActionOpenStorageImplant id: ActionOpenStorageImplant
name: Open Storage Implant name: Toggle Storage Implant
description: Opens the storage implant embedded under your skin description: Opens or closes the storage implant embedded under your skin
components: components:
- type: InstantAction - type: InstantAction
itemIconStyle: BigAction itemIconStyle: BigAction
@@ -54,6 +54,7 @@
sprite: Clothing/Back/Backpacks/backpack.rsi sprite: Clothing/Back/Backpacks/backpack.rsi
state: icon state: icon
event: !type:OpenStorageImplantEvent event: !type:OpenStorageImplantEvent
useDelay: 1
- type: entity - type: entity
parent: BaseSuicideAction parent: BaseSuicideAction