Hide doafters if you're in a container (#29487)
* Hide doafters if you're in a container * Out of the loop --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@ using Robust.Client.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Client.DoAfter;
|
||||
|
||||
@@ -19,6 +20,7 @@ public sealed class DoAfterOverlay : Overlay
|
||||
private readonly SharedTransformSystem _transform;
|
||||
private readonly MetaDataSystem _meta;
|
||||
private readonly ProgressColorSystem _progressColor;
|
||||
private readonly SharedContainerSystem _container;
|
||||
|
||||
private readonly Texture _barTexture;
|
||||
private readonly ShaderInstance _unshadedShader;
|
||||
@@ -41,6 +43,7 @@ public sealed class DoAfterOverlay : Overlay
|
||||
_player = player;
|
||||
_transform = _entManager.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
|
||||
_meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>();
|
||||
_container = _entManager.EntitySysManager.GetEntitySystem<SharedContainerSystem>();
|
||||
_progressColor = _entManager.System<ProgressColorSystem>();
|
||||
var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
|
||||
_barTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite);
|
||||
@@ -98,11 +101,13 @@ public sealed class DoAfterOverlay : Overlay
|
||||
|
||||
var offset = 0f;
|
||||
|
||||
var isInContainer = _container.IsEntityOrParentInContainer(uid, meta, xform);
|
||||
|
||||
foreach (var doAfter in comp.DoAfters.Values)
|
||||
{
|
||||
// Hide some DoAfters from other players for stealthy actions (ie: thieving gloves)
|
||||
var alpha = 1f;
|
||||
if (doAfter.Args.Hidden)
|
||||
if (doAfter.Args.Hidden || isInContainer)
|
||||
{
|
||||
if (uid != localEnt)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user