Moony z level hack (#15031)

* save work

* Adds Z levels

* a

* ladders + parallax scroll

* zoom out not in

* oops, sandbox

* oops i broke the law

* run ci

* fuck

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
Moony
2023-03-31 21:49:10 -05:00
committed by GitHub
parent 56b1628e58
commit 1f6663912b
17 changed files with 665 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
using System.Linq;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.Gameplay;
using Content.Shared._Afterlight.ThirdDimension;
using Content.Shared.CCVar;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
@@ -77,16 +79,28 @@ public sealed class ViewportUIController : UIController
base.FrameUpdate(e);
Viewport.Viewport.Eye = _eyeManager.CurrentEye;
// verify that the current eye is not "null". Fuck IEyeManager.
var ent = _playerMan.LocalPlayer?.ControlledEntity;
if (_entMan.TryGetComponent(ent, out ZViewComponent? view))
{
Viewport.Viewport.LowerEyes = view.DownViewEnts.Select(x =>
{
var eye = _entMan.GetComponent<EyeComponent>(x);
eye.Rotation = _eyeManager.CurrentEye.Rotation;
eye.DrawFov = false; // We're z leveling, no FoV.
return eye.Eye!;
}).ToArray();
}
if (_eyeManager.CurrentEye.Position != default || ent == null)
return;
_entMan.TryGetComponent(ent, out EyeComponent? eye);
if (eye?.Eye == _eyeManager.CurrentEye
&& _entMan.GetComponent<TransformComponent>(ent.Value).WorldPosition == default)
return; // nothing to worry about, the player is just in null space... actually that is probably a problem?