From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sat, 22 Apr 2023 10:26:41 +0000 (+1000) Subject: Add scroll zooming for admins and ghosts (#14061) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e98113c71e37f10a4b6996f6f9080373a80f8ac0;p=space-station-14.git Add scroll zooming for admins and ghosts (#14061) * Add scroll zooming for admins * Bunch of work * Kinda better kinda worse scrolling * shared code * nyoom * house md * Fixes * Log spam * Fixes --------- Co-authored-by: metalgearsloth --- diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index d9c103b7eb..9b45d63b60 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -28,6 +28,9 @@ namespace Content.Client.Input common.AddFunction(ContentKeyFunctions.TakeScreenshot); common.AddFunction(ContentKeyFunctions.TakeScreenshotNoUI); common.AddFunction(ContentKeyFunctions.Point); + common.AddFunction(ContentKeyFunctions.ZoomOut); + common.AddFunction(ContentKeyFunctions.ZoomIn); + common.AddFunction(ContentKeyFunctions.ResetZoom); // Not in engine, because engine cannot check for sanbox/admin status before starting placement. common.AddFunction(ContentKeyFunctions.EditorCopyObject); diff --git a/Content.Client/Movement/Systems/ContentEyeSystem.cs b/Content.Client/Movement/Systems/ContentEyeSystem.cs new file mode 100644 index 0000000000..7ed0c771e1 --- /dev/null +++ b/Content.Client/Movement/Systems/ContentEyeSystem.cs @@ -0,0 +1,26 @@ +using Content.Shared.Movement.Components; +using Content.Shared.Movement.Systems; +using Robust.Client.GameObjects; +using Robust.Client.Player; + +namespace Content.Client.Movement.Systems; + +public sealed class ContentEyeSystem : SharedContentEyeSystem +{ + [Dependency] private readonly IPlayerManager _player = default!; + + public override void Update(float frameTime) + { + base.Update(frameTime); + + var localPlayer = _player.LocalPlayer?.ControlledEntity; + + if (!TryComp(localPlayer, out var content) || + !TryComp(localPlayer, out var eye)) + { + return; + } + + UpdateEye(localPlayer.Value, content, eye, frameTime); + } +} diff --git a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml index 08dafbbbab..93859099ee 100644 --- a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml +++ b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml @@ -9,7 +9,7 @@ - +