using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
+using Content.Shared.Item;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int Capacity = 10;
+
+ [DataField, ViewVariables(VVAccess.ReadWrite)]
+ public ProtoId<ItemSizePrototype> MaxItemSize = "Normal";
}
public sealed class BeingMicrowavedEvent : HandledEntityEventArgs
[Dependency] private readonly TemperatureSystem _temperature = default!;
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
[Dependency] private readonly HandsSystem _handsSystem = default!;
+ [Dependency] private readonly SharedItemSystem _item = default!;
public override void Initialize()
{
return;
}
- if (!HasComp<ItemComponent>(args.Used))
+ if (TryComp<ItemComponent>(args.Used, out var item))
{
+ // check if size of an item you're trying to put in is too big
+ if (_item.GetSizePrototype(item.Size) > _item.GetSizePrototype(ent.Comp.MaxItemSize))
+ {
+ _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-item-too-big", ("item", args.Used)), ent, args.User);
+ return;
+ }
+ }
+ else
+ {
+ // check if thing you're trying to put in isn't an item
_popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-transfer-fail"), ent, args.User);
return;
}
microwave-component-suicide-message = You cook your head!
microwave-component-upgrade-cook-time = cook time
microwave-component-interact-full = It's full.
+microwave-component-interact-item-too-big = { CAPITALIZE(THE($item)) } is too big to fit in the microwave!
## Bound UI