Fixes for grid rotation (#4562)
* Fixes gas overlays * Fixes verbs *Set noRot on a bunch of stuff
This commit is contained in:
@@ -14,7 +14,6 @@ namespace Content.Client.Atmos.Overlays
|
||||
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
|
||||
|
||||
@@ -30,24 +29,25 @@ namespace Content.Client.Atmos.Overlays
|
||||
var drawHandle = args.WorldHandle;
|
||||
|
||||
var mapId = _eyeManager.CurrentMap;
|
||||
var eye = _eyeManager.CurrentEye;
|
||||
|
||||
var worldBounds = Box2.CenteredAround(eye.Position.Position,
|
||||
_clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom);
|
||||
var worldBounds = _eyeManager.GetWorldViewbounds();
|
||||
|
||||
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
|
||||
{
|
||||
if (!_gasTileOverlaySystem.HasData(mapGrid.Index))
|
||||
continue;
|
||||
|
||||
drawHandle.SetTransform(mapGrid.WorldMatrix);
|
||||
|
||||
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
|
||||
{
|
||||
foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices))
|
||||
{
|
||||
drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color);
|
||||
drawHandle.DrawTexture(texture, new Vector2(tile.X, tile.Y), color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drawHandle.SetTransform(Matrix3.Identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
Content.Client/Interactable/InteractionSystem.cs
Normal file
9
Content.Client/Interactable/InteractionSystem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Content.Shared.Interaction;
|
||||
|
||||
namespace Content.Client.Interactable
|
||||
{
|
||||
public sealed class InteractionSystem : SharedInteractionSystem
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace Content.Shared.Interaction
|
||||
/// Governs interactions during clicking on entities
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class SharedInteractionSystem : EntitySystem
|
||||
public abstract class SharedInteractionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedBroadphaseSystem _sharedBroadphaseSystem = default!;
|
||||
|
||||
@@ -131,6 +131,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
if (rayResults.Count == 0) return true;
|
||||
|
||||
// TODO: Wot? This should just be in the predicate.
|
||||
if (!ignoreInsideBlocker) return false;
|
||||
|
||||
foreach (var result in rayResults)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -12,6 +12,8 @@ namespace Content.Shared.Verbs
|
||||
{
|
||||
public class SharedVerbSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IEntityLookup _lookup = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Get all of the entities relevant for the contextmenu
|
||||
/// </summary>
|
||||
@@ -25,17 +27,20 @@ namespace Content.Shared.Verbs
|
||||
contextEntities = null;
|
||||
var length = buffer ? 1.0f: 0.5f;
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityLookup>().
|
||||
GetEntitiesIntersecting(targetPos.MapId, Box2.CenteredAround(targetPos.Position, (length, length))).ToList();
|
||||
var entities = _lookup.GetEntitiesIntersecting(
|
||||
targetPos.MapId,
|
||||
Box2.CenteredAround(targetPos.Position, (length, length)))
|
||||
.ToList();
|
||||
|
||||
if (entities.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (entities.Count == 0) return false;
|
||||
|
||||
// TODO: Can probably do a faster distance check with EntityCoordinates given we don't need to get map stuff.
|
||||
|
||||
// Check if we have LOS to the clicked-location, otherwise no popup.
|
||||
var vectorDiff = player.Transform.MapPosition.Position - targetPos.Position;
|
||||
var playerPos = player.Transform.MapPosition;
|
||||
var vectorDiff = playerPos.Position - targetPos.Position;
|
||||
var distance = vectorDiff.Length + 0.01f;
|
||||
|
||||
bool Ignored(IEntity entity)
|
||||
{
|
||||
return entities.Contains(entity) ||
|
||||
@@ -48,7 +53,7 @@ namespace Content.Shared.Verbs
|
||||
? CollisionGroup.Opaque
|
||||
: CollisionGroup.None;
|
||||
|
||||
var result = player.InRangeUnobstructed(targetPos, distance, mask, Ignored);
|
||||
var result = Get<SharedInteractionSystem>().InRangeUnobstructed(playerPos, targetPos, distance, mask, Ignored);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -6984,8 +6984,7 @@ entities:
|
||||
- uid: 760
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 5.5,-21.5
|
||||
- pos: 5.5,-21.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7006,8 +7005,7 @@ entities:
|
||||
- uid: 762
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -23.5,11.5
|
||||
- pos: -23.5,11.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7019,8 +7017,7 @@ entities:
|
||||
- uid: 763
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 24.5,13.5
|
||||
- pos: 24.5,13.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7052,8 +7049,7 @@ entities:
|
||||
- uid: 766
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -2.5,30.5
|
||||
- pos: -2.5,30.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7065,8 +7061,7 @@ entities:
|
||||
- uid: 767
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 9.5,30.5
|
||||
- pos: 9.5,30.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7188,8 +7183,7 @@ entities:
|
||||
- uid: 778
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 12.5,21.5
|
||||
- pos: 12.5,21.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7214,8 +7208,7 @@ entities:
|
||||
- uid: 780
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 43.5,9.5
|
||||
- pos: 43.5,9.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7253,8 +7246,7 @@ entities:
|
||||
- uid: 783
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 8.5,-18.5
|
||||
- pos: 8.5,-18.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7279,8 +7271,7 @@ entities:
|
||||
- uid: 785
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -15.5,-17.5
|
||||
- pos: -15.5,-17.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7292,8 +7283,7 @@ entities:
|
||||
- uid: 786
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -7.5,-25.5
|
||||
- pos: -7.5,-25.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7305,8 +7295,7 @@ entities:
|
||||
- uid: 787
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 26.5,12.5
|
||||
- pos: 26.5,12.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7318,8 +7307,7 @@ entities:
|
||||
- uid: 788
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: 23.5,1.5
|
||||
- pos: 23.5,1.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7344,8 +7332,7 @@ entities:
|
||||
- uid: 790
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -11.5,-10.5
|
||||
- pos: -11.5,-10.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7357,8 +7344,7 @@ entities:
|
||||
- uid: 791
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -37.5,-7.5
|
||||
- pos: -37.5,-7.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7370,8 +7356,7 @@ entities:
|
||||
- uid: 792
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -39.5,2.5
|
||||
- pos: -39.5,2.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
@@ -7383,8 +7368,7 @@ entities:
|
||||
- uid: 793
|
||||
type: ClosetEmergencyFilledRandom
|
||||
components:
|
||||
- rot: 4.371139006309477E-08 rad
|
||||
pos: -34.5,10.5
|
||||
- pos: -34.5,10.5
|
||||
parent: 853
|
||||
type: Transform
|
||||
- isPlaceable: False
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
parent: BaseStructureDynamic
|
||||
abstract: true
|
||||
components:
|
||||
- type: Transform
|
||||
noRot: true
|
||||
- type: InteractionOutline
|
||||
- type: Physics
|
||||
bodyType: Dynamic
|
||||
@@ -19,6 +21,7 @@
|
||||
- SmallImpassable
|
||||
- VaultImpassable
|
||||
- type: Sprite
|
||||
noRot: true
|
||||
sprite: Structures/Furniture/potted_plants.rsi
|
||||
- type: PottedPlantHide
|
||||
- type: SecretStash
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
name: closet
|
||||
description: A standard-issue Nanotrasen storage unit.
|
||||
components:
|
||||
- type: Transform
|
||||
noRot: true
|
||||
- type: Sprite
|
||||
noRot: true
|
||||
netsync: false
|
||||
sprite: Structures/Storage/closet.rsi
|
||||
layers:
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
name: crate
|
||||
description: A large container for items.
|
||||
components:
|
||||
- type: Transform
|
||||
noRot: true
|
||||
- type: Sprite
|
||||
noRot: true
|
||||
netsync: false
|
||||
sprite: Structures/Storage/Crates/generic.rsi
|
||||
layers:
|
||||
|
||||
Reference in New Issue
Block a user