Stop using some obsolete stuff (#4657)

This commit is contained in:
Visne
2021-09-20 08:40:22 +02:00
committed by GitHub
parent 3895266b1f
commit fcc1217e5d
6 changed files with 13 additions and 13 deletions

View File

@@ -77,7 +77,7 @@ namespace Content.Client.ContextMenu.UI
AddToUI(orderedStates);
_userInterfaceManager.ModalRoot.AddChild(rootContextMenu);
var size = rootContextMenu.List.CombinedMinimumSize;
var size = rootContextMenu.List.DesiredSize;
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled.Position, size);
rootContextMenu.Open(box);
}
@@ -92,7 +92,7 @@ namespace Content.Client.ContextMenu.UI
AddToUI(orderedStates, stack);
_userInterfaceManager.ModalRoot.AddChild(childContextMenu);
var size = childContextMenu.List.CombinedMinimumSize;
var size = childContextMenu.List.DesiredSize;
childContextMenu.Open(UIBox2.FromDimensions(position + (stack.Width, 0), size));
}

View File

@@ -2,6 +2,7 @@ using Content.Shared.Examine;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Client.ResourceManagement;
using Robust.Shared.Containers;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -64,11 +65,8 @@ namespace Content.Client.Suspicion
continue;
}
// all entities have a TransformComponent
var transform = physics.Owner.Transform;
// if not on the same map, continue
if (transform.MapID != _eyeManager.CurrentMap || !transform.IsMapTransform)
if (physics.Owner.Transform.MapID != _eyeManager.CurrentMap || physics.Owner.IsInContainer())
{
continue;
}

View File

@@ -14,6 +14,7 @@ using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Configuration;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Input;
using Robust.Shared.IoC;
@@ -145,7 +146,7 @@ namespace Content.Client.Viewport
foreach (var entity in entities)
{
if (entity.TryGetComponent<ClickableComponent>(out var component)
&& entity.Transform.IsMapTransform
&& !entity.IsInContainer()
&& component.CheckClick(coordinates.Position, out var drawDepthClicked, out var renderOrder))
{
foundEntities.Add((entity, drawDepthClicked, renderOrder));