Merge branch 'master' into 2021-12-03-remove-IEntity-komm-süsser-todd

# Conflicts:
#	Content.Client/Crayon/CrayonDecalVisualizer.cs
#	Content.Client/Tabletop/TabletopSystem.cs
#	Content.IntegrationTests/Tests/InventoryHelpersTest.cs
#	Content.Server/AI/EntitySystems/AiSystem.cs
#	Content.Server/AI/Utility/AiLogic/UtilityAI.cs
#	Content.Server/AME/AMENodeGroup.cs
#	Content.Server/Administration/AdminVerbSystem.cs
#	Content.Server/Body/Systems/RespiratorSystem.cs
#	Content.Server/Chemistry/Components/InjectorComponent.cs
#	Content.Server/Chemistry/TileReactions/CleanTileReaction.cs
#	Content.Server/Chemistry/TileReactions/SpillTileReaction.cs
#	Content.Server/Crayon/CrayonComponent.cs
#	Content.Server/Doors/Components/ServerDoorComponent.cs
#	Content.Server/Explosion/EntitySystems/TriggerSystem.cs
#	Content.Server/Fluids/Components/MopComponent.cs
#	Content.Server/Fluids/Components/SpillExtensions.cs
#	Content.Server/Fluids/EntitySystems/PuddleSystem.cs
#	Content.Server/Instruments/InstrumentSystem.cs
#	Content.Server/Nutrition/EntitySystems/DrinkSystem.cs
#	Content.Server/Nutrition/EntitySystems/FoodSystem.cs
#	Content.Server/PneumaticCannon/PneumaticCannonSystem.cs
#	Content.Server/Storage/Components/EntityStorageComponent.cs
#	Content.Server/Storage/Components/StorageFillComponent.cs
#	Content.Server/Stunnable/StunbatonSystem.cs
#	Content.Server/Throwing/ThrowHelper.cs
#	Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs
#	Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs
#	Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs
#	Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
#	Content.Shared/Damage/Components/DamageableComponent.cs
#	Content.Shared/Damage/Systems/DamageableSystem.cs
#	Content.Shared/MobState/Components/MobStateComponent.cs
#	Content.Shared/Slippery/SharedSlipperySystem.cs
This commit is contained in:
Vera Aguilera Puerto
2021-12-07 17:48:49 +01:00
171 changed files with 8579 additions and 6088 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Components;
using Content.Shared.Hands;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using System;
namespace Content.Server.Chemistry.EntitySystems
{
@@ -12,6 +14,16 @@ namespace Content.Server.Chemistry.EntitySystems
base.Initialize();
SubscribeLocalEvent<InjectorComponent, SolutionChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<InjectorComponent, HandDeselectedEvent>(OnInjectorDeselected);
}
private void OnInjectorDeselected(EntityUid uid, InjectorComponent component, HandDeselectedEvent args)
{
if (component.CancelToken != null)
{
component.CancelToken.Cancel();
component.CancelToken = null;
}
}
private void OnSolutionChange(EntityUid uid, InjectorComponent component, SolutionChangedEvent args)

View File

@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Server.Database;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
@@ -128,5 +130,27 @@ namespace Content.Server.Chemistry.EntitySystems
return true;
}
public static string ToPrettyString(Solution solution)
{
var sb = new StringBuilder();
sb.Append("Solution content: [");
var first = true;
foreach (var (id, quantity) in solution.Contents)
{
if (first)
{
first = false;
}
else
{
sb.Append(", ");
}
sb.AppendFormat("{0}: {1}u", id, quantity);
}
sb.Append(']');
return sb.ToString();
}
}
}