diff --git a/Content.Client/ClientNotifyManager.cs b/Content.Client/ClientNotifyManager.cs index 125dddf230..56364513ee 100644 --- a/Content.Client/ClientNotifyManager.cs +++ b/Content.Client/ClientNotifyManager.cs @@ -45,7 +45,7 @@ namespace Content.Client PopupMessage(_eyeManager.WorldToScreen(message.Coordinates), message.Message); } - public override void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message) + public override void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message) { if (viewer != _playerManager.LocalPlayer.ControlledEntity) { @@ -59,7 +59,7 @@ namespace Content.Client { var label = new PopupLabel {Text = message}; var minimumSize = label.CombinedMinimumSize; - label.InitialPos = label.Position = coordinates.AsVector - minimumSize / 2; + label.InitialPos = label.Position = coordinates.Position - minimumSize / 2; _userInterfaceManager.StateRoot.AddChild(label); _aliveLabels.Add(label); } diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index d2ea12bbce..de1dac0db8 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -192,7 +192,7 @@ namespace Content.Client.Construction if (prototype.Type != ConstructionType.Structure) { // In-hand attackby doesn't exist so this is the best alternative. - var loc = Owner.Owner.GetComponent().LocalPosition; + var loc = Owner.Owner.GetComponent().GridPosition; Owner.SpawnGhost(prototype, loc, Direction.North); return; } diff --git a/Content.Client/Construction/ConstructionPlacementHijack.cs b/Content.Client/Construction/ConstructionPlacementHijack.cs index e078fc390c..fc1ec338e9 100644 --- a/Content.Client/Construction/ConstructionPlacementHijack.cs +++ b/Content.Client/Construction/ConstructionPlacementHijack.cs @@ -23,7 +23,7 @@ namespace Content.Client.Construction Owner = owner; } - public override bool HijackPlacementRequest(GridLocalCoordinates coords) + public override bool HijackPlacementRequest(GridCoordinates coords) { if (Prototype != null) { diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index 4066c75e75..e917a359fc 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -60,7 +60,7 @@ namespace Content.Client.GameObjects.Components.Construction Button?.Dispose(); } - public void SpawnGhost(ConstructionPrototype prototype, GridLocalCoordinates loc, Direction dir) + public void SpawnGhost(ConstructionPrototype prototype, GridCoordinates loc, Direction dir) { var entMgr = IoCManager.Resolve(); var ghost = entMgr.ForceSpawnEntityAt("constructionghost", loc); @@ -80,7 +80,7 @@ namespace Content.Client.GameObjects.Components.Construction { var ghost = Ghosts[ghostId]; var transform = ghost.Owner.GetComponent(); - var msg = new TryStartStructureConstructionMessage(transform.LocalPosition, ghost.Prototype.ID, transform.LocalRotation, ghostId); + var msg = new TryStartStructureConstructionMessage(transform.GridPosition, ghost.Prototype.ID, transform.LocalRotation, ghostId); SendNetworkMessage(msg); } diff --git a/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs b/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs index 397a71cf8f..5dec9fbf86 100644 --- a/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs +++ b/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs @@ -12,7 +12,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged private TimeSpan _lastFireTime; private int _tick; - public void TryFire(GridLocalCoordinates worldPos) + public void TryFire(GridCoordinates worldPos) { var curTime = IoCManager.Resolve().CurTime; var span = curTime - _lastFireTime; diff --git a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs index ae262d08c8..5af9397b45 100644 --- a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs @@ -73,7 +73,7 @@ namespace Content.Client.GameObjects.EntitySystems RaiseNetworkEvent(new VerbSystemMessages.RequestVerbsMessage(_currentEntity)); var size = vBox.CombinedMinimumSize; - var box = UIBox2.FromDimensions(screenCoordinates.AsVector, size); + var box = UIBox2.FromDimensions(screenCoordinates.Position, size); _currentPopup.Open(box); } diff --git a/Content.Server/Administration/AGhost.cs b/Content.Server/Administration/AGhost.cs index ba66f40d7c..f116dde189 100644 --- a/Content.Server/Administration/AGhost.cs +++ b/Content.Server/Administration/AGhost.cs @@ -31,7 +31,7 @@ namespace Content.Server.Administration { var entityManager = IoCManager.Resolve(); var ghost = entityManager.ForceSpawnEntityAt("AdminObserver", - player.AttachedEntity.Transform.LocalPosition); + player.AttachedEntity.Transform.GridPosition); mind.Visit(ghost); } diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 18b1a47192..0118f01143 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -53,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Construction { // Oh boy we get to finish construction! var entMgr = IoCManager.Resolve(); - var ent = entMgr.ForceSpawnEntityAt(Prototype.Result, Transform.LocalPosition); + var ent = entMgr.ForceSpawnEntityAt(Prototype.Result, Transform.GridPosition); ent.GetComponent().LocalRotation = Transform.LocalRotation; Owner.Delete(); return true; @@ -105,9 +105,9 @@ namespace Content.Server.GameObjects.Components.Construction return false; } if (matStep.Material == MaterialType.Cable) - AudioSystem.Play("/Audio/items/zip.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/zip.ogg", Transform.GridPosition); else - AudioSystem.Play("/Audio/items/deconstruct.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/deconstruct.ogg", Transform.GridPosition); return true; case ConstructionStepTool toolStep: switch (toolStep.Tool) @@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.Components.Construction case ToolType.Crowbar: if (slapped.HasComponent()) { - AudioSystem.Play("/Audio/items/crowbar.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/crowbar.ogg", Transform.GridPosition); return true; } return false; @@ -123,16 +123,16 @@ namespace Content.Server.GameObjects.Components.Construction if (slapped.TryGetComponent(out WelderComponent welder) && welder.TryUse(toolStep.Amount)) { if (random.NextDouble() > 0.5) - AudioSystem.Play("/Audio/items/welder.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/welder.ogg", Transform.GridPosition); else - AudioSystem.Play("/Audio/items/welder2.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/welder2.ogg", Transform.GridPosition); return true; } return false; case ToolType.Wrench: if (slapped.HasComponent()) { - AudioSystem.Play("/Audio/items/ratchet.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/ratchet.ogg", Transform.GridPosition); return true; } return false; @@ -140,16 +140,16 @@ namespace Content.Server.GameObjects.Components.Construction if (slapped.HasComponent()) { if (random.NextDouble() > 0.5) - AudioSystem.Play("/Audio/items/screwdriver.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/screwdriver.ogg", Transform.GridPosition); else - AudioSystem.Play("/Audio/items/screwdriver2.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/screwdriver2.ogg", Transform.GridPosition); return true; } return false; case ToolType.Wirecutters: if (slapped.HasComponent()) { - AudioSystem.Play("/Audio/items/wirecutter.ogg", Transform.LocalPosition); + AudioSystem.Play("/Audio/items/wirecutter.ogg", Transform.GridPosition); return true; } return false; diff --git a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs index defbcf56fc..f074411855 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs @@ -33,13 +33,13 @@ namespace Content.Server.GameObjects.Components.Construction } } - void TryStartStructureConstruction(GridLocalCoordinates loc, string prototypeName, Angle angle, int ack) + void TryStartStructureConstruction(GridCoordinates loc, string prototypeName, Angle angle, int ack) { var protoMan = IoCManager.Resolve(); var prototype = protoMan.Index(prototypeName); var transform = Owner.GetComponent(); - if (!loc.InRange(transform.LocalPosition, InteractionSystem.INTERACTION_RANGE)) + if (!loc.InRange(transform.GridPosition, InteractionSystem.INTERACTION_RANGE)) { return; } diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index ea487b3766..8e202296ba 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -151,7 +151,7 @@ namespace Content.Server.GameObjects // TODO: The item should be dropped to the container our owner is in, if any. var itemTransform = item.Owner.GetComponent(); - itemTransform.LocalPosition = Owner.GetComponent().LocalPosition; + itemTransform.GridPosition = Owner.GetComponent().GridPosition; Dirty(); return true; } diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index f0b29bdb7e..e4169fc087 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -171,7 +171,7 @@ namespace Content.Server.GameObjects return null; } - public bool Drop(string slot, GridLocalCoordinates coords) + public bool Drop(string slot, GridCoordinates coords) { if (!CanDrop(slot)) { @@ -188,13 +188,13 @@ namespace Content.Server.GameObjects item.RemovedFromSlot(); // TODO: The item should be dropped to the container our owner is in, if any. - item.Owner.Transform.LocalPosition = coords; + item.Owner.Transform.GridPosition = coords; Dirty(); return true; } - public bool Drop(IEntity entity, GridLocalCoordinates coords) + public bool Drop(IEntity entity, GridCoordinates coords) { if (entity == null) { @@ -227,7 +227,7 @@ namespace Content.Server.GameObjects item.RemovedFromSlot(); // TODO: The item should be dropped to the container our owner is in, if any. - item.Owner.Transform.LocalPosition = Owner.Transform.LocalPosition; + item.Owner.Transform.GridPosition = Owner.Transform.GridPosition; Dirty(); return true; @@ -451,7 +451,7 @@ namespace Content.Server.GameObjects if (playerEntity == Owner && used != null) { InteractionSystem.Interaction(Owner, used, slot.ContainedEntity, - GridLocalCoordinates.Nullspace); + GridCoordinates.Nullspace); } break; diff --git a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs index deaff993bb..f2a1fbb821 100644 --- a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs @@ -148,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Interactable if (!user.TryGetComponent(out HandsComponent hands) || !hands.PutInHand(cell.Owner.GetComponent())) - cell.Owner.Transform.LocalPosition = user.Transform.LocalPosition; + cell.Owner.Transform.GridPosition = user.Transform.GridPosition; } [Verb] diff --git a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs index 520a9cc48f..f2070b1439 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs @@ -256,7 +256,7 @@ namespace Content.Server.GameObjects var ourtransform = Owner.GetComponent(); var playertransform = playerentity.GetComponent(); - if (playertransform.LocalPosition.InRange(ourtransform.LocalPosition, 2) + if (playertransform.GridPosition.InRange(ourtransform.GridPosition, 2) && (ourtransform.IsMapTransform || playertransform.ContainsEntity(ourtransform))) { var remove = (RemoveEntityMessage)message; diff --git a/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs b/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs index ea6f70a78a..d24897940c 100644 --- a/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs +++ b/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs @@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Power { public class PowerDebugTool : SharedPowerDebugTool, IAfterAttack { - void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked) + void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked) { if (attacked == null) { @@ -65,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Power foreach (var provider in device.AvailableProviders) { var providerTransform = provider.Owner.GetComponent(); - builder.AppendFormat(" {0} ({1}) @ {2}", provider.Owner.Name, provider.Owner.Uid, providerTransform.LocalPosition); + builder.AppendFormat(" {0} ({1}) @ {2}", provider.Owner.Name, provider.Owner.Uid, providerTransform.GridPosition); if (device.Provider == provider) { builder.Append(" (CURRENT)"); diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index bfb20f080d..2837918c18 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -32,11 +32,11 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee serializer.DataField(ref ArcWidth, "arcwidth", 90); } - void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked) + void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked) { - var location = user.GetComponent().LocalPosition; + var location = user.GetComponent().GridPosition; var angle = new Angle(clicklocation.ToWorld().Position - location.ToWorld().Position); - var entities = IoCManager.Resolve().GetEntitiesInArc(user.GetComponent().LocalPosition, Range, angle, ArcWidth); + var entities = IoCManager.Resolve().GetEntitiesInArc(user.GetComponent().GridPosition, Range, angle, ArcWidth); foreach (var entity in entities) { diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs index 81fd651d1e..2fa08b8f28 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs @@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan rangedWeapon.FireHandler = Fire; } - private void Fire(IEntity user, GridLocalCoordinates clickLocation) + private void Fire(IEntity user, GridCoordinates clickLocation) { var userPosition = user.Transform.WorldPosition; //Remember world positions are ephemeral and can only be used instantaneously var angle = new Angle(clickLocation.Position - userPosition); @@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan Born = time, DeathTime = time + TimeSpan.FromSeconds(1), Size = new Vector2(dist, 1f), - Coordinates = user.Transform.LocalPosition.Translated(offset), + Coordinates = user.Transform.GridPosition.Translated(offset), //Rotated from east facing Rotation = (float) angle.Theta, ColorDelta = new Vector4(0, 0, 0, -1500f), diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/ProjectileWeapon.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/ProjectileWeapon.cs index 6bfe77c204..4a3a05f582 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/ProjectileWeapon.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/ProjectileWeapon.cs @@ -59,9 +59,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile serializer.DataField(ref _spreadStdDev, "spreadstddev", 3); } - private void Fire(IEntity user, GridLocalCoordinates clickLocation) + private void Fire(IEntity user, GridCoordinates clickLocation) { - var userPosition = user.Transform.LocalPosition; //Remember world positions are ephemeral and can only be used instantaneously + var userPosition = user.Transform.GridPosition; //Remember world positions are ephemeral and can only be used instantaneously var angle = new Angle(clickLocation.Position - userPosition.Position); if (Spread) diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs index f3a4a0d4ab..bdf86e5638 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged public Func WeaponCanFireHandler; public Func UserCanFireHandler; - public Action FireHandler; + public Action FireHandler; private const int MaxFireDelayAttempts = 2; @@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged return UserCanFireHandler == null || UserCanFireHandler(user); } - private void Fire(IEntity user, GridLocalCoordinates clickLocation) + private void Fire(IEntity user, GridCoordinates clickLocation) { _lastFireTime = IoCManager.Resolve().CurTime; FireHandler?.Invoke(user, clickLocation); @@ -60,7 +60,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged } } - private void _tryFire(IEntity user, GridLocalCoordinates coordinates, int attemptCount) + private void _tryFire(IEntity user, GridCoordinates coordinates, int attemptCount) { if (!user.TryGetComponent(out HandsComponent hands) || hands.GetActiveHand.Owner != Owner) { diff --git a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs index 3a671a579c..1261df24eb 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs @@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.EntitySystems inputSys.BindMap.BindFunction(ContentKeyFunctions.ExamineEntity, new PointerInputCmdHandler(HandleExamine)); } - private void HandleExamine(ICommonSession session, GridLocalCoordinates coords, EntityUid uid) + private void HandleExamine(ICommonSession session, GridCoordinates coords, EntityUid uid) { if (!(session is IPlayerSession svSession)) return; diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 8db802801e..e369fa4145 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -57,7 +57,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// - bool RangedAttackby(IEntity user, IEntity attackwith, GridLocalCoordinates clicklocation); + bool RangedAttackby(IEntity user, IEntity attackwith, GridCoordinates clicklocation); } /// @@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// The entity that was clicked on out of range. May be null if no entity was clicked on.true - void Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked); + void Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked); } /// @@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.EntitySystems inputSys.BindMap.BindFunction(ContentKeyFunctions.ActivateItemInWorld, new PointerInputCmdHandler((HandleUseItemInWorld))); } - private void HandleUseItemInWorld(ICommonSession session, GridLocalCoordinates coords, EntityUid uid) + private void HandleUseItemInWorld(ICommonSession session, GridCoordinates coords, EntityUid uid) { if(!EntityManager.TryGetEntity(uid, out var used)) return; @@ -128,13 +128,13 @@ namespace Content.Server.GameObjects.EntitySystems if(playerEnt == null || !playerEnt.IsValid()) return; - if (!playerEnt.Transform.LocalPosition.InRange(used.Transform.LocalPosition, INTERACTION_RANGE)) + if (!playerEnt.Transform.GridPosition.InRange(used.Transform.GridPosition, INTERACTION_RANGE)) return; activateComp.Activate(playerEnt); } - private void HandleUseItemInHand(ICommonSession session, GridLocalCoordinates coords, EntityUid uid) + private void HandleUseItemInHand(ICommonSession session, GridCoordinates coords, EntityUid uid) { // client sanitization if(!coords.IsValidLocation()) @@ -152,7 +152,7 @@ namespace Content.Server.GameObjects.EntitySystems UserInteraction(((IPlayerSession)session).AttachedEntity, coords, uid); } - private void UserInteraction(IEntity player, GridLocalCoordinates coordinates, EntityUid clickedUid) + private void UserInteraction(IEntity player, GridCoordinates coordinates, EntityUid clickedUid) { //Get entity clicked upon from UID if valid UID, if not assume no entity clicked upon and null if (!EntityManager.TryGetEntity(clickedUid, out var attacked)) @@ -244,7 +244,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// - public static void InteractAfterattack(IEntity user, IEntity weapon, GridLocalCoordinates clicklocation) + public static void InteractAfterattack(IEntity user, IEntity weapon, GridCoordinates clicklocation) { List afterattacks = weapon.GetAllComponents().ToList(); @@ -261,7 +261,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// - public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation) + public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clicklocation) { List interactables = attacked.GetAllComponents().ToList(); @@ -347,7 +347,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// /// - public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation) + public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clicklocation) { List rangedusables = attacked.GetAllComponents().ToList(); diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 4e0e72232b..d23bbed4bb 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -106,7 +106,7 @@ namespace Content.Server.GameObjects.EntitySystems handsComp.SwapHands(); } - private static void HandleDrop(ICommonSession session, GridLocalCoordinates coords, EntityUid uid) + private static void HandleDrop(ICommonSession session, GridCoordinates coords, EntityUid uid) { var ent = ((IPlayerSession) session).AttachedEntity; @@ -118,7 +118,7 @@ namespace Content.Server.GameObjects.EntitySystems var transform = ent.Transform; - if (transform.LocalPosition.InRange(coords, InteractionSystem.INTERACTION_RANGE)) + if (transform.GridPosition.InRange(coords, InteractionSystem.INTERACTION_RANGE)) { handsComp.Drop(handsComp.ActiveIndex, coords); } @@ -136,7 +136,7 @@ namespace Content.Server.GameObjects.EntitySystems handsComp.ActivateItem(); } - private static void HandleThrowItem(ICommonSession session, GridLocalCoordinates coords, EntityUid uid) + private static void HandleThrowItem(ICommonSession session, GridCoordinates coords, EntityUid uid) { var plyEnt = ((IPlayerSession)session).AttachedEntity; @@ -159,7 +159,7 @@ namespace Content.Server.GameObjects.EntitySystems else { stackComp.Use(1); - throwEnt = throwEnt.EntityManager.ForceSpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.LocalPosition); + throwEnt = throwEnt.EntityManager.ForceSpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition); } if (!throwEnt.TryGetComponent(out CollidableComponent colComp)) diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 78fbe4706e..2a172f432f 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -63,7 +63,7 @@ namespace Content.Server.GameTicking private const float LobbyDuration = 20; [ViewVariables] private bool _initialized; - [ViewVariables(VVAccess.ReadWrite)] private GridLocalCoordinates _spawnPoint; + [ViewVariables(VVAccess.ReadWrite)] private GridCoordinates _spawnPoint; [ViewVariables] private GameRunLevel _runLevel; [ViewVariables] private bool LobbyEnabled => _configurationManager.GetCVar("game.lobbyenabled"); @@ -272,7 +272,7 @@ namespace Content.Server.GameTicking var startTime = _gameTiming.RealTime; var grid = _mapLoader.LoadBlueprint(newMap, MapFile); - _spawnPoint = new GridLocalCoordinates(Vector2.Zero, grid); + _spawnPoint = new GridCoordinates(Vector2.Zero, grid); var timeSpan = _gameTiming.RealTime - startTime; Logger.InfoS("ticker", $"Loaded map in {timeSpan.TotalMilliseconds:N2}ms."); diff --git a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs index 67c5f40040..be0c16a30a 100644 --- a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs +++ b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs @@ -107,7 +107,7 @@ namespace Content.Server.Interfaces.GameObjects /// The slot to drop the item from. /// /// True if an item was dropped, false otherwise. - bool Drop(string slot, GridLocalCoordinates coords); + bool Drop(string slot, GridCoordinates coords); /// /// Drop the specified entity in our hands to a certain position. @@ -128,7 +128,7 @@ namespace Content.Server.Interfaces.GameObjects /// /// Thrown if is not actually held in any hand. /// - bool Drop(IEntity entity, GridLocalCoordinates coords); + bool Drop(IEntity entity, GridCoordinates coords); /// /// Drop the item contained in a slot into another container. diff --git a/Content.Server/Placement/SpawnHelpers.cs b/Content.Server/Placement/SpawnHelpers.cs index c7a18c952b..5c2f3bfdb1 100644 --- a/Content.Server/Placement/SpawnHelpers.cs +++ b/Content.Server/Placement/SpawnHelpers.cs @@ -21,11 +21,11 @@ namespace Content.Server.Placement { var entMan = IoCManager.Resolve(); var tBase = entMan.SpawnEntity("TurretBase"); - tBase.GetComponent().LocalPosition = new GridLocalCoordinates(localPosition, grid); + tBase.GetComponent().GridPosition = new GridCoordinates(localPosition, grid); var tTop = entMan.SpawnEntity("TurretTopLight"); var topTransform = tTop.GetComponent(); - topTransform.LocalPosition = new GridLocalCoordinates(localPosition, grid); + topTransform.GridPosition = new GridCoordinates(localPosition, grid); topTransform.AttachParent(tBase); } } diff --git a/Content.Server/ServerNotifyManager.cs b/Content.Server/ServerNotifyManager.cs index 9357e15685..dce9f87465 100644 --- a/Content.Server/ServerNotifyManager.cs +++ b/Content.Server/ServerNotifyManager.cs @@ -29,7 +29,7 @@ namespace Content.Server _initialized = true; } - public override void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message) + public override void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message) { if (!viewer.TryGetComponent(out IActorComponent actor)) { diff --git a/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs b/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs index e4c731b584..eaad7e6242 100644 --- a/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs +++ b/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs @@ -24,7 +24,7 @@ namespace Content.Shared.GameObjects.Components.Construction /// /// Position to start building. /// - public readonly GridLocalCoordinates Location; + public readonly GridCoordinates Location; /// /// The construction prototype to start building. @@ -38,7 +38,7 @@ namespace Content.Shared.GameObjects.Components.Construction /// public readonly int Ack; - public TryStartStructureConstructionMessage(GridLocalCoordinates loc, string prototypeName, Angle angle, int ack) + public TryStartStructureConstructionMessage(GridCoordinates loc, string prototypeName, Angle angle, int ack) { Directed = true; Location = loc; diff --git a/Content.Shared/GameObjects/Components/Weapons/Ranged/SharedRangedWeaponComponent.cs b/Content.Shared/GameObjects/Components/Weapons/Ranged/SharedRangedWeaponComponent.cs index c0b9f5e383..0559e4f819 100644 --- a/Content.Shared/GameObjects/Components/Weapons/Ranged/SharedRangedWeaponComponent.cs +++ b/Content.Shared/GameObjects/Components/Weapons/Ranged/SharedRangedWeaponComponent.cs @@ -33,10 +33,10 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged [Serializable, NetSerializable] protected class FireMessage : ComponentMessage { - public readonly GridLocalCoordinates Target; + public readonly GridCoordinates Target; public readonly int Tick; - public FireMessage(GridLocalCoordinates target, int tick) + public FireMessage(GridCoordinates target, int tick) { Target = target; Tick = tick; diff --git a/Content.Shared/Interfaces/ISharedNotifyManager.cs b/Content.Shared/Interfaces/ISharedNotifyManager.cs index 49f0ed5c14..88624654db 100644 --- a/Content.Shared/Interfaces/ISharedNotifyManager.cs +++ b/Content.Shared/Interfaces/ISharedNotifyManager.cs @@ -7,7 +7,7 @@ namespace Content.Shared.Interfaces public interface ISharedNotifyManager { void PopupMessage(IEntity source, IEntity viewer, string message); - void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message); + void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message); } public static class NotifyManagerExt diff --git a/Content.Shared/SharedNotifyManager.cs b/Content.Shared/SharedNotifyManager.cs index c588ed52cd..eaad117368 100644 --- a/Content.Shared/SharedNotifyManager.cs +++ b/Content.Shared/SharedNotifyManager.cs @@ -14,10 +14,10 @@ namespace Content.Shared { // TODO: we might eventually want for this to pass the actual entity, // so the notify could track the entity movement visually. - PopupMessage(source.Transform.LocalPosition, viewer, message); + PopupMessage(source.Transform.GridPosition, viewer, message); } - public abstract void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message); + public abstract void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message); protected class MsgDoNotify : NetMessage { @@ -30,7 +30,7 @@ namespace Content.Shared #endregion public string Message { get; set; } - public GridLocalCoordinates Coordinates; + public GridCoordinates Coordinates; public override void ReadFromBuffer(NetIncomingMessage buffer) { diff --git a/engine b/engine index 6873ad70f4..6d9a1a4e43 160000 --- a/engine +++ b/engine @@ -1 +1 @@ -Subproject commit 6873ad70f4bcd0c168c4717ec2f51fa9b547b0d7 +Subproject commit 6d9a1a4e43b00a9024680c444bfa3d800d68e840