]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix and buff the handheld mass scanner (#31284)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Wed, 21 Aug 2024 18:33:01 +0000 (14:33 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Aug 2024 18:33:01 +0000 (12:33 -0600)
Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs
Content.Server/Shuttles/Systems/RadarConsoleSystem.cs
Content.Shared/Shuttles/BUIStates/NavInterfaceState.cs
Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml

index 0b8720add217172bf646d307845a9c298f29ac38..64ead32586d27e201b6b4679ebfe6b5f9eb0378e 100644 (file)
@@ -35,6 +35,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
 
     public bool ShowIFF { get; set; } = true;
     public bool ShowDocks { get; set; } = true;
+    public bool RotateWithEntity { get; set; } = true;
 
     /// <summary>
     /// Raised if the user left-clicks on the radar control with the relevant entitycoordinates.
@@ -109,6 +110,8 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
 
         ActualRadarRange = Math.Clamp(ActualRadarRange, WorldMinRange, WorldMaxRange);
 
+        RotateWithEntity = state.RotateWithEntity;
+
         _docks = state.Docks;
     }
 
@@ -138,7 +141,8 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
         var mapPos = _transform.ToMapCoordinates(_coordinates.Value);
         var offset = _coordinates.Value.Position;
         var posMatrix = Matrix3Helpers.CreateTransform(offset, _rotation.Value);
-        var (_, ourEntRot, ourEntMatrix) = _transform.GetWorldPositionRotationMatrix(_coordinates.Value.EntityId);
+        var ourEntRot = RotateWithEntity ? _transform.GetWorldRotation(xform) : _rotation.Value;
+        var ourEntMatrix = Matrix3Helpers.CreateTransform(_transform.GetWorldPosition(xform), ourEntRot);
         var ourWorldMatrix = Matrix3x2.Multiply(posMatrix, ourEntMatrix);
         Matrix3x2.Invert(ourWorldMatrix, out var ourWorldMatrixInvert);
 
index 1de20a87348efdb6cf2940ada9ac05722c90d524..2f5815a7fec882b707acc88ab8cbbdb348c1c2ae 100644 (file)
@@ -53,6 +53,8 @@ public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
                 state = _console.GetNavState(uid, docks);
             }
 
+            state.RotateWithEntity = !component.FollowEntity;
+
             _uiSystem.SetUiState(uid, RadarConsoleUiKey.Key, new NavBoundUserInterfaceState(state));
         }
     }
index a6f4c01657d01385202d0d03a4dce0c31adcfddf..f6cfe6a2dc1e0ce0189a1e952ff90e75ae3d2397 100644 (file)
@@ -20,6 +20,8 @@ public sealed class NavInterfaceState
 
     public Dictionary<NetEntity, List<DockingPortState>> Docks;
 
+    public bool RotateWithEntity = true;
+
     public NavInterfaceState(
         float maxRange,
         NetCoordinates? coordinates,
index 78abedc28abd02b4589849a7f8cb570cc878f4a4..de45119cddd18d284ebc45ac699bd2a2462b662e 100644 (file)
@@ -15,7 +15,7 @@
         visible: true
         map: [ "enum.PowerDeviceVisualLayers.Powered" ]
   - type: RadarConsole
-    maxRange: 64
+    maxRange: 256
     followEntity: true
   - type: Appearance
   - type: GenericVisualizer
@@ -25,8 +25,7 @@
           True: { visible: true }
           False: { visible: false }
   - type: PowerCellDraw
-    drawRate: 3
-    useRate: 100
+    drawRate: 1.5
   - type: ActivatableUI
     key: enum.RadarConsoleUiKey.Key
     inHandsOnly: true