using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.DragDrop;
using Content.Shared.FixedPoint;
-using Content.Shared.Item;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Popups;
using Robust.Shared.Audio.Systems;
/// </remarks>
/// <seealso cref="DumpableSolutionComponent" />
/// <seealso cref="DrainableSolutionComponent" />
-/// <seealso cref="RefillableSolutionComponent" />
public sealed class SolutionDumpingSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!;
- private EntityQuery<ItemComponent> _itemQuery;
- private EntityQuery<RefillableSolutionComponent> _refillableQuery;
private EntityQuery<DumpableSolutionComponent> _dumpQuery;
public override void Initialize()
SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag);
SubscribeLocalEvent<DrainableSolutionComponent, CanDropDraggedEvent>(OnDrainableCanDragDropped);
-
- //SubscribeLocalEvent<RefillableSolutionComponent, DragDropDraggedEvent>(OnRefillableDragged); For if you want to refill a container by dragging it into another one. Can't find a use for that currently.
SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged);
SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly
- _itemQuery = GetEntityQuery<ItemComponent>();
- _refillableQuery = GetEntityQuery<RefillableSolutionComponent>();
_dumpQuery = GetEntityQuery<DumpableSolutionComponent>();
}
private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args)
{
- if (_itemQuery.HasComp(ent))
- args.Handled = true;
+ args.Handled = true;
}
private void OnDrainableCanDragDropped(Entity<DrainableSolutionComponent> ent, ref CanDropDraggedEvent args)
/// <returns> True if duration was edited successfully, false otherwise.</returns>
public bool TryRemoveTime(EntityUid uid, EntProtoId effectProto, TimeSpan? time)
{
- return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, time.Value);
+ return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, - time.Value);
}
/// <summary>