mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
Fix shuttle arrival visualizer (#35772)
* Fix shuttle arrival visualizer It was at a fixed spot but if the target is rotating it wasn't handled. * hew * Fixes
This commit is contained in:
@@ -24,5 +24,9 @@ public sealed class DockingConfig
|
||||
public Box2 Area;
|
||||
|
||||
public EntityCoordinates Coordinates;
|
||||
|
||||
/// <summary>
|
||||
/// Local angle of the docking grid relative to the target grid.
|
||||
/// </summary>
|
||||
public Angle Angle;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public sealed partial class DockingSystem
|
||||
return false;
|
||||
|
||||
shuttleDockedAABB = matty.TransformBox(shuttleAABB);
|
||||
gridRotation = (targetGridRotation + offsetAngle).Reduced();
|
||||
gridRotation = offsetAngle.Reduced();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,8 @@ public sealed partial class DockingSystem
|
||||
public DockingConfig? GetDockingConfigAt(EntityUid shuttleUid,
|
||||
EntityUid targetGrid,
|
||||
EntityCoordinates coordinates,
|
||||
Angle angle)
|
||||
Angle angle,
|
||||
bool fallback = true)
|
||||
{
|
||||
var gridDocks = GetDocks(targetGrid);
|
||||
var shuttleDocks = GetDocks(shuttleUid);
|
||||
@@ -140,6 +141,11 @@ public sealed partial class DockingSystem
|
||||
}
|
||||
}
|
||||
|
||||
if (fallback && configs.Count > 0)
|
||||
{
|
||||
return configs.First();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -365,8 +365,6 @@ public sealed partial class ShuttleSystem
|
||||
_audio.SetGridAudio(audio);
|
||||
component.StartupStream = audio?.Entity;
|
||||
|
||||
// TODO: Play previs here for docking arrival.
|
||||
|
||||
// Make sure the map is setup before we leave to avoid pop-in (e.g. parallax).
|
||||
EnsureFTLMap();
|
||||
return true;
|
||||
@@ -450,7 +448,8 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
if (entity.Comp1.VisualizerProto != null)
|
||||
{
|
||||
comp.VisualizerEntity = SpawnAtPosition(entity.Comp1.VisualizerProto, entity.Comp1.TargetCoordinates);
|
||||
comp.VisualizerEntity = SpawnAttachedTo(entity.Comp1.VisualizerProto, entity.Comp1.TargetCoordinates);
|
||||
DebugTools.Assert(Transform(comp.VisualizerEntity.Value).ParentUid == entity.Comp1.TargetCoordinates.EntityId);
|
||||
var visuals = Comp<FtlVisualizerComponent>(comp.VisualizerEntity.Value);
|
||||
visuals.Grid = entity.Owner;
|
||||
Dirty(comp.VisualizerEntity.Value, visuals);
|
||||
@@ -756,7 +755,7 @@ public sealed partial class ShuttleSystem
|
||||
// Set position
|
||||
var mapCoordinates = _transform.ToMapCoordinates(config.Coordinates);
|
||||
var mapUid = _mapSystem.GetMap(mapCoordinates.MapId);
|
||||
_transform.SetCoordinates(shuttle.Owner, shuttle.Comp, new EntityCoordinates(mapUid, mapCoordinates.Position), rotation: config.Angle);
|
||||
_transform.SetCoordinates(shuttle.Owner, shuttle.Comp, new EntityCoordinates(mapUid, mapCoordinates.Position), rotation: config.Angle + _transform.GetWorldRotation(config.Coordinates.EntityId));
|
||||
|
||||
// Connect everything
|
||||
foreach (var (dockAUid, dockBUid, dockA, dockB) in config.Docks)
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
categories: [ HideSpawnMenu ]
|
||||
description: Visualizer for shuttles arriving. You shouldn't see this!
|
||||
components:
|
||||
- type: Transform
|
||||
noRot: true
|
||||
gridTraversal: false
|
||||
- type: FtlVisualizer
|
||||
sprite:
|
||||
sprite: /Textures/Effects/medi_holo.rsi
|
||||
|
||||
Reference in New Issue
Block a user