Cleanup and small update to the stethoscope! (#36210)

* First commit

* Address most of the review!
This commit is contained in:
beck-thompson
2025-03-30 19:27:08 -07:00
committed by GitHub
parent 66e2b0ab64
commit fc0a6dfdb3
11 changed files with 225 additions and 220 deletions

View File

@@ -67,6 +67,8 @@ public partial class InventorySystem
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowCriminalRecordIconsComponent>>(RefRelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, GetVerbsEvent<EquipmentVerb>>(OnGetEquipmentVerbs);
SubscribeLocalEvent<InventoryComponent, GetVerbsEvent<InnateVerb>>(OnGetInnateVerbs);
}
protected void RefRelayInventoryEvent<T>(EntityUid uid, InventoryComponent component, ref T args) where T : IInventoryRelayEvent
@@ -121,6 +123,17 @@ public partial class InventorySystem
}
}
private void OnGetInnateVerbs(EntityUid uid, InventoryComponent component, GetVerbsEvent<InnateVerb> args)
{
// Automatically relay stripping related verbs to all equipped clothing.
var ev = new InventoryRelayedEvent<GetVerbsEvent<InnateVerb>>(args);
var enumerator = new InventorySlotEnumerator(component, SlotFlags.WITHOUT_POCKET);
while (enumerator.NextItem(out var item))
{
RaiseLocalEvent(item, ev);
}
}
}
/// <summary>