Fix drone hat offset (#6978)

This commit is contained in:
Leon Friedrich
2022-03-04 18:02:53 +13:00
committed by GitHub
parent 255865b7b7
commit 593f890b73
9 changed files with 39 additions and 17 deletions

View File

@@ -1,7 +1,4 @@
using Content.Shared.Hands.Components;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using System.Collections.Generic;
namespace Content.Client.Hands
{
@@ -10,6 +7,12 @@ namespace Content.Client.Hands
[Friend(typeof(HandsSystem))]
public sealed class HandsComponent : SharedHandsComponent
{
/// <summary>
/// Whether or not to add in-hand sprites for held items. Some entities (e.g., drones) don't want these.
/// </summary>
[DataField("showInHands")]
public bool ShowInHands = true;
public HandsGui? Gui { get; set; }
/// <summary>

View File

@@ -203,6 +203,9 @@ namespace Content.Client.Hands
if (uid == _playerManager.LocalPlayer?.ControlledEntity)
UpdateGui();
if (!handComp.ShowInHands)
return;
// Remove old layers. We could also just set them to invisible, but as items may add arbitrary layers, this
// may eventually bloat the player with lots of layers.
if (handComp.RevealedLayers.TryGetValue(hand.Location, out var revealedLayers))