Entity menu tweaks (#5414)

* adjust lookup

* change grouping

* change range from 0.2 to 0.25
This commit is contained in:
Leon Friedrich
2021-11-20 18:25:29 +13:00
committed by GitHub
parent 12cfd97bf8
commit 19c5fed53a
2 changed files with 3 additions and 42 deletions

View File

@@ -32,7 +32,7 @@ namespace Content.Client.Verbs
/// <summary>
/// When a user right clicks somewhere, how large is the box we use to get entities for the context menu?
/// </summary>
public const float EntityMenuLookupSize = 1f;
public const float EntityMenuLookupSize = 0.25f;
public EntityMenuPresenter EntityMenu = default!;
public VerbMenuPresenter VerbMenu = default!;
@@ -100,9 +100,7 @@ namespace Content.Client.Verbs
return false;
// Get entities
var entities = _entityLookup.GetEntitiesIntersecting(
targetPos.MapId,
Box2.CenteredAround(targetPos.Position, (EntityMenuLookupSize, EntityMenuLookupSize)))
var entities = _entityLookup.GetEntitiesInRange(targetPos.MapId, targetPos.Position, EntityMenuLookupSize)
.ToList();
if (entities.Count == 0)