mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 09:37:03 +02:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
29 lines
796 B
C#
29 lines
796 B
C#
using Robust.Client.Graphics;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Robust.Client.UserInterface.CustomControls
|
|
{
|
|
/// <summary>
|
|
/// A viewport container shows a viewport.
|
|
/// This one is particularly gnarly because it has the code for the main viewport stuff.
|
|
/// </summary>
|
|
public sealed class MainViewportContainer : ViewportContainer
|
|
{
|
|
private readonly IEyeManager _eyeManager;
|
|
|
|
public MainViewportContainer(IEyeManager eyeManager)
|
|
{
|
|
_eyeManager = eyeManager;
|
|
AlwaysRender = true;
|
|
}
|
|
|
|
protected override void FrameUpdate(FrameEventArgs args)
|
|
{
|
|
base.FrameUpdate(args);
|
|
|
|
if(Viewport != null)
|
|
Viewport.Eye = _eyeManager.CurrentEye;
|
|
}
|
|
}
|
|
}
|