Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods (#1965)
* Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods * Remove redundant code
This commit is contained in:
@@ -66,7 +66,7 @@ namespace Content.Client.UserInterface.Suspicion
|
|||||||
_ => throw new ArgumentException($"Invalid number of allies: {role.Allies.Count}")
|
_ => throw new ArgumentException($"Invalid number of allies: {role.Allies.Count}")
|
||||||
};
|
};
|
||||||
|
|
||||||
role.Owner.PopupMessage(role.Owner, message);
|
role.Owner.PopupMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryGetComponent(out SuspicionRoleComponent suspicion)
|
private bool TryGetComponent(out SuspicionRoleComponent suspicion)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Content.Server.GameObjects.Components.Chemistry;
|
using Content.Server.GameObjects.Components.Chemistry;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
@@ -13,13 +13,11 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
|
|
||||||
namespace Content.Server.Atmos
|
namespace Content.Server.Atmos
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class GasSprayerComponent : Component, IAfterInteract
|
public class GasSprayerComponent : Component, IAfterInteract
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||||
|
|
||||||
//TODO: create a function that can create a gas based on a solution mix
|
//TODO: create a function that can create a gas based on a solution mix
|
||||||
@@ -48,7 +46,7 @@ namespace Content.Server.Atmos
|
|||||||
|
|
||||||
if (tank.Solution.GetReagentQuantity(_fuelType) == 0)
|
if (tank.Solution.GetReagentQuantity(_fuelType) == 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User,
|
||||||
Loc.GetString("{0:theName} is out of {1}!", Owner, _fuelName));
|
Loc.GetString("{0:theName} is out of {1}!", Owner, _fuelName));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
|
|
||||||
private void OpenSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
private void OpenSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
||||||
{
|
{
|
||||||
performer.PopupMessage(performer, Loc.GetString("Cut open the skin..."));
|
performer.PopupMessage(Loc.GetString("Cut open the skin..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
_skinOpened = true;
|
_skinOpened = true;
|
||||||
@@ -139,7 +139,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
|
|
||||||
private void ClampVesselsSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
private void ClampVesselsSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
||||||
{
|
{
|
||||||
performer.PopupMessage(performer, Loc.GetString("Clamp the vessels..."));
|
performer.PopupMessage(Loc.GetString("Clamp the vessels..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
_vesselsClamped = true;
|
_vesselsClamped = true;
|
||||||
@@ -147,7 +147,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
|
|
||||||
private void RetractSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
private void RetractSkinSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
||||||
{
|
{
|
||||||
performer.PopupMessage(performer, Loc.GetString("Retract the skin..."));
|
performer.PopupMessage(Loc.GetString("Retract the skin..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
_skinRetracted = true;
|
_skinRetracted = true;
|
||||||
@@ -155,7 +155,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
|
|
||||||
private void CauterizeIncisionSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
private void CauterizeIncisionSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
||||||
{
|
{
|
||||||
performer.PopupMessage(performer, Loc.GetString("Cauterize the incision..."));
|
performer.PopupMessage(Loc.GetString("Cauterize the incision..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
_skinOpened = false;
|
_skinOpened = false;
|
||||||
@@ -193,7 +193,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
performer.PopupMessage(performer, Loc.GetString("Loosen the organ..."));
|
performer.PopupMessage(Loc.GetString("Loosen the organ..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
_disconnectedOrgans.Add(target);
|
_disconnectedOrgans.Add(target);
|
||||||
@@ -224,7 +224,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
performer.PopupMessage(performer, Loc.GetString("Remove the organ..."));
|
performer.PopupMessage(Loc.GetString("Remove the organ..."));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
Parent.TryDropMechanism(performer, target, out _);
|
Parent.TryDropMechanism(performer, target, out _);
|
||||||
@@ -240,7 +240,7 @@ namespace Content.Server.Body.Surgery
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bmTarget = (BodyManagerComponent) container;
|
var bmTarget = (BodyManagerComponent) container;
|
||||||
performer.PopupMessage(performer, Loc.GetString("Saw off the limb!"));
|
performer.PopupMessage(Loc.GetString("Saw off the limb!"));
|
||||||
|
|
||||||
// TODO do_after: Delay
|
// TODO do_after: Delay
|
||||||
bmTarget.DisconnectBodyPart(Parent, true);
|
bmTarget.DisconnectBodyPart(Parent, true);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Server.GameObjects.Components.Items.Storage;
|
|||||||
using Content.Server.GameObjects.Components.Observer;
|
using Content.Server.GameObjects.Components.Observer;
|
||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
using Content.Server.Interfaces.GameObjects;
|
using Content.Server.Interfaces.GameObjects;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Observer;
|
using Content.Server.Observer;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
@@ -120,7 +119,6 @@ namespace Content.Server.Chat
|
|||||||
internal class SuicideCommand : IClientCommand
|
internal class SuicideCommand : IClientCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public string Command => "suicide";
|
public string Command => "suicide";
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Access;
|
using Content.Shared.Access;
|
||||||
using Content.Shared.GameObjects.Components.Access;
|
using Content.Shared.GameObjects.Components.Access;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
@@ -25,7 +25,6 @@ namespace Content.Server.GameObjects.Components.Access
|
|||||||
[ComponentReference(typeof(IActivate))]
|
[ComponentReference(typeof(IActivate))]
|
||||||
public class IdCardConsoleComponent : SharedIdCardConsoleComponent, IActivate
|
public class IdCardConsoleComponent : SharedIdCardConsoleComponent, IActivate
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
|
|
||||||
private ContainerSlot _privilegedIdContainer = default!;
|
private ContainerSlot _privilegedIdContainer = default!;
|
||||||
@@ -132,7 +131,7 @@ namespace Content.Server.GameObjects.Components.Access
|
|||||||
{
|
{
|
||||||
if (!user.TryGetComponent(out IHandsComponent? hands))
|
if (!user.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user, Loc.GetString("You have no hands."));
|
Owner.PopupMessage(user, Loc.GetString("You have no hands."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +160,7 @@ namespace Content.Server.GameObjects.Components.Access
|
|||||||
|
|
||||||
if (!hands.Drop(hands.ActiveHand, container))
|
if (!hands.Drop(hands.ActiveHand, container))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user, Loc.GetString("You can't let go of the ID card!"));
|
Owner.PopupMessage(user, Loc.GetString("You can't let go of the ID card!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Content.Shared.Interfaces;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -22,7 +21,6 @@ using Robust.Shared.Maths;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using Serilog;
|
|
||||||
using Content.Server.GameObjects.Components.GUI;
|
using Content.Server.GameObjects.Components.GUI;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.ActionBlocking
|
namespace Content.Server.GameObjects.Components.ActionBlocking
|
||||||
@@ -30,9 +28,6 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class CuffableComponent : SharedCuffableComponent
|
public class CuffableComponent : SharedCuffableComponent
|
||||||
{
|
{
|
||||||
[Dependency]
|
|
||||||
private readonly ISharedNotifyManager _notifyManager;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How many of this entity's hands are currently cuffed.
|
/// How many of this entity's hands are currently cuffed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -231,13 +226,13 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
|
|
||||||
if (!isOwner && !ActionBlockerSystem.CanInteract(user))
|
if (!isOwner && !ActionBlockerSystem.CanInteract(user))
|
||||||
{
|
{
|
||||||
user.PopupMessage(user, Loc.GetString("You can't do that!"));
|
user.PopupMessage(Loc.GetString("You can't do that!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isOwner && user.InRangeUnobstructed(Owner, _interactRange))
|
if (!isOwner && user.InRangeUnobstructed(Owner, _interactRange))
|
||||||
{
|
{
|
||||||
user.PopupMessage(user, Loc.GetString("You are too far away to remove the cuffs."));
|
user.PopupMessage(Loc.GetString("You are too far away to remove the cuffs."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +242,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.PopupMessage(user, Loc.GetString("You start removing the cuffs."));
|
user.PopupMessage(Loc.GetString("You start removing the cuffs."));
|
||||||
|
|
||||||
var audio = EntitySystem.Get<AudioSystem>();
|
var audio = EntitySystem.Get<AudioSystem>();
|
||||||
audio.PlayFromEntity(isOwner ? cuff.StartBreakoutSound : cuff.StartUncuffSound, Owner);
|
audio.PlayFromEntity(isOwner ? cuff.StartBreakoutSound : cuff.StartUncuffSound, Owner);
|
||||||
@@ -292,29 +287,29 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
|
|
||||||
if (CuffedHandCount == 0)
|
if (CuffedHandCount == 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user, Loc.GetString("You successfully remove the cuffs."));
|
user.PopupMessage(Loc.GetString("You successfully remove the cuffs."));
|
||||||
|
|
||||||
if (!isOwner)
|
if (!isOwner)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, Owner, Loc.GetString("{0:theName} uncuffs your hands.", user));
|
user.PopupMessage(Owner, Loc.GetString("{0:theName} uncuffs your hands.", user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!isOwner)
|
if (!isOwner)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user, Loc.GetString("You successfully remove the cuffs. {0} of {1:theName}'s hands remain cuffed.", CuffedHandCount, user));
|
user.PopupMessage(Loc.GetString("You successfully remove the cuffs. {0} of {1:theName}'s hands remain cuffed.", CuffedHandCount, user));
|
||||||
_notifyManager.PopupMessage(user, Owner, Loc.GetString("{0:theName} removes your cuffs. {1} of your hands remain cuffed.", user, CuffedHandCount));
|
user.PopupMessage(Owner, Loc.GetString("{0:theName} removes your cuffs. {1} of your hands remain cuffed.", user, CuffedHandCount));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user, Loc.GetString("You successfully remove the cuffs. {0} of your hands remain cuffed.", CuffedHandCount));
|
user.PopupMessage(Loc.GetString("You successfully remove the cuffs. {0} of your hands remain cuffed.", CuffedHandCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user, Loc.GetString("You fail to remove the cuffs."));
|
user.PopupMessage(Loc.GetString("You fail to remove the cuffs."));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class HandcuffComponent : SharedHandcuffComponent, IAfterInteract
|
public class HandcuffComponent : SharedHandcuffComponent, IAfterInteract
|
||||||
{
|
{
|
||||||
[Dependency]
|
|
||||||
private readonly ISharedNotifyManager _notifyManager;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time it takes to apply a <see cref="CuffedComponent"/> to an entity.
|
/// The time it takes to apply a <see cref="CuffedComponent"/> to an entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -161,36 +158,36 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
|
|
||||||
if (eventArgs.Target == eventArgs.User)
|
if (eventArgs.Target == eventArgs.User)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("You can't cuff yourself!"));
|
eventArgs.User.PopupMessage(Loc.GetString("You can't cuff yourself!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Broken)
|
if (Broken)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("The cuffs are broken!"));
|
eventArgs.User.PopupMessage(Loc.GetString("The cuffs are broken!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eventArgs.Target.TryGetComponent<HandsComponent>(out var hands))
|
if (!eventArgs.Target.TryGetComponent<HandsComponent>(out var hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("{0:theName} has no hands!", eventArgs.Target));
|
eventArgs.User.PopupMessage(Loc.GetString("{0:theName} has no hands!", eventArgs.Target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cuffed.CuffedHandCount == hands.Count)
|
if (cuffed.CuffedHandCount == hands.Count)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("{0:theName} has no free hands to handcuff!", eventArgs.Target));
|
eventArgs.User.PopupMessage(Loc.GetString("{0:theName} has no free hands to handcuff!", eventArgs.Target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eventArgs.InRangeUnobstructed(_interactRange, ignoreInsideBlocker: true))
|
if (!eventArgs.InRangeUnobstructed(_interactRange, ignoreInsideBlocker: true))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("You are too far away to use the cuffs!"));
|
eventArgs.User.PopupMessage(Loc.GetString("You are too far away to use the cuffs!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("You start cuffing {0:theName}.", eventArgs.Target));
|
eventArgs.User.PopupMessage(Loc.GetString("You start cuffing {0:theName}.", eventArgs.Target));
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.Target, Loc.GetString("{0:theName} starts cuffing you!", eventArgs.User));
|
eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("{0:theName} starts cuffing you!", eventArgs.User));
|
||||||
_audioSystem.PlayFromEntity(StartCuffSound, Owner);
|
_audioSystem.PlayFromEntity(StartCuffSound, Owner);
|
||||||
|
|
||||||
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
|
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
|
||||||
@@ -222,8 +219,8 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
if (result != DoAfterStatus.Cancelled)
|
if (result != DoAfterStatus.Cancelled)
|
||||||
{
|
{
|
||||||
_audioSystem.PlayFromEntity(EndCuffSound, Owner);
|
_audioSystem.PlayFromEntity(EndCuffSound, Owner);
|
||||||
_notifyManager.PopupMessage(user, user, Loc.GetString("You successfully cuff {0:theName}.", target));
|
user.PopupMessage(Loc.GetString("You successfully cuff {0:theName}.", target));
|
||||||
_notifyManager.PopupMessage(target, target, Loc.GetString("You have been cuffed by {0:theName}!", user));
|
target.PopupMessage(Loc.GetString("You have been cuffed by {0:theName}!", user));
|
||||||
|
|
||||||
if (user.TryGetComponent<HandsComponent>(out var hands))
|
if (user.TryGetComponent<HandsComponent>(out var hands))
|
||||||
{
|
{
|
||||||
@@ -237,8 +234,8 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
user.PopupMessage(user, Loc.GetString("You were interrupted while cuffing {0:theName}!", target));
|
user.PopupMessage(Loc.GetString("You were interrupted while cuffing {0:theName}!", target));
|
||||||
target.PopupMessage(target, Loc.GetString("You interrupt {0:theName} while they are cuffing you!", user));
|
target.PopupMessage(Loc.GetString("You interrupt {0:theName} while they are cuffing you!", user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
@@ -24,7 +24,6 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class GasAnalyzerComponent : SharedGasAnalyzerComponent, IAfterInteract, IDropped, IUse
|
public class GasAnalyzerComponent : SharedGasAnalyzerComponent, IAfterInteract, IDropped, IUse
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private GasAnalyzerDanger _pressureDanger;
|
private GasAnalyzerDanger _pressureDanger;
|
||||||
@@ -207,17 +206,14 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
if (!player.TryGetComponent(out IHandsComponent? handsComponent))
|
if (!player.TryGetComponent(out IHandsComponent? handsComponent))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, player,
|
Owner.PopupMessage(player, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var activeHandEntity = handsComponent.GetActiveHand?.Owner;
|
var activeHandEntity = handsComponent.GetActiveHand?.Owner;
|
||||||
if (activeHandEntity == null || !activeHandEntity.TryGetComponent(out GasAnalyzerComponent? gasAnalyzer))
|
if (activeHandEntity == null || !activeHandEntity.TryGetComponent(out GasAnalyzerComponent? gasAnalyzer))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(serverMsg.Session.AttachedEntity,
|
serverMsg.Session.AttachedEntity.PopupMessage(Loc.GetString("You need a Gas Analyzer in your hand!"));
|
||||||
serverMsg.Session.AttachedEntity,
|
|
||||||
Loc.GetString("You need a Gas Analyzer in your hand!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +227,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
{
|
{
|
||||||
if (!eventArgs.CanReach)
|
if (!eventArgs.CanReach)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(eventArgs.User, eventArgs.User, Loc.GetString("You can't reach there!"));
|
eventArgs.User.PopupMessage(Loc.GetString("You can't reach there!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.Interfaces;
|
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Server.Body;
|
using Content.Server.Body;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Body.Surgery;
|
using Content.Shared.Body.Surgery;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
@@ -24,8 +23,6 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class DroppedBodyPartComponent : Component, IAfterInteract, IBodyPartContainer
|
public class DroppedBodyPartComponent : Component, IAfterInteract, IBodyPartContainer
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!;
|
|
||||||
|
|
||||||
private readonly Dictionary<int, object> _optionsCache = new Dictionary<int, object>();
|
private readonly Dictionary<int, object> _optionsCache = new Dictionary<int, object>();
|
||||||
private BodyManagerComponent? _bodyManagerComponentCache;
|
private BodyManagerComponent? _bodyManagerComponentCache;
|
||||||
private int _idHash;
|
private int _idHash;
|
||||||
@@ -121,7 +118,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
}
|
}
|
||||||
else // If surgery cannot be performed, show message saying so.
|
else // If surgery cannot be performed, show message saying so.
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(eventArgs.Target, eventArgs.User,
|
eventArgs.Target.PopupMessage(eventArgs.User,
|
||||||
Loc.GetString("You see no way to install {0:theName}.", Owner));
|
Loc.GetString("You see no way to install {0:theName}.", Owner));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +144,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
// TODO: sanity checks to see whether user is in range, user is still able-bodied, target is still the same, etc etc
|
// TODO: sanity checks to see whether user is in range, user is still able-bodied, target is still the same, etc etc
|
||||||
if (!_optionsCache.TryGetValue(key, out var targetObject))
|
if (!_optionsCache.TryGetValue(key, out var targetObject))
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(_bodyManagerComponentCache.Owner, _performerCache,
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache,
|
||||||
Loc.GetString("You see no useful way to attach {0:theName} anymore.", Owner));
|
Loc.GetString("You see no useful way to attach {0:theName} anymore.", Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,10 +160,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
message = Loc.GetString("You can't attach it!");
|
message = Loc.GetString("You can't attach it!");
|
||||||
}
|
}
|
||||||
|
|
||||||
_sharedNotifyManager.PopupMessage(
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache, message);
|
||||||
_bodyManagerComponentCache.Owner,
|
|
||||||
_performerCache,
|
|
||||||
message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OpenSurgeryUI(IPlayerSession session)
|
private void OpenSurgeryUI(IPlayerSession session)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class DroppedMechanismComponent : Component, IAfterInteract
|
public class DroppedMechanismComponent : Component, IAfterInteract
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
|
|
||||||
public sealed override string Name => "DroppedMechanism";
|
public sealed override string Name => "DroppedMechanism";
|
||||||
@@ -67,8 +66,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
|
|
||||||
if (!droppedBodyPart.ContainedBodyPart.TryInstallDroppedMechanism(this))
|
if (!droppedBodyPart.ContainedBodyPart.TryInstallDroppedMechanism(this))
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(eventArgs.Target, eventArgs.User,
|
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("You can't fit it in!"));
|
||||||
Loc.GetString("You can't fit it in!"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +139,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
}
|
}
|
||||||
else // If surgery cannot be performed, show message saying so.
|
else // If surgery cannot be performed, show message saying so.
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(eventArgs.Target, eventArgs.User,
|
eventArgs.Target.PopupMessage(eventArgs.User,
|
||||||
Loc.GetString("You see no way to install the {0}.", Owner.Name));
|
Loc.GetString("You see no way to install the {0}.", Owner.Name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +165,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
// TODO: sanity checks to see whether user is in range, user is still able-bodied, target is still the same, etc etc
|
// TODO: sanity checks to see whether user is in range, user is still able-bodied, target is still the same, etc etc
|
||||||
if (!_optionsCache.TryGetValue(key, out var targetObject))
|
if (!_optionsCache.TryGetValue(key, out var targetObject))
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(_bodyManagerComponentCache.Owner, _performerCache,
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache,
|
||||||
Loc.GetString("You see no useful way to use the {0} anymore.", Owner.Name));
|
Loc.GetString("You see no useful way to use the {0} anymore.", Owner.Name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -177,10 +175,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
? Loc.GetString("You jam the {0} inside {1:them}.", ContainedMechanism.Name, _performerCache)
|
? Loc.GetString("You jam the {0} inside {1:them}.", ContainedMechanism.Name, _performerCache)
|
||||||
: Loc.GetString("You can't fit it in!");
|
: Loc.GetString("You can't fit it in!");
|
||||||
|
|
||||||
_sharedNotifyManager.PopupMessage(
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache, message);
|
||||||
_bodyManagerComponentCache.Owner,
|
|
||||||
_performerCache,
|
|
||||||
message);
|
|
||||||
|
|
||||||
// TODO: {1:theName}
|
// TODO: {1:theName}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ using Robust.Server.Interfaces.GameObjects;
|
|||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -34,8 +33,6 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class SurgeryToolComponent : Component, ISurgeon, IAfterInteract
|
public class SurgeryToolComponent : Component, ISurgeon, IAfterInteract
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "SurgeryTool";
|
public override string Name => "SurgeryTool";
|
||||||
public override uint? NetID => ContentNetIDs.SURGERY;
|
public override uint? NetID => ContentNetIDs.SURGERY;
|
||||||
|
|
||||||
@@ -259,9 +256,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sharedNotifyManager.PopupMessage(
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache,
|
||||||
_bodyManagerComponentCache.Owner,
|
|
||||||
_performerCache,
|
|
||||||
Loc.GetString("You see no useful way to use {0:theName}.", Owner));
|
Loc.GetString("You see no useful way to use {0:theName}.", Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,9 +267,7 @@ namespace Content.Server.GameObjects.Components.Body
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sharedNotifyManager.PopupMessage(
|
_bodyManagerComponentCache.Owner.PopupMessage(_performerCache,
|
||||||
_bodyManagerComponentCache.Owner,
|
|
||||||
_performerCache,
|
|
||||||
Loc.GetString("You see no useful way to use {0:theName} anymore.", Owner));
|
Loc.GetString("You see no useful way to use {0:theName} anymore.", Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ using Content.Server.GameObjects.Components.Mobs;
|
|||||||
using Content.Server.GameObjects.Components.Mobs.State;
|
using Content.Server.GameObjects.Components.Mobs.State;
|
||||||
using Content.Server.GameObjects.Components.Strap;
|
using Content.Server.GameObjects.Components.Strap;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.GameObjects.Components.Buckle;
|
using Content.Shared.GameObjects.Components.Buckle;
|
||||||
using Content.Shared.GameObjects.Components.Mobs;
|
using Content.Shared.GameObjects.Components.Mobs;
|
||||||
using Content.Shared.GameObjects.Components.Strap;
|
using Content.Shared.GameObjects.Components.Strap;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Verbs;
|
using Content.Shared.GameObjects.Verbs;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -38,7 +38,6 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
|
|
||||||
private int _size;
|
private int _size;
|
||||||
@@ -174,18 +173,16 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!ActionBlockerSystem.CanInteract(user))
|
if (!ActionBlockerSystem.CanInteract(user))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user,
|
user.PopupMessage(Loc.GetString("You can't do that!"));
|
||||||
Loc.GetString("You can't do that!"));
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!to.TryGetComponent(out strap))
|
if (!to.TryGetComponent(out strap))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user,
|
var message = Loc.GetString(Owner == user
|
||||||
Loc.GetString(Owner == user
|
? "You can't buckle yourself there!"
|
||||||
? "You can't buckle yourself there!"
|
: "You can't buckle {0:them} there!", Owner);
|
||||||
: "You can't buckle {0:them} there!", Owner));
|
Owner.PopupMessage(user, message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -195,8 +192,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!Owner.InRangeUnobstructed(strap, _range, predicate: Ignored, popup: true))
|
if (!Owner.InRangeUnobstructed(strap, _range, predicate: Ignored, popup: true))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(strap.Owner, user,
|
strap.Owner.PopupMessage(user, Loc.GetString("You can't reach there!"));
|
||||||
Loc.GetString("You can't reach there!"));
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -208,7 +204,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
if (!ContainerHelpers.TryGetContainer(strap.Owner, out var strapContainer) ||
|
if (!ContainerHelpers.TryGetContainer(strap.Owner, out var strapContainer) ||
|
||||||
ownerContainer != strapContainer)
|
ownerContainer != strapContainer)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(strap.Owner, user, Loc.GetString("You can't reach there!"));
|
strap.Owner.PopupMessage(user, Loc.GetString("You can't reach there!"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -216,18 +212,16 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!user.HasComponent<HandsComponent>())
|
if (!user.HasComponent<HandsComponent>())
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user,
|
user.PopupMessage(Loc.GetString("You don't have hands!"));
|
||||||
Loc.GetString("You don't have hands!"));
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Buckled)
|
if (Buckled)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user,
|
var message = Loc.GetString(Owner == user
|
||||||
Loc.GetString(Owner == user
|
? "You are already buckled in!"
|
||||||
? "You are already buckled in!"
|
: "{0:They} are already buckled in!", Owner);
|
||||||
: "{0:They} are already buckled in!", Owner));
|
Owner.PopupMessage(user, message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -237,10 +231,10 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
{
|
{
|
||||||
if (parent == user.Transform)
|
if (parent == user.Transform)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user,
|
var message = Loc.GetString(Owner == user
|
||||||
Loc.GetString(Owner == user
|
? "You can't buckle yourself there!"
|
||||||
? "You can't buckle yourself there!"
|
: "You can't buckle {0:them} there!", Owner);
|
||||||
: "You can't buckle {0:them} there!", Owner));
|
Owner.PopupMessage(user, message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -250,10 +244,10 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!strap.HasSpace(this))
|
if (!strap.HasSpace(this))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user,
|
var message = Loc.GetString(Owner == user
|
||||||
Loc.GetString(Owner == user
|
? "You can't fit there!"
|
||||||
? "You can't fit there!"
|
: "{0:They} can't fit there!", Owner);
|
||||||
: "{0:They} can't fit there!", Owner));
|
Owner.PopupMessage(user, message);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -284,10 +278,10 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!strap.TryAdd(this))
|
if (!strap.TryAdd(this))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user,
|
var message = Loc.GetString(Owner == user
|
||||||
Loc.GetString(Owner == user
|
? "You can't buckle yourself there!"
|
||||||
? "You can't buckle yourself there!"
|
: "You can't buckle {0:them} there!", Owner);
|
||||||
: "You can't buckle {0:them} there!", Owner));
|
Owner.PopupMessage(user, message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +332,7 @@ namespace Content.Server.GameObjects.Components.Buckle
|
|||||||
|
|
||||||
if (!ActionBlockerSystem.CanInteract(user))
|
if (!ActionBlockerSystem.CanInteract(user))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, user,
|
user.PopupMessage(Loc.GetString("You can't do that!"));
|
||||||
Loc.GetString("You can't do that!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects.Components.Chemistry.ChemMaster;
|
using Content.Shared.GameObjects.Components.Chemistry.ChemMaster;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
@@ -43,8 +43,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[ComponentReference(typeof(IInteractUsing))]
|
[ComponentReference(typeof(IInteractUsing))]
|
||||||
public class ChemMasterComponent : SharedChemMasterComponent, IActivate, IInteractUsing, ISolutionChange
|
public class ChemMasterComponent : SharedChemMasterComponent, IActivate, IInteractUsing, ISolutionChange
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
[ViewVariables] private ContainerSlot _beakerContainer = default!;
|
[ViewVariables] private ContainerSlot _beakerContainer = default!;
|
||||||
[ViewVariables] private string _packPrototypeId = "";
|
[ViewVariables] private string _packPrototypeId = "";
|
||||||
|
|
||||||
@@ -367,8 +365,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
|
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,15 +387,13 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
{
|
{
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hands.GetActiveHand == null)
|
if (hands.GetActiveHand == null)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have nothing on your hand."));
|
||||||
Loc.GetString("You have nothing on your hand."));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,14 +402,12 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
{
|
{
|
||||||
if (HasBeaker)
|
if (HasBeaker)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("This ChemMaster already has a container in it."));
|
||||||
Loc.GetString("This ChemMaster already has a container in it."));
|
|
||||||
}
|
}
|
||||||
else if ((solution.Capabilities & SolutionCaps.FitsInDispenser) == 0) //Close enough to a chem master...
|
else if ((solution.Capabilities & SolutionCaps.FitsInDispenser) == 0) //Close enough to a chem master...
|
||||||
{
|
{
|
||||||
//If it can't fit in the chem master, don't put it in. For example, buckets and mop buckets can't fit.
|
//If it can't fit in the chem master, don't put it in. For example, buckets and mop buckets can't fit.
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("That can't fit in the ChemMaster."));
|
||||||
Loc.GetString("That can't fit in the ChemMaster."));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -424,8 +417,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You can't put this in the ChemMaster."));
|
||||||
Loc.GetString("You can't put this in the ChemMaster."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -435,7 +427,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
|
|
||||||
private void ClickSound()
|
private void ClickSound()
|
||||||
{
|
{
|
||||||
|
|
||||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using Content.Server.GameObjects.Components.Body.Circulatory;
|
using Content.Server.GameObjects.Components.Body.Circulatory;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects.Components.Chemistry;
|
using Content.Shared.GameObjects.Components.Chemistry;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -23,8 +22,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class InjectorComponent : SharedInjectorComponent, IAfterInteract, IUse
|
public class InjectorComponent : SharedInjectorComponent, IAfterInteract, IUse
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not the injector is able to draw from containers or if it's a single use
|
/// Whether or not the injector is able to draw from containers or if it's a single use
|
||||||
/// device that can only inject.
|
/// device that can only inject.
|
||||||
@@ -100,7 +97,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString(msg));
|
Owner.PopupMessage(user, Loc.GetString(msg));
|
||||||
|
|
||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
@@ -165,8 +162,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetBloodstream.EmptyVolume);
|
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetBloodstream.EmptyVolume);
|
||||||
if (realTransferAmount <= 0)
|
if (realTransferAmount <= 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Container full."));
|
||||||
Loc.GetString("Container full."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,8 +173,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Injected {0}u", removedSolution.TotalVolume));
|
||||||
Loc.GetString("Injected {0}u", removedSolution.TotalVolume));
|
|
||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,8 +189,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetSolution.EmptyVolume);
|
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetSolution.EmptyVolume);
|
||||||
if (realTransferAmount <= 0)
|
if (realTransferAmount <= 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Container full."));
|
||||||
Loc.GetString("Container full."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,8 +200,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Injected {0}u", removedSolution.TotalVolume));
|
||||||
Loc.GetString("Injected {0}u", removedSolution.TotalVolume));
|
|
||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,8 +216,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetSolution.CurrentVolume);
|
var realTransferAmount = ReagentUnit.Min(_transferAmount, targetSolution.CurrentVolume);
|
||||||
if (realTransferAmount <= 0)
|
if (realTransferAmount <= 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Container empty"));
|
||||||
Loc.GetString("Container empty"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,8 +227,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user,
|
Owner.PopupMessage(user, Loc.GetString("Drew {0}u", removedSolution.TotalVolume));
|
||||||
Loc.GetString("Drew {0}u", removedSolution.TotalVolume));
|
|
||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -19,8 +18,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
class PourableComponent : Component, IInteractUsing
|
class PourableComponent : Component, IInteractUsing
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Pourable";
|
public override string Name => "Pourable";
|
||||||
|
|
||||||
private ReagentUnit _transferAmount;
|
private ReagentUnit _transferAmount;
|
||||||
@@ -87,8 +84,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
var realTransferAmount = ReagentUnit.Min(fromPourable.TransferAmount, toSolution.EmptyVolume);
|
var realTransferAmount = ReagentUnit.Min(fromPourable.TransferAmount, toSolution.EmptyVolume);
|
||||||
if (realTransferAmount <= 0) //Special message if container is full
|
if (realTransferAmount <= 0) //Special message if container is full
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("Container is full"));
|
||||||
Loc.GetString("Container is full"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,8 +93,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
if (!toSolution.TryAddSolution(removedSolution))
|
if (!toSolution.TryAddSolution(removedSolution))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("Transferred {0}u", removedSolution.TotalVolume));
|
||||||
Loc.GetString("Transferred {0}u", removedSolution.TotalVolume));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser;
|
using Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
@@ -40,8 +40,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
[ComponentReference(typeof(IInteractUsing))]
|
[ComponentReference(typeof(IInteractUsing))]
|
||||||
public class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate, IInteractUsing, ISolutionChange
|
public class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate, IInteractUsing, ISolutionChange
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
[ViewVariables] private ContainerSlot _beakerContainer = default!;
|
[ViewVariables] private ContainerSlot _beakerContainer = default!;
|
||||||
[ViewVariables] private string _packPrototypeId = "";
|
[ViewVariables] private string _packPrototypeId = "";
|
||||||
|
|
||||||
@@ -280,8 +278,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
|
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,15 +300,13 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
{
|
{
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hands.GetActiveHand == null)
|
if (hands.GetActiveHand == null)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have nothing on your hand."));
|
||||||
Loc.GetString("You have nothing on your hand."));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,14 +315,12 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
{
|
{
|
||||||
if (HasBeaker)
|
if (HasBeaker)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("This dispenser already has a container in it."));
|
||||||
Loc.GetString("This dispenser already has a container in it."));
|
|
||||||
}
|
}
|
||||||
else if ((solution.Capabilities & SolutionCaps.FitsInDispenser) == 0)
|
else if ((solution.Capabilities & SolutionCaps.FitsInDispenser) == 0)
|
||||||
{
|
{
|
||||||
//If it can't fit in the dispenser, don't put it in. For example, buckets and mop buckets can't fit.
|
//If it can't fit in the dispenser, don't put it in. For example, buckets and mop buckets can't fit.
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("That can't fit in the dispenser."));
|
||||||
Loc.GetString("That can't fit in the dispenser."));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -337,8 +330,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You can't put this in the dispenser."));
|
||||||
Loc.GetString("You can't put this in the dispenser."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -348,11 +340,8 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
|||||||
|
|
||||||
private void ClickSound()
|
private void ClickSound()
|
||||||
{
|
{
|
||||||
|
|
||||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
|||||||
}
|
}
|
||||||
|
|
||||||
_group.AddConveyor(conveyor);
|
_group.AddConveyor(conveyor);
|
||||||
user?.PopupMessage(user, Loc.GetString("Conveyor linked."));
|
user?.PopupMessage(Loc.GetString("Conveyor linked."));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
@@ -11,13 +10,13 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using static Content.Shared.GameObjects.Components.Disposal.SharedDisposalRouterComponent;
|
using static Content.Shared.GameObjects.Components.Disposal.SharedDisposalRouterComponent;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Disposal
|
namespace Content.Server.GameObjects.Components.Disposal
|
||||||
@@ -27,7 +26,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
[ComponentReference(typeof(IDisposalTubeComponent))]
|
[ComponentReference(typeof(IDisposalTubeComponent))]
|
||||||
public class DisposalRouterComponent : DisposalJunctionComponent, IActivate
|
public class DisposalRouterComponent : DisposalJunctionComponent, IActivate
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
public override string Name => "DisposalRouter";
|
public override string Name => "DisposalRouter";
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
@@ -160,8 +158,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
|
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
@@ -12,7 +12,6 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -25,7 +24,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
[ComponentReference(typeof(IDisposalTubeComponent))]
|
[ComponentReference(typeof(IDisposalTubeComponent))]
|
||||||
public class DisposalTaggerComponent : DisposalTransitComponent, IActivate
|
public class DisposalTaggerComponent : DisposalTransitComponent, IActivate
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
public override string Name => "DisposalTagger";
|
public override string Name => "DisposalTagger";
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
@@ -128,8 +126,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
|
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||||
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components.Body;
|
using Content.Shared.GameObjects.Components.Body;
|
||||||
using Content.Shared.GameObjects.Components.Disposal;
|
using Content.Shared.GameObjects.Components.Disposal;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Verbs;
|
using Content.Shared.GameObjects.Verbs;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
@@ -43,7 +43,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
[ComponentReference(typeof(IInteractUsing))]
|
[ComponentReference(typeof(IInteractUsing))]
|
||||||
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IInteractUsing, IDragDropOn
|
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IInteractUsing, IDragDropOn
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
|
||||||
public override string Name => "DisposalUnit";
|
public override string Name => "DisposalUnit";
|
||||||
@@ -614,15 +613,13 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
{
|
{
|
||||||
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
|
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You can't do that!"));
|
||||||
Loc.GetString("You can't do that!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ContainerHelpers.IsInContainer(eventArgs.User))
|
if (ContainerHelpers.IsInContainer(eventArgs.User))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You can't reach there!"));
|
||||||
Loc.GetString("You can't reach there!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -633,8 +630,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
|
|
||||||
if (!eventArgs.User.HasComponent<IHandsComponent>())
|
if (!eventArgs.User.HasComponent<IHandsComponent>())
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You have no hands!"));
|
||||||
Loc.GetString("You have no hands!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using Content.Server.GameObjects.Components.VendingMachines;
|
|||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Shared.GameObjects.Components.Doors;
|
using Content.Shared.GameObjects.Components.Doors;
|
||||||
using Content.Shared.GameObjects.Components.Interactable;
|
using Content.Shared.GameObjects.Components.Interactable;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
@@ -438,16 +439,14 @@ namespace Content.Server.GameObjects.Components.Doors
|
|||||||
{
|
{
|
||||||
if (IsBolted())
|
if (IsBolted())
|
||||||
{
|
{
|
||||||
var notify = IoCManager.Resolve<IServerNotifyManager>();
|
Owner.PopupMessage(eventArgs.User,
|
||||||
notify.PopupMessage(Owner, eventArgs.User,
|
|
||||||
Loc.GetString("The airlock's bolts prevent it from being forced!"));
|
Loc.GetString("The airlock's bolts prevent it from being forced!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsPowered())
|
if (IsPowered())
|
||||||
{
|
{
|
||||||
var notify = IoCManager.Resolve<IServerNotifyManager>();
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("The powered motors block your efforts!"));
|
||||||
notify.PopupMessage(Owner, eventArgs.User, Loc.GetString("The powered motors block your efforts!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.GameObjects.Components.Chemistry;
|
using Content.Server.GameObjects.Components.Chemistry;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
@@ -17,7 +17,6 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
class SprayComponent : Component, IAfterInteract
|
class SprayComponent : Component, IAfterInteract
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||||
|
|
||||||
public override string Name => "Spray";
|
public override string Name => "Spray";
|
||||||
@@ -71,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
|||||||
{
|
{
|
||||||
if (CurrentVolume <= 0)
|
if (CurrentVolume <= 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, eventArgs.User, Loc.GetString("It's empty!"));
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("It's empty!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Items.Clothing;
|
using Content.Server.GameObjects.Components.Items.Clothing;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
|
||||||
using Content.Server.GameObjects.EntitySystems.Click;
|
using Content.Server.GameObjects.EntitySystems.Click;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects;
|
using Content.Server.Interfaces.GameObjects;
|
||||||
using Content.Shared.GameObjects.Components.Inventory;
|
using Content.Shared.GameObjects.Components.Inventory;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -29,7 +28,6 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
public class InventoryComponent : SharedInventoryComponent, IExAct, IEffectBlocker, IPressureProtection
|
public class InventoryComponent : SharedInventoryComponent, IExAct, IEffectBlocker, IPressureProtection
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private readonly Dictionary<Slots, ContainerSlot> _slotContainers = new Dictionary<Slots, ContainerSlot>();
|
private readonly Dictionary<Slots, ContainerSlot> _slotContainers = new Dictionary<Slots, ContainerSlot>();
|
||||||
@@ -432,7 +430,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
hands.PutInHand(clothing);
|
hands.PutInHand(clothing);
|
||||||
|
|
||||||
if (reason != null)
|
if (reason != null)
|
||||||
_serverNotifyManager.PopupMessageCursor(Owner, reason);
|
Owner.PopupMessageCursor(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.GameObjects.Components.ActionBlocking;
|
using Content.Server.GameObjects.Components.ActionBlocking;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components.GUI;
|
using Content.Shared.GameObjects.Components.GUI;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Verbs;
|
using Content.Shared.GameObjects.Verbs;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
@@ -17,7 +16,6 @@ using Robust.Server.Interfaces.Player;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
||||||
@@ -27,11 +25,9 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed class StrippableComponent : SharedStrippableComponent, IDragDrop
|
public sealed class StrippableComponent : SharedStrippableComponent, IDragDrop
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public const float StripDelay = 2f;
|
public const float StripDelay = 2f;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private BoundUserInterface? UserInterface => Owner.GetUIOrNull(StrippingUiKey.Key);
|
private BoundUserInterface? UserInterface => Owner.GetUIOrNull(StrippingUiKey.Key);
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -46,7 +42,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
Owner.EnsureComponent<InventoryComponent>();
|
Owner.EnsureComponent<InventoryComponent>();
|
||||||
Owner.EnsureComponent<HandsComponent>();
|
Owner.EnsureComponent<HandsComponent>();
|
||||||
Owner.EnsureComponent<CuffableComponent>();
|
Owner.EnsureComponent<CuffableComponent>();
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out CuffableComponent? cuffed))
|
if (Owner.TryGetComponent(out CuffableComponent? cuffed))
|
||||||
{
|
{
|
||||||
cuffed.OnCuffedStateChanged += UpdateSubscribed;
|
cuffed.OnCuffedStateChanged += UpdateSubscribed;
|
||||||
@@ -104,7 +100,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
private Dictionary<EntityUid, string> GetHandcuffs()
|
private Dictionary<EntityUid, string> GetHandcuffs()
|
||||||
{
|
{
|
||||||
var dictionary = new Dictionary<EntityUid, string>();
|
var dictionary = new Dictionary<EntityUid, string>();
|
||||||
|
|
||||||
if (!Owner.TryGetComponent(out CuffableComponent? cuffed))
|
if (!Owner.TryGetComponent(out CuffableComponent? cuffed))
|
||||||
{
|
{
|
||||||
return dictionary;
|
return dictionary;
|
||||||
@@ -173,13 +169,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("You aren't holding anything!"));
|
user.PopupMessageCursor(Loc.GetString("You aren't holding anything!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userHands.CanDrop(userHands.ActiveHand!))
|
if (!userHands.CanDrop(userHands.ActiveHand!))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("You can't drop that!"));
|
user.PopupMessageCursor(Loc.GetString("You can't drop that!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,13 +184,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (inventory.TryGetSlotItem(slot, out ItemComponent _))
|
if (inventory.TryGetSlotItem(slot, out ItemComponent _))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} already {0:have} something there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} already {0:have} something there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inventory.CanEquip(slot, item, false))
|
if (!inventory.CanEquip(slot, item, false))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} cannot equip that there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} cannot equip that there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,13 +234,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("You aren't holding anything!"));
|
user.PopupMessageCursor(Loc.GetString("You aren't holding anything!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userHands.CanDrop(userHands.ActiveHand!))
|
if (!userHands.CanDrop(userHands.ActiveHand!))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("You can't drop that!"));
|
user.PopupMessageCursor(Loc.GetString("You can't drop that!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,13 +249,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (hands.TryGetItem(hand, out var _))
|
if (hands.TryGetItem(hand, out var _))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} already {0:have} something there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} already {0:have} something there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hands.CanPutInHand(item, hand, false))
|
if (!hands.CanPutInHand(item, hand, false))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} cannot put that there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} cannot put that there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,13 +300,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (!inventory.TryGetSlotItem(slot, out ItemComponent itemToTake))
|
if (!inventory.TryGetSlotItem(slot, out ItemComponent itemToTake))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} {0:have} nothing there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} {0:have} nothing there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inventory.CanUnequip(slot, false))
|
if (!inventory.CanUnequip(slot, false))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} cannot unequip that!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} cannot unequip that!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,13 +351,13 @@ namespace Content.Server.GameObjects.Components.GUI
|
|||||||
|
|
||||||
if (!hands.TryGetItem(hand, out var heldItem))
|
if (!hands.TryGetItem(hand, out var heldItem))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} {0:have} nothing there!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} {0:have} nothing there!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hands.CanDrop(hand, false))
|
if (!hands.CanDrop(hand, false))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(user, Loc.GetString("{0:They} cannot drop that!", Owner));
|
user.PopupMessageCursor(Loc.GetString("{0:They} cannot drop that!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using Content.Server.Utility;
|
|||||||
using Content.Shared.GameObjects.Components.Gravity;
|
using Content.Shared.GameObjects.Components.Gravity;
|
||||||
using Content.Shared.GameObjects.Components.Interactable;
|
using Content.Shared.GameObjects.Components.Interactable;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
@@ -111,9 +112,8 @@ namespace Content.Server.GameObjects.Components.Gravity
|
|||||||
breakable.FixAllDamage();
|
breakable.FixAllDamage();
|
||||||
_intact = true;
|
_intact = true;
|
||||||
|
|
||||||
var notifyManager = IoCManager.Resolve<IServerNotifyManager>();
|
Owner.PopupMessage(eventArgs.User,
|
||||||
|
Loc.GetString("You repair {0:theName} with {1:theName}", Owner, eventArgs.Using));
|
||||||
notifyManager.PopupMessage(Owner, eventArgs.User, Loc.GetString("You repair {0:theName} with {1:theName}", Owner, eventArgs.Using));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Mobs;
|
using Content.Server.GameObjects.Components.Mobs;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Mobs;
|
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components.Instruments;
|
using Content.Shared.GameObjects.Components.Instruments;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
@@ -38,7 +37,6 @@ namespace Content.Server.GameObjects.Components.Instruments
|
|||||||
IUse,
|
IUse,
|
||||||
IThrown
|
IThrown
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
|
||||||
private static readonly TimeSpan OneSecAgo = TimeSpan.FromSeconds(-1);
|
private static readonly TimeSpan OneSecAgo = TimeSpan.FromSeconds(-1);
|
||||||
@@ -166,11 +164,11 @@ namespace Content.Server.GameObjects.Components.Instruments
|
|||||||
switch (_laggedBatches)
|
switch (_laggedBatches)
|
||||||
{
|
{
|
||||||
case (int) (MaxMidiLaggedBatches * (1 / 3d)) + 1:
|
case (int) (MaxMidiLaggedBatches * (1 / 3d)) + 1:
|
||||||
_notifyManager.PopupMessage(Owner, InstrumentPlayer.AttachedEntity,
|
Owner.PopupMessage(InstrumentPlayer.AttachedEntity,
|
||||||
"Your fingers are beginning to a cramp a little!");
|
"Your fingers are beginning to a cramp a little!");
|
||||||
break;
|
break;
|
||||||
case (int) (MaxMidiLaggedBatches * (2 / 3d)) + 1:
|
case (int) (MaxMidiLaggedBatches * (2 / 3d)) + 1:
|
||||||
_notifyManager.PopupMessage(Owner, InstrumentPlayer.AttachedEntity,
|
Owner.PopupMessage(InstrumentPlayer.AttachedEntity,
|
||||||
"Your fingers are seriously cramping up!");
|
"Your fingers are seriously cramping up!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -333,7 +331,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
|||||||
|
|
||||||
InstrumentPlayer = null;
|
InstrumentPlayer = null;
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, mob, "Your fingers cramp up from playing!");
|
Owner.PopupMessage(mob, "Your fingers cramp up from playing!");
|
||||||
}
|
}
|
||||||
|
|
||||||
_timer += delta;
|
_timer += delta;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ using Robust.Server.Interfaces.GameObjects;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -31,8 +30,6 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
internal sealed class HandheldLightComponent : SharedHandheldLightComponent, IUse, IExamine, IInteractUsing,
|
internal sealed class HandheldLightComponent : SharedHandheldLightComponent, IUse, IExamine, IInteractUsing,
|
||||||
IMapInit
|
IMapInit
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)] public float Wattage { get; set; } = 10;
|
[ViewVariables(VVAccess.ReadWrite)] public float Wattage { get; set; } = 10;
|
||||||
[ViewVariables] private ContainerSlot _cellContainer = default!;
|
[ViewVariables] private ContainerSlot _cellContainer = default!;
|
||||||
|
|
||||||
@@ -152,7 +149,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
{
|
{
|
||||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/button.ogg", Owner);
|
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/button.ogg", Owner);
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Cell missing..."));
|
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +159,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
if (Wattage > cell.CurrentCharge)
|
if (Wattage > cell.CurrentCharge)
|
||||||
{
|
{
|
||||||
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/button.ogg", Owner);
|
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/button.ogg", Owner);
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Dead cell..."));
|
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Server.Atmos;
|
|||||||
using Content.Server.GameObjects.Components.Chemistry;
|
using Content.Server.GameObjects.Components.Chemistry;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
using Content.Server.Interfaces.GameObjects;
|
using Content.Server.Interfaces.GameObjects;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
@@ -15,7 +14,6 @@ using Content.Shared.GameObjects.Components.Interactable;
|
|||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Interfaces;
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.Interfaces.Player;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -33,8 +31,6 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange
|
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Welder";
|
public override string Name => "Welder";
|
||||||
public override uint? NetID => ContentNetIDs.WELDER;
|
public override uint? NetID => ContentNetIDs.WELDER;
|
||||||
@@ -108,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
|
|
||||||
if (!CanWeld(DefaultFuelCost))
|
if (!CanWeld(DefaultFuelCost))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(target, user, "Can't weld!");
|
target.PopupMessage(user, "Can't weld!");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -137,13 +133,13 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
{
|
{
|
||||||
if (!WelderLit)
|
if (!WelderLit)
|
||||||
{
|
{
|
||||||
if(!silent) _notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder is turned off!"));
|
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder is turned off!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CanWeld(value))
|
if (!CanWeld(value))
|
||||||
{
|
{
|
||||||
if(!silent) _notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder does not have enough fuel for that!"));
|
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder does not have enough fuel for that!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +188,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
|
|
||||||
if (!CanLitWelder())
|
if (!CanLitWelder())
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder has no fuel left!"));
|
Owner.PopupMessage(user, Loc.GetString("The welder has no fuel left!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.GameObjects.Components.GUI;
|
using Content.Server.GameObjects.Components.GUI;
|
||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
using Content.Shared.GameObjects.Components.Items;
|
using Content.Shared.GameObjects.Components.Items;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
||||||
|
|
||||||
@@ -20,8 +19,6 @@ namespace Content.Server.GameObjects.Components.Items.Clothing
|
|||||||
[ComponentReference(typeof(IItemComponent))]
|
[ComponentReference(typeof(IItemComponent))]
|
||||||
public class ClothingComponent : ItemComponent, IUse
|
public class ClothingComponent : ItemComponent, IUse
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Clothing";
|
public override string Name => "Clothing";
|
||||||
public override uint? NetID => ContentNetIDs.CLOTHING;
|
public override uint? NetID => ContentNetIDs.CLOTHING;
|
||||||
|
|
||||||
@@ -112,7 +109,7 @@ namespace Content.Server.GameObjects.Components.Items.Clothing
|
|||||||
if (!inv.Equip(slot, this, true, out var reason))
|
if (!inv.Equip(slot, this, true, out var reason))
|
||||||
{
|
{
|
||||||
if (reason != null)
|
if (reason != null)
|
||||||
_serverNotifyManager.PopupMessage(Owner, user, reason);
|
Owner.PopupMessage(user, reason);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -15,8 +14,6 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class RCDAmmoComponent : Component, IAfterInteract, IExamine
|
public class RCDAmmoComponent : Component, IAfterInteract, IExamine
|
||||||
{
|
{
|
||||||
[Dependency] private IServerNotifyManager _serverNotifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "RCDAmmo";
|
public override string Name => "RCDAmmo";
|
||||||
|
|
||||||
//How much ammo we refill
|
//How much ammo we refill
|
||||||
@@ -43,17 +40,16 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
|
|
||||||
if (rcdComponent.maxAmmo - rcdComponent._ammo < refillAmmo)
|
if (rcdComponent.maxAmmo - rcdComponent._ammo < refillAmmo)
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(rcdComponent.Owner, eventArgs.User, "The RCD is full!");
|
rcdComponent.Owner.PopupMessage(eventArgs.User, Loc.GetString("The RCD is full!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rcdComponent._ammo = Math.Min(rcdComponent.maxAmmo, rcdComponent._ammo + refillAmmo);
|
rcdComponent._ammo = Math.Min(rcdComponent.maxAmmo, rcdComponent._ammo + refillAmmo);
|
||||||
_serverNotifyManager.PopupMessage(rcdComponent.Owner, eventArgs.User, "You refill the RCD.");
|
rcdComponent.Owner.PopupMessage(eventArgs.User, Loc.GetString("You refill the RCD."));
|
||||||
|
|
||||||
//Deleting a held item causes a lot of errors
|
//Deleting a held item causes a lot of errors
|
||||||
hands.Drop(Owner, false);
|
hands.Drop(Owner, false);
|
||||||
Owner.Delete();
|
Owner.Delete();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
using Content.Server.GameObjects.EntitySystems.DoAfter;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Utility;
|
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
@@ -30,7 +29,6 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "RCD";
|
public override string Name => "RCD";
|
||||||
private RcdMode _mode = 0; //What mode are we on? Can be floors, walls, deconstruct.
|
private RcdMode _mode = 0; //What mode are we on? Can be floors, walls, deconstruct.
|
||||||
@@ -86,12 +84,12 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
int mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default)
|
int mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default)
|
||||||
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
|
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
|
||||||
_mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
|
_mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"The RCD is now set to {this._mode} mode."); //Prints an overhead message above the RCD
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("The RCD is now set to {0} mode.", _mode)); //Prints an overhead message above the RCD
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), this._ammo));
|
message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), _ammo));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void AfterInteract(AfterInteractEventArgs eventArgs)
|
public async void AfterInteract(AfterInteractEventArgs eventArgs)
|
||||||
@@ -159,7 +157,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
//Less expensive checks first. Failing those ones, we need to check that the tile isn't obstructed.
|
//Less expensive checks first. Failing those ones, we need to check that the tile isn't obstructed.
|
||||||
if (_ammo <= 0)
|
if (_ammo <= 0)
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"The RCD is out of ammo!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("The RCD is out of ammo!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
case RcdMode.Floors:
|
case RcdMode.Floors:
|
||||||
if (!tile.Tile.IsEmpty)
|
if (!tile.Tile.IsEmpty)
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"You can only build a floor on space!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You can only build a floor on space!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,13 +193,13 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
//They tried to decon a turf but the turf is blocked
|
//They tried to decon a turf but the turf is blocked
|
||||||
if (eventArgs.Target == null && tile.IsBlockedTurf(true))
|
if (eventArgs.Target == null && tile.IsBlockedTurf(true))
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"That tile is obstructed!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("That tile is obstructed!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//They tried to decon a non-turf but it's not in the whitelist
|
//They tried to decon a non-turf but it's not in the whitelist
|
||||||
if (eventArgs.Target != null && !eventArgs.Target.TryGetComponent(out RCDDeconstructWhitelist rcd_decon))
|
if (eventArgs.Target != null && !eventArgs.Target.TryGetComponent(out RCDDeconstructWhitelist rcd_decon))
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"You can't deconstruct that!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You can't deconstruct that!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,25 +208,25 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
|||||||
case RcdMode.Walls:
|
case RcdMode.Walls:
|
||||||
if (tile.Tile.IsEmpty)
|
if (tile.Tile.IsEmpty)
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"Cannot build a wall on space!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("You cannot build a wall on space!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.IsBlockedTurf(true))
|
if (tile.IsBlockedTurf(true))
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"That tile is obstructed!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("That tile is obstructed!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case RcdMode.Airlock:
|
case RcdMode.Airlock:
|
||||||
if (tile.Tile.IsEmpty)
|
if (tile.Tile.IsEmpty)
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"Cannot build an airlock on space!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("Cannot build an airlock on space!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (tile.IsBlockedTurf(true))
|
if (tile.IsBlockedTurf(true))
|
||||||
{
|
{
|
||||||
_serverNotifyManager.PopupMessage(Owner, eventArgs.User, $"That tile is obstructed!");
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("That tile is obstructed!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -126,8 +126,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
|||||||
{
|
{
|
||||||
if (!reader.IsAllowed(user))
|
if (!reader.IsAllowed(user))
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IServerNotifyManager>()
|
Owner.PopupMessage(user, Loc.GetString("Access denied"));
|
||||||
.PopupMessage(Owner, user, Loc.GetString("Access denied"));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
using Content.Server.Interfaces.GameObjects;
|
using Content.Server.Interfaces.GameObjects;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
@@ -27,7 +26,6 @@ using Robust.Server.GameObjects.Components.Container;
|
|||||||
using Robust.Server.GameObjects.Components.UserInterface;
|
using Robust.Server.GameObjects.Components.UserInterface;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Server.Interfaces.Player;
|
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Content.Shared.GameObjects.Components.Body;
|
using Content.Shared.GameObjects.Components.Body;
|
||||||
@@ -44,8 +42,6 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private readonly RecipeManager _recipeManager = default!;
|
[Dependency] private readonly RecipeManager _recipeManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
|
||||||
|
|
||||||
#region YAMLSERIALIZE
|
#region YAMLSERIALIZE
|
||||||
private int _cookTimeDefault;
|
private int _cookTimeDefault;
|
||||||
@@ -206,8 +202,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
{
|
{
|
||||||
if (!Powered)
|
if (!Powered)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("It has no power!"));
|
||||||
Loc.GetString("It has no power!"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +210,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
|
|
||||||
if (itemEntity == null)
|
if (itemEntity == null)
|
||||||
{
|
{
|
||||||
eventArgs.User.PopupMessage(eventArgs.User, Loc.GetString("You have no active hand!"));
|
eventArgs.User.PopupMessage(Loc.GetString("You have no active hand!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,8 +231,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
var realTransferAmount = ReagentUnit.Min(attackPourable.TransferAmount, solution.EmptyVolume);
|
var realTransferAmount = ReagentUnit.Min(attackPourable.TransferAmount, solution.EmptyVolume);
|
||||||
if (realTransferAmount <= 0) //Special message if container is full
|
if (realTransferAmount <= 0) //Special message if container is full
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("Container is full"));
|
||||||
Loc.GetString("Container is full"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,15 +242,14 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, eventArgs.User,
|
Owner.PopupMessage(eventArgs.User, Loc.GetString("Transferred {0}u", removedSolution.TotalVolume));
|
||||||
Loc.GetString("Transferred {0}u", removedSolution.TotalVolume));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!itemEntity.TryGetComponent(typeof(ItemComponent), out var food))
|
if (!itemEntity.TryGetComponent(typeof(ItemComponent), out var food))
|
||||||
{
|
{
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, eventArgs.User, "That won't work!");
|
Owner.PopupMessage(eventArgs.User, "That won't work!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.MachineLinking
|
|||||||
{
|
{
|
||||||
if (transmitter == null)
|
if (transmitter == null)
|
||||||
{
|
{
|
||||||
user.PopupMessage(user, Loc.GetString("Signal not set."));
|
user.PopupMessage(Loc.GetString("Signal not set."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
|||||||
hands.StopPull();
|
hands.StopPull();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
player.PopupMessage(player, msg.Effect.ToString());
|
player.PopupMessage(msg.Effect.ToString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
canVault = CanVault(eventArgs.User, eventArgs.Dropped, eventArgs.Target, out reason);
|
canVault = CanVault(eventArgs.User, eventArgs.Dropped, eventArgs.Target, out reason);
|
||||||
|
|
||||||
if (!canVault)
|
if (!canVault)
|
||||||
eventArgs.User.PopupMessage(eventArgs.User, reason);
|
eventArgs.User.PopupMessage(reason);
|
||||||
|
|
||||||
return canVault;
|
return canVault;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,13 +130,13 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
|
|
||||||
if (!Opened)
|
if (!Opened)
|
||||||
{
|
{
|
||||||
target.PopupMessage(target, Loc.GetString("Open it first!"));
|
target.PopupMessage(Loc.GetString("Open it first!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_contents.CurrentVolume.Float() <= 0)
|
if (_contents.CurrentVolume.Float() <= 0)
|
||||||
{
|
{
|
||||||
target.PopupMessage(target, Loc.GetString("It's empty!"));
|
target.PopupMessage(Loc.GetString("It's empty!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,14 +151,14 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
{
|
{
|
||||||
if (_useSound == null) return false;
|
if (_useSound == null) return false;
|
||||||
EntitySystem.Get<AudioSystem>().PlayFromEntity(_useSound, target, AudioParams.Default.WithVolume(-2f));
|
EntitySystem.Get<AudioSystem>().PlayFromEntity(_useSound, target, AudioParams.Default.WithVolume(-2f));
|
||||||
target.PopupMessage(target, Loc.GetString("Slurp"));
|
target.PopupMessage(Loc.GetString("Slurp"));
|
||||||
UpdateAppearance();
|
UpdateAppearance();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Stomach was full or can't handle whatever solution we have.
|
//Stomach was full or can't handle whatever solution we have.
|
||||||
_contents.TryAddSolution(split);
|
_contents.TryAddSolution(split);
|
||||||
target.PopupMessage(target, Loc.GetString("You've had enough {0}!", Owner.Name));
|
target.PopupMessage(Loc.GetString("You've had enough {0}!", Owner.Name));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
{
|
{
|
||||||
if (_utensilsNeeded != UtensilType.None)
|
if (_utensilsNeeded != UtensilType.None)
|
||||||
{
|
{
|
||||||
eventArgs.User.PopupMessage(eventArgs.User, Loc.GetString("You need to use a {0} to eat that!", _utensilsNeeded));
|
eventArgs.User.PopupMessage(Loc.GetString("You need to use a {0} to eat that!", _utensilsNeeded));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
|||||||
|
|
||||||
if (UsesRemaining <= 0)
|
if (UsesRemaining <= 0)
|
||||||
{
|
{
|
||||||
user.PopupMessage(user, Loc.GetString("{0:TheName} is empty!", Owner));
|
user.PopupMessage(Loc.GetString("{0:TheName} is empty!", Owner));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Server.GameObjects.Components.NodeContainer;
|
|||||||
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
|
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
|
||||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||||
using Content.Server.GameObjects.Components.Power.PowerNetComponents;
|
using Content.Server.GameObjects.Components.Power.PowerNetComponents;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components.Power.AME;
|
using Content.Shared.GameObjects.Components.Power.AME;
|
||||||
@@ -20,11 +19,11 @@ using Robust.Shared.Audio;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Power.AME
|
namespace Content.Server.GameObjects.Components.Power.AME
|
||||||
{
|
{
|
||||||
@@ -33,8 +32,6 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
[ComponentReference(typeof(IInteractUsing))]
|
[ComponentReference(typeof(IInteractUsing))]
|
||||||
public class AMEControllerComponent : SharedAMEControllerComponent, IActivate, IInteractUsing
|
public class AMEControllerComponent : SharedAMEControllerComponent, IActivate, IInteractUsing
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(AMEControllerUiKey.Key);
|
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(AMEControllerUiKey.Key);
|
||||||
[ViewVariables] private bool _injecting;
|
[ViewVariables] private bool _injecting;
|
||||||
[ViewVariables] public int InjectionAmount;
|
[ViewVariables] public int InjectionAmount;
|
||||||
@@ -117,8 +114,7 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
|
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,15 +324,13 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
{
|
{
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
if (!args.User.TryGetComponent(out IHandsComponent? hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hands.GetActiveHand == null)
|
if (hands.GetActiveHand == null)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have nothing on your hand."));
|
||||||
Loc.GetString("You have nothing on your hand."));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,22 +339,19 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
{
|
{
|
||||||
if (HasJar)
|
if (HasJar)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("The controller already has a jar loaded."));
|
||||||
Loc.GetString("The controller already has a jar loaded."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_jarSlot.Insert(activeHandEntity);
|
_jarSlot.Insert(activeHandEntity);
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You insert the jar into the fuel slot."));
|
||||||
Loc.GetString("You insert the jar into the fuel slot."));
|
|
||||||
UpdateUserInterface();
|
UpdateUserInterface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You can't put that in the controller..."));
|
||||||
Loc.GetString("You can't put that in the controller..."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Content.Server.GameObjects.Components.Interactable;
|
using Content.Server.GameObjects.Components.Interactable;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Shared.GameObjects.Components.Interactable;
|
using Content.Shared.GameObjects.Components.Interactable;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
@@ -10,6 +9,7 @@ using Robust.Shared.Interfaces.Map;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Power.AME
|
namespace Content.Server.GameObjects.Components.Power.AME
|
||||||
{
|
{
|
||||||
@@ -19,15 +19,14 @@ namespace Content.Server.GameObjects.Components.Power.AME
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
public override string Name => "AMEPart";
|
public override string Name => "AMEPart";
|
||||||
|
|
||||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args)
|
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args)
|
||||||
{
|
{
|
||||||
if (!args.User.TryGetComponent(out IHandsComponent hands))
|
if (!args.User.TryGetComponent(out IHandsComponent hands))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, args.User,
|
Owner.PopupMessage(args.User, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Mobs;
|
using Content.Server.GameObjects.Components.Mobs;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.GameObjects.Components.Damage;
|
using Content.Shared.GameObjects.Components.Damage;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
@@ -63,8 +62,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
|||||||
case BeginDeconstructCompMsg msg:
|
case BeginDeconstructCompMsg msg:
|
||||||
if (!msg.BlockDeconstruct && !(_lightBulbContainer.ContainedEntity is null))
|
if (!msg.BlockDeconstruct && !(_lightBulbContainer.ContainedEntity is null))
|
||||||
{
|
{
|
||||||
var notifyManager = IoCManager.Resolve<IServerNotifyManager>();
|
Owner.PopupMessage(msg.User, Loc.GetString("Remove the bulb."));
|
||||||
notifyManager.PopupMessage(Owner, msg.User, "Remove the bulb.");
|
|
||||||
msg.BlockDeconstruct = true;
|
msg.BlockDeconstruct = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
@@ -13,7 +14,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
class RadioComponent : Component, IUse, IListen
|
class RadioComponent : Component, IUse, IListen
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Radio";
|
public override string Name => "Radio";
|
||||||
|
|
||||||
@@ -60,11 +60,11 @@ namespace Content.Server.GameObjects.Components
|
|||||||
RadioOn = !RadioOn;
|
RadioOn = !RadioOn;
|
||||||
if(RadioOn)
|
if(RadioOn)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, eventArgs.User, "The radio is now on.");
|
Owner.PopupMessage(eventArgs.User, "The radio is now on.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner, eventArgs.User, "The radio is now off.");
|
Owner.PopupMessage(eventArgs.User, "The radio is now off.");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.Verbs;
|
using Content.Shared.GameObjects.Verbs;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
@@ -14,8 +13,6 @@ namespace Content.Server.GameObjects.Components.Rotatable
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class FlippableComponent : Component
|
public class FlippableComponent : Component
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Flippable";
|
public override string Name => "Flippable";
|
||||||
|
|
||||||
private string? _entity;
|
private string? _entity;
|
||||||
@@ -25,7 +22,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
|
|||||||
if (Owner.TryGetComponent(out ICollidableComponent? collidable) &&
|
if (Owner.TryGetComponent(out ICollidableComponent? collidable) &&
|
||||||
collidable.Anchored)
|
collidable.Anchored)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user, Loc.GetString("It's stuck."));
|
Owner.PopupMessage(user, Loc.GetString("It's stuck."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using Content.Server.Interfaces;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
|
||||||
using Content.Shared.GameObjects.Verbs;
|
using Content.Shared.GameObjects.Verbs;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
|
||||||
@@ -13,8 +12,6 @@ namespace Content.Server.GameObjects.Components.Rotatable
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class RotatableComponent : Component
|
public class RotatableComponent : Component
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Rotatable";
|
public override string Name => "Rotatable";
|
||||||
|
|
||||||
private void TryRotate(IEntity user, Angle angle)
|
private void TryRotate(IEntity user, Angle angle)
|
||||||
@@ -23,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
|
|||||||
{
|
{
|
||||||
if (collidable.Anchored)
|
if (collidable.Anchored)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, user, Loc.GetString("It's stuck."));
|
Owner.PopupMessage(user, Loc.GetString("It's stuck."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Shared.GameObjects.EntitySystems;
|
|||||||
using Content.Shared.Interfaces;
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Timers;
|
using Robust.Shared.Timers;
|
||||||
@@ -19,8 +18,6 @@ namespace Content.Server.GameObjects.Components.Stack
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class StackComponent : SharedStackComponent, IInteractUsing, IExamine
|
public class StackComponent : SharedStackComponent, IInteractUsing, IExamine
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!;
|
|
||||||
|
|
||||||
private bool _throwIndividually = false;
|
private bool _throwIndividually = false;
|
||||||
|
|
||||||
public override int Count
|
public override int Count
|
||||||
@@ -82,20 +79,19 @@ namespace Content.Server.GameObjects.Components.Stack
|
|||||||
|
|
||||||
if (toTransfer > 0)
|
if (toTransfer > 0)
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(popupPos, eventArgs.User, $"+{toTransfer}");
|
popupPos.PopupMessage(eventArgs.User, $"+{toTransfer}");
|
||||||
|
|
||||||
if (stack.AvailableSpace == 0)
|
if (stack.AvailableSpace == 0)
|
||||||
{
|
{
|
||||||
|
Timer.Spawn(300, () => popupPos.PopupMessage(eventArgs.User, "Stack is now full."));
|
||||||
Timer.Spawn(300, () => _sharedNotifyManager.PopupMessage(popupPos, eventArgs.User, "Stack is now full."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (toTransfer == 0 && stack.AvailableSpace == 0)
|
else if (toTransfer == 0 && stack.AvailableSpace == 0)
|
||||||
{
|
{
|
||||||
_sharedNotifyManager.PopupMessage(popupPos, eventArgs.User, "Stack is already full.");
|
popupPos.PopupMessage(eventArgs.User, "Stack is already full.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
public class FlashComponent : MeleeWeaponComponent, IUse, IExamine
|
public class FlashComponent : MeleeWeaponComponent, IUse, IExamine
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Flash";
|
public override string Name => "Flash";
|
||||||
|
|
||||||
@@ -101,7 +100,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "burnt");
|
sprite.LayerSetState(0, "burnt");
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("The flash burns out!"));
|
Owner.PopupMessage(user, Loc.GetString("The flash burns out!"));
|
||||||
}
|
}
|
||||||
else if (!_flashing)
|
else if (!_flashing)
|
||||||
{
|
{
|
||||||
@@ -155,7 +154,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
|
|
||||||
if (entity != user)
|
if (entity != user)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(user, entity, Loc.GetString("{0:TheName} blinds you with {1:theName}", user, Owner));
|
user.PopupMessage(entity, Loc.GetString("{0:TheName} blinds you with {1:theName}", user, Owner));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
|
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||||
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
public override string Name => "Stunbaton";
|
public override string Name => "Stunbaton";
|
||||||
|
|
||||||
@@ -165,14 +164,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
{
|
{
|
||||||
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
|
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
|
||||||
|
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Cell missing..."));
|
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cell.CurrentCharge < EnergyPerUse)
|
if (cell.CurrentCharge < EnergyPerUse)
|
||||||
{
|
{
|
||||||
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
|
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
|
||||||
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Dead cell..."));
|
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
|||||||
stun.Paralyze(3f);
|
stun.Paralyze(3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
user.PopupMessage(user, Loc.GetString("The gun blows up in your face!"));
|
user.PopupMessage(Loc.GetString("The gun blows up in your face!"));
|
||||||
|
|
||||||
Owner.Delete();
|
Owner.Delete();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ using System.Threading.Tasks;
|
|||||||
using Content.Server.GameObjects.Components.Interactable;
|
using Content.Server.GameObjects.Components.Interactable;
|
||||||
using Content.Server.GameObjects.Components.VendingMachines;
|
using Content.Server.GameObjects.Components.VendingMachines;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
using Content.Shared.GameObjects.Components.Interactable;
|
using Content.Shared.GameObjects.Components.Interactable;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Content.Shared.Utility;
|
using Content.Shared.Utility;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -36,7 +36,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
public class WiresComponent : SharedWiresComponent, IInteractUsing, IExamine, IMapInit
|
public class WiresComponent : SharedWiresComponent, IInteractUsing, IExamine, IMapInit
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
private AudioSystem _audioSystem = default!;
|
private AudioSystem _audioSystem = default!;
|
||||||
|
|
||||||
@@ -384,15 +383,13 @@ namespace Content.Server.GameObjects.Components
|
|||||||
|
|
||||||
if (!player.TryGetComponent(out IHandsComponent? handsComponent))
|
if (!player.TryGetComponent(out IHandsComponent? handsComponent))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, player,
|
Owner.PopupMessage(player, Loc.GetString("You have no hands."));
|
||||||
Loc.GetString("You have no hands."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.InRangeUnobstructed(Owner))
|
if (!player.InRangeUnobstructed(Owner))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(Owner.Transform.GridPosition, player,
|
Owner.PopupMessage(player, Loc.GetString("You can't reach there!"));
|
||||||
Loc.GetString("You can't reach there!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,8 +402,7 @@ namespace Content.Server.GameObjects.Components
|
|||||||
case WiresAction.Cut:
|
case WiresAction.Cut:
|
||||||
if (tool == null || !tool.HasQuality(ToolQuality.Cutting))
|
if (tool == null || !tool.HasQuality(ToolQuality.Cutting))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(player,
|
player.PopupMessageCursor(Loc.GetString("You need to hold a wirecutter in your hand!"));
|
||||||
Loc.GetString("You need to hold a wirecutter in your hand!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,8 +413,7 @@ namespace Content.Server.GameObjects.Components
|
|||||||
case WiresAction.Mend:
|
case WiresAction.Mend:
|
||||||
if (tool == null || !tool.HasQuality(ToolQuality.Cutting))
|
if (tool == null || !tool.HasQuality(ToolQuality.Cutting))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(player,
|
player.PopupMessageCursor(Loc.GetString("You need to hold a wirecutter in your hand!"));
|
||||||
Loc.GetString("You need to hold a wirecutter in your hand!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,15 +424,13 @@ namespace Content.Server.GameObjects.Components
|
|||||||
case WiresAction.Pulse:
|
case WiresAction.Pulse:
|
||||||
if (tool == null || !tool.HasQuality(ToolQuality.Multitool))
|
if (tool == null || !tool.HasQuality(ToolQuality.Multitool))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(player,
|
player.PopupMessageCursor(Loc.GetString("You need to hold a multitool in your hand!"));
|
||||||
Loc.GetString("You need to hold a multitool in your hand!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wire.IsCut)
|
if (wire.IsCut)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessageCursor(player,
|
player.PopupMessageCursor(Loc.GetString("You can't pulse a wire that's been cut!"));
|
||||||
Loc.GetString("You can't pulse a wire that's been cut!"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ using Content.Server.GameObjects.Components.GUI;
|
|||||||
using Content.Server.GameObjects.Components.Items.Storage;
|
using Content.Server.GameObjects.Components.Items.Storage;
|
||||||
using Content.Server.GameObjects.Components.Stack;
|
using Content.Server.GameObjects.Components.Stack;
|
||||||
using Content.Server.GameObjects.EntitySystems.Click;
|
using Content.Server.GameObjects.EntitySystems.Click;
|
||||||
using Content.Server.Interfaces;
|
|
||||||
using Content.Server.Interfaces.GameObjects.Components.Items;
|
using Content.Server.Interfaces.GameObjects.Components.Items;
|
||||||
using Content.Server.Throw;
|
using Content.Server.Throw;
|
||||||
using Content.Shared.GameObjects.Components.Inventory;
|
using Content.Shared.GameObjects.Components.Inventory;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
|
using Content.Shared.Interfaces;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects.EntitySystemMessages;
|
using Robust.Server.GameObjects.EntitySystemMessages;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
@@ -28,7 +28,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
internal sealed class HandsSystem : EntitySystem
|
internal sealed class HandsSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
|
||||||
|
|
||||||
private const float ThrowForce = 1.5f; // Throwing force of mobs in Newtons
|
private const float ThrowForce = 1.5f; // Throwing force of mobs in Newtons
|
||||||
|
|
||||||
@@ -202,9 +201,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
if (!inventoryComp.TryGetSlotItem(equipementSlot, out ItemComponent equipmentItem)
|
if (!inventoryComp.TryGetSlotItem(equipementSlot, out ItemComponent equipmentItem)
|
||||||
|| !equipmentItem.Owner.TryGetComponent<ServerStorageComponent>(out var storageComponent))
|
|| !equipmentItem.Owner.TryGetComponent<ServerStorageComponent>(out var storageComponent))
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(plyEnt, plyEnt,
|
plyEnt.PopupMessage(Loc.GetString("You have no {0} to take something out of!",
|
||||||
Loc.GetString("You have no {0} to take something out of!",
|
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
|
||||||
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,9 +216,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
if (storageComponent.StoredEntities.Count == 0)
|
if (storageComponent.StoredEntities.Count == 0)
|
||||||
{
|
{
|
||||||
_notifyManager.PopupMessage(plyEnt, plyEnt,
|
plyEnt.PopupMessage(Loc.GetString("There's nothing in your {0} to take out!",
|
||||||
Loc.GetString("There's nothing in your {0} to take out!",
|
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
|
||||||
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
if (!InRange(coords, player.Transform.GridPosition))
|
if (!InRange(coords, player.Transform.GridPosition))
|
||||||
{
|
{
|
||||||
player.PopupMessage(player, Loc.GetString("You can't reach there!"));
|
player.PopupMessage(Loc.GetString("You can't reach there!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
if (!inRange && popup)
|
if (!inRange && popup)
|
||||||
{
|
{
|
||||||
var message = Loc.GetString("You can't reach there!");
|
var message = Loc.GetString("You can't reach there!");
|
||||||
origin.PopupMessage(origin, message);
|
origin.PopupMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return inRange;
|
return inRange;
|
||||||
@@ -244,7 +244,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
if (!inRange && popup)
|
if (!inRange && popup)
|
||||||
{
|
{
|
||||||
var message = Loc.GetString("You can't reach there!");
|
var message = Loc.GetString("You can't reach there!");
|
||||||
origin.PopupMessage(origin, message);
|
origin.PopupMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return inRange;
|
return inRange;
|
||||||
@@ -300,7 +300,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
if (!inRange && popup)
|
if (!inRange && popup)
|
||||||
{
|
{
|
||||||
var message = Loc.GetString("You can't reach there!");
|
var message = Loc.GetString("You can't reach there!");
|
||||||
origin.PopupMessage(origin, message);
|
origin.PopupMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return inRange;
|
return inRange;
|
||||||
@@ -355,7 +355,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
if (!inRange && popup)
|
if (!inRange && popup)
|
||||||
{
|
{
|
||||||
var message = Loc.GetString("You can't reach there!");
|
var message = Loc.GetString("You can't reach there!");
|
||||||
origin.PopupMessage(origin, message);
|
origin.PopupMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return inRange;
|
return inRange;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Content.Shared.Interfaces
|
|||||||
void PopupMessageCursor(IEntity viewer, string message);
|
void PopupMessageCursor(IEntity viewer, string message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class NotifyManagerExt
|
public static class SharedNotifyExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Pops up a message at the location of <see cref="source"/> for
|
/// Pops up a message at the location of <see cref="source"/> for
|
||||||
@@ -44,7 +44,8 @@ namespace Content.Shared.Interfaces
|
|||||||
/// <param name="message">The message to show.</param>
|
/// <param name="message">The message to show.</param>
|
||||||
public static void PopupMessage(this IEntity source, IEntity viewer, string message)
|
public static void PopupMessage(this IEntity source, IEntity viewer, string message)
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<ISharedNotifyManager>().PopupMessage(source, viewer, message);
|
var notifyManager = IoCManager.Resolve<ISharedNotifyManager>();
|
||||||
|
notifyManager.PopupMessage(source, viewer, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -56,5 +57,30 @@ namespace Content.Shared.Interfaces
|
|||||||
{
|
{
|
||||||
viewer.PopupMessage(viewer, message);
|
viewer.PopupMessage(viewer, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Makes a string of text float up from a location on a grid.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coordinates">Location on a grid that the message floats up from.</param>
|
||||||
|
/// <param name="viewer">The client attached entity that the message is being sent to.</param>
|
||||||
|
/// <param name="message">Text contents of the message.</param>
|
||||||
|
public static void PopupMessage(this GridCoordinates coordinates, IEntity viewer, string message)
|
||||||
|
{
|
||||||
|
var notifyManager = IoCManager.Resolve<ISharedNotifyManager>();
|
||||||
|
notifyManager.PopupMessage(coordinates, viewer, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Makes a string of text float up from a client's cursor.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="viewer">
|
||||||
|
/// The client attached entity that the message is being sent to.
|
||||||
|
/// </param>
|
||||||
|
/// <param name="message">Text contents of the message.</param>
|
||||||
|
public static void PopupMessageCursor(this IEntity viewer, string message)
|
||||||
|
{
|
||||||
|
var notifyManager = IoCManager.Resolve<ISharedNotifyManager>();
|
||||||
|
notifyManager.PopupMessageCursor(viewer, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user