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

@@ -1,4 +1,3 @@
using Content.Client.Stylesheets;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
@@ -14,7 +13,7 @@ namespace Content.Client.ContextMenu.UI
/// <summary>
/// The entity that can be accessed by interacting with this element.
/// </summary>
public IEntity? Entity;
public EntityUid Entity;
/// <summary>
/// How many entities are accessible through this element's sub-menus.
@@ -24,10 +23,10 @@ namespace Content.Client.ContextMenu.UI
/// </remarks>
public int Count;
public Label CountLabel;
public SpriteView EntityIcon = new SpriteView { OverrideDirection = Direction.South};
public readonly Label CountLabel;
public readonly SpriteView EntityIcon = new() { OverrideDirection = Direction.South};
public EntityMenuElement(IEntity? entity = null) : base()
public EntityMenuElement(EntityUid entity = default)
{
CountLabel = new Label { StyleClasses = { StyleClassEntityMenuCountText } };
Icon.AddChild(new LayoutContainer() { Children = { EntityIcon, CountLabel } });
@@ -37,7 +36,7 @@ namespace Content.Client.ContextMenu.UI
LayoutContainer.SetGrowVertical(CountLabel, LayoutContainer.GrowDirection.Begin);
Entity = entity;
if (Entity != null)
if (Entity != default)
{
Count = 1;
CountLabel.Visible = false;
@@ -48,7 +47,7 @@ namespace Content.Client.ContextMenu.UI
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Entity = null;
Entity = default;
Count = 0;
}
@@ -56,12 +55,12 @@ namespace Content.Client.ContextMenu.UI
/// Update the icon and text of this element based on the given entity or this element's own entity if none
/// is provided.
/// </summary>
public void UpdateEntity(IEntity? entity = null)
public void UpdateEntity(EntityUid entity = default)
{
if (Entity != null && IoCManager.Resolve<IEntityManager>().EntityExists(Entity))
entity ??= Entity;
if (Entity != default && IoCManager.Resolve<IEntityManager>().EntityExists(Entity) && !entity.Valid)
entity = Entity;
if (entity == null)
if (entity == default)
{
Text = string.Empty;
return;