Make more uids nullable (#5794)
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Content.Client.Popups
|
||||
PopupMessage(message, _eyeManager.CoordinatesToScreen(transform.Coordinates));
|
||||
}
|
||||
|
||||
public void PopupMessage(string message, ScreenCoordinates coordinates, EntityUid entity = default)
|
||||
public void PopupMessage(string message, ScreenCoordinates coordinates, EntityUid? entity = null)
|
||||
{
|
||||
var label = new PopupLabel(_eyeManager, EntityManager)
|
||||
{
|
||||
@@ -146,7 +146,7 @@ namespace Content.Client.Popups
|
||||
|
||||
public float TimeLeft { get; private set; }
|
||||
public Vector2 InitialPos { get; set; }
|
||||
public EntityUid Entity { get; set; }
|
||||
public EntityUid? Entity { get; set; }
|
||||
|
||||
public PopupLabel(IEyeManager eyeManager, IEntityManager entityManager)
|
||||
{
|
||||
@@ -161,9 +161,9 @@ namespace Content.Client.Popups
|
||||
{
|
||||
TimeLeft += eventArgs.DeltaSeconds;
|
||||
|
||||
var position = Entity == default
|
||||
var position = Entity == null
|
||||
? InitialPos
|
||||
: (_eyeManager.CoordinatesToScreen(_entityManager.GetComponent<TransformComponent>(Entity).Coordinates).Position / UIScale) - DesiredSize / 2;
|
||||
: (_eyeManager.CoordinatesToScreen(_entityManager.GetComponent<TransformComponent>(Entity.Value).Coordinates).Position / UIScale) - DesiredSize / 2;
|
||||
|
||||
LayoutContainer.SetPosition(this, position - (0, 20 * (TimeLeft * TimeLeft + TimeLeft)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user