Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -3,9 +3,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Client.Clothing;
using Content.Shared.CharacterAppearance;
using Content.Shared.Chemistry;
using Content.Shared.Inventory;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.EntitySystems;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
@@ -24,9 +22,9 @@ namespace Content.Client.Inventory
[ComponentReference(typeof(SharedInventoryComponent))]
public class ClientInventoryComponent : SharedInventoryComponent
{
private readonly Dictionary<Slots, IEntity> _slots = new();
private readonly Dictionary<Slots, EntityUid> _slots = new();
public IReadOnlyDictionary<Slots, IEntity> AllSlots => _slots;
public IReadOnlyDictionary<Slots, EntityUid> AllSlots => _slots;
[ViewVariables] public InventoryInterfaceController InterfaceController { get; private set; } = default!;
@@ -78,9 +76,9 @@ namespace Content.Client.Inventory
}
}
public override bool IsEquipped(IEntity item)
public override bool IsEquipped(EntityUid item)
{
return item != null && _slots.Values.Any(e => e == item);
return item != default && _slots.Values.Any(e => e == item);
}
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
@@ -92,9 +90,9 @@ namespace Content.Client.Inventory
var doneSlots = new HashSet<Slots>();
foreach (var (slot, entityUid) in state.Entities)
foreach (var (slot, entity) in state.Entities)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetEntity(entityUid, out var entity))
if (!IoCManager.Resolve<IEntityManager>().EntityExists(entity))
{
continue;
}
@@ -108,9 +106,7 @@ namespace Content.Client.Inventory
if (state.HoverEntity != null)
{
var (slot, (entityUid, fits)) = state.HoverEntity.Value;
var entity = IoCManager.Resolve<IEntityManager>().GetEntity(entityUid);
var (slot, (entity, fits)) = state.HoverEntity.Value;
InterfaceController?.HoverInSlot(slot, entity, fits);
}
@@ -126,14 +122,14 @@ namespace Content.Client.Inventory
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(((IComponent) this).Owner);
}
private void _setSlot(Slots slot, IEntity entity)
private void _setSlot(Slots slot, EntityUid entity)
{
SetSlotVisuals(slot, entity);
InterfaceController?.AddToSlot(slot, entity);
}
internal void SetSlotVisuals(Slots slot, IEntity entity)
internal void SetSlotVisuals(Slots slot, EntityUid entity)
{
if (_sprite == null)
{
@@ -230,12 +226,12 @@ namespace Content.Client.Inventory
_playerAttached = true;
}
public bool TryGetSlot(Slots slot, [NotNullWhen(true)] out IEntity? item)
public bool TryGetSlot(Slots slot, [NotNullWhen(true)] out EntityUid item)
{
return _slots.TryGetValue(slot, out item);
}
public bool TryFindItemSlots(IEntity item, [NotNullWhen(true)] out Slots? slots)
public bool TryFindItemSlots(EntityUid item, [NotNullWhen(true)] out Slots? slots)
{
slots = null;

View File

@@ -1,5 +1,4 @@
using Content.Client.HUD;
using Content.Client.Items.Components;
using Content.Shared.Input;
using Content.Shared.Inventory;
using Content.Shared.Movement.EntitySystems;
@@ -36,7 +35,7 @@ namespace Content.Client.Inventory
// jesus christ, this is duplicated to server/client, should really just be shared..
private void OnSlipAttemptEvent(EntityUid uid, ClientInventoryComponent component, SlipAttemptEvent args)
{
if (component.TryGetSlot(EquipmentSlotDefines.Slots.SHOES, out IEntity? shoes))
if (component.TryGetSlot(EquipmentSlotDefines.Slots.SHOES, out EntityUid shoes))
{
RaiseLocalEvent(shoes, args, false);
}
@@ -46,7 +45,7 @@ namespace Content.Client.Inventory
{
foreach (var (_, ent) in component.AllSlots)
{
if (ent != null)
if (ent != default)
{
RaiseLocalEvent(ent, args, false);
}

View File

@@ -3,10 +3,8 @@ using System.Linq;
using Content.Client.HUD;
using Content.Client.Items.Managers;
using Content.Client.Items.UI;
using Content.Shared;
using Content.Shared.CCVar;
using JetBrains.Annotations;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -15,7 +13,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using static Content.Shared.Inventory.EquipmentSlotDefines;
using static Robust.Client.UserInterface.Controls.BoxContainer;
@@ -155,7 +152,7 @@ namespace Content.Client.Inventory
return buttons;
}
public override void AddToSlot(Slots slot, IEntity entity)
public override void AddToSlot(Slots slot, EntityUid entity)
{
base.AddToSlot(slot, entity);
@@ -184,7 +181,7 @@ namespace Content.Client.Inventory
}
}
public override void HoverInSlot(Slots slot, IEntity entity, bool fits)
public override void HoverInSlot(Slots slot, EntityUid entity, bool fits)
{
base.HoverInSlot(slot, entity, fits);
@@ -213,7 +210,7 @@ namespace Content.Client.Inventory
private void ClearButton(ItemSlotButton button, Slots slot)
{
button.OnPressed = (e) => AddToInventory(e, slot);
_itemSlotManager.SetItemSlot(button, null);
_itemSlotManager.SetItemSlot(button, default);
}
public override void PlayerAttached()

View File

@@ -46,11 +46,11 @@ namespace Content.Client.Inventory
/// specified slot, if any. Empty if none.</returns>
public abstract IEnumerable<ItemSlotButton> GetItemSlotButtons(EquipmentSlotDefines.Slots slot);
public virtual void AddToSlot(EquipmentSlotDefines.Slots slot, IEntity entity)
public virtual void AddToSlot(EquipmentSlotDefines.Slots slot, EntityUid entity)
{
}
public virtual void HoverInSlot(EquipmentSlotDefines.Slots slot, IEntity entity, bool fits)
public virtual void HoverInSlot(EquipmentSlotDefines.Slots slot, EntityUid entity, bool fits)
{
}