Viewport improvements (#3765)
This commit is contained in:
committed by
GitHub
parent
8e2fc49357
commit
147a54c642
@@ -464,15 +464,15 @@ namespace Content.Client.GameObjects.EntitySystems.AI
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void Draw(DrawingHandleBase handle, OverlaySpace currentSpace)
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
{
|
||||
if (Modes == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
handle.UseShader(_shader);
|
||||
var screenHandle = (DrawingHandleScreen) handle;
|
||||
var screenHandle = args.ScreenHandle;
|
||||
screenHandle.UseShader(_shader);
|
||||
var viewport = _eyeManager.GetWorldViewport();
|
||||
|
||||
if ((Modes & PathfindingDebugMode.Route) != 0)
|
||||
|
||||
@@ -10,6 +10,7 @@ using Content.Shared;
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
using Content.Shared.Input;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.State;
|
||||
@@ -35,6 +36,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
|
||||
private readonly IContextMenuView _contextMenuView;
|
||||
private readonly VerbSystem _verbSystem;
|
||||
@@ -152,7 +154,14 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
var inRange =
|
||||
localPlayer.InRangeUnobstructed(e.ContextEntity, ignoreInsideBlocker: true);
|
||||
e.OutlineComponent?.UpdateInRange(inRange);
|
||||
|
||||
// BUG: This assumes that the main viewport is the viewport that the context menu is active on.
|
||||
// This is not necessarily true but we currently have no way to find the viewport (reliably)
|
||||
// from the input event.
|
||||
//
|
||||
// This might be particularly important in the future with a more advanced mapping mode.
|
||||
var renderScale = _eyeManager.MainViewport.GetRenderScale();
|
||||
e.OutlineComponent?.UpdateInRange(inRange, renderScale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +179,8 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
var localPlayer = _playerManager.LocalPlayer;
|
||||
if (localPlayer?.ControlledEntity == null) return;
|
||||
|
||||
e.OutlineComponent?.OnMouseEnter(localPlayer.InRangeUnobstructed(entity, ignoreInsideBlocker: true));
|
||||
var renderScale = _eyeManager.MainViewport.GetRenderScale();
|
||||
e.OutlineComponent?.OnMouseEnter(localPlayer.InRangeUnobstructed(entity, ignoreInsideBlocker: true), renderScale);
|
||||
if (e.SpriteComp != null)
|
||||
{
|
||||
e.SpriteComp.DrawDepth = (int) Shared.GameObjects.DrawDepth.HighlightedItems;
|
||||
|
||||
Reference in New Issue
Block a user