Update content vectors to numerics (#17759)

This commit is contained in:
metalgearsloth
2023-07-08 14:08:32 +10:00
committed by GitHub
parent 15772478c9
commit 68480af109
383 changed files with 978 additions and 575 deletions

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Administration.Systems;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;

View File

@@ -1,4 +1,5 @@
using Content.Client.Administration.Components;
using System.Numerics;
using Content.Client.Administration.Components;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
@@ -11,7 +12,7 @@ namespace Content.Client.Administration.UI
public AdminMenuWindow()
{
MinSize = (500, 250);
MinSize = new Vector2(500, 250);
Title = Loc.GetString("admin-menu-title");
RobustXamlLoader.Load(this);
MasterTabContainer.SetTabTitle(0, Loc.GetString("admin-menu-admin-tab"));

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Administration.UI.CustomControls;
using Content.Shared.Administration.BanList;
using Robust.Client.AutoGenerated;
@@ -57,7 +58,7 @@ public sealed partial class BanListControl : Control
_popup = new BanListIdsPopup(id, ip, hwid, guid);
var box = UIBox2.FromDimensions(UserInterfaceManager.MousePositionScaled.Position, (1, 1));
var box = UIBox2.FromDimensions(UserInterfaceManager.MousePositionScaled.Position, new Vector2(1, 1));
_popup.Open(box);
return true;

View File

@@ -1,4 +1,5 @@
using Robust.Client.Graphics;
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Maths;
@@ -10,7 +11,7 @@ public sealed class VSeparator : PanelContainer
public VSeparator(Color color)
{
MinSize = (2, 5);
MinSize = new Vector2(2, 5);
AddChild(new PanelContainer
{

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Shared.Administration.Notes;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
@@ -67,7 +68,7 @@ public sealed partial class AdminNotesControl : Control
};
_popup.OnDeletePressed += noteId => OnNoteDeleted?.Invoke(noteId);
var box = UIBox2.FromDimensions(UserInterfaceManager.MousePositionScaled.Position, (1, 1));
var box = UIBox2.FromDimensions(UserInterfaceManager.MousePositionScaled.Position, Vector2.One);
_popup.Open(box);
return true;

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Client.Administration.Managers;
using Content.Client.Eui;
using Content.Client.Stylesheets;
@@ -339,7 +340,7 @@ namespace Content.Client.Administration.UI
Contents.AddChild(tab);
}
protected override Vector2 ContentsMinimumSize => (600, 400);
protected override Vector2 ContentsMinimumSize => new Vector2(600, 400);
}
private sealed class EditAdminWindow : DefaultWindow
@@ -356,7 +357,7 @@ namespace Content.Client.Administration.UI
public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data)
{
MinSize = (600, 400);
MinSize = new Vector2(600, 400);
SourceData = data;
Control nameControl;
@@ -534,7 +535,7 @@ namespace Content.Client.Administration.UI
public EditAdminRankWindow(PermissionsEui ui, KeyValuePair<int, PermissionsEuiState.AdminRankData>? data)
{
Title = Loc.GetString("permissions-eui-edit-admin-rank-window-title");
MinSize = (600, 400);
MinSize = new Vector2(600, 400);
SourceId = data?.Key;
NameEdit = new LineEdit

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
@@ -22,7 +23,7 @@ namespace Content.Client.Administration.UI.SetOutfit
public SetOutfitMenu()
{
MinSize = SetSize = (250, 320);
MinSize = SetSize = new Vector2(250, 320);
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

View File

@@ -4,6 +4,7 @@ using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;
using Robust.Shared.Map;
using System.Linq;
using System.Numerics;
namespace Content.Client.Administration.UI.SpawnExplosion;
@@ -94,7 +95,7 @@ public sealed class ExplosionDebugOverlay : Overlay
foreach (var tile in tiles)
{
var centre = ((Vector2) tile + 0.5f) * tileSize;
var centre = (tile + Vector2Helpers.Half) * tileSize;
// is the center of this tile visible to the user?
if (!gridBounds.Contains(centre))
@@ -105,9 +106,9 @@ public sealed class ExplosionDebugOverlay : Overlay
var screenCenter = _eyeManager.WorldToScreen(worldCenter);
if (Intensity[i] > 9)
screenCenter += (-12, -8);
screenCenter += new Vector2(-12, -8);
else
screenCenter += (-8, -8);
screenCenter += new Vector2(-8, -8);
handle.DrawString(_font, screenCenter, Intensity[i].ToString("F2"));
}
@@ -116,8 +117,8 @@ public sealed class ExplosionDebugOverlay : Overlay
if (tileSets.ContainsKey(0))
{
var epicenter = tileSets[0].First();
var worldCenter = transform.Transform(((Vector2) epicenter + 0.5f) * tileSize);
var screenCenter = _eyeManager.WorldToScreen(worldCenter) + (-24, -24);
var worldCenter = transform.Transform((epicenter + Vector2Helpers.Half) * tileSize);
var screenCenter = _eyeManager.WorldToScreen(worldCenter) + new Vector2(-24, -24);
var text = $"{Intensity[0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}";
handle.DrawString(_font, screenCenter, text);
}
@@ -168,7 +169,7 @@ public sealed class ExplosionDebugOverlay : Overlay
foreach (var tile in tiles)
{
var centre = ((Vector2) tile + 0.5f) * tileSize;
var centre = (tile + Vector2Helpers.Half) * tileSize;
// is the center of this tile visible to the user?
if (!gridBounds.Contains(centre))

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Explosion;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
@@ -120,7 +121,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
return;
}
MapCoordinates coords = new((MapX.Value, MapY.Value), _mapData[MapOptions.SelectedId]);
MapCoordinates coords = new(new Vector2(MapX.Value, MapY.Value), _mapData[MapOptions.SelectedId]);
var explosionType = _explosionTypes[ExplosionOption.SelectedId];
_eui.RequestPreviewData(coords, explosionType, Intensity.Value, Slope.Value, MaxIntensity.Value);
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;

View File

@@ -1,4 +1,5 @@
using System;
using System.Numerics;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;

View File

@@ -1,4 +1,5 @@
using Content.Client.Gravity;
using System.Numerics;
using Content.Client.Gravity;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Robust.Client.GameObjects;

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using Content.Client.Arcade.UI;
using Content.Client.Resources;
@@ -61,7 +62,7 @@ namespace Content.Client.Arcade
Title = Loc.GetString("blockgame-menu-title");
_owner = owner;
MinSize = SetSize = (410, 490);
MinSize = SetSize = new Vector2(410, 490);
var resourceCache = IoCManager.Resolve<IResourceCache>();
var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");

View File

@@ -1,9 +1,8 @@
using Content.Client.Arcade.UI;
using System.Numerics;
using Content.Client.Arcade.UI;
using Content.Shared.Arcade;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
using Vector2 = Robust.Shared.Maths.Vector2;
namespace Content.Client.Arcade
{
@@ -20,7 +19,7 @@ namespace Content.Client.Arcade
private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons
public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner)
{
MinSize = SetSize = (300, 225);
MinSize = SetSize = new Vector2(300, 225);
Title = Loc.GetString("spacevillain-menu-title");
Owner = owner;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Atmos.EntitySystems;
using Content.Shared.Atmos;
using Content.Shared.Atmos.EntitySystems;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Atmos.Components;
using Content.Client.Atmos.EntitySystems;
using Content.Shared.Atmos;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Atmos;
using Content.Shared.Temperature;

View File

@@ -11,6 +11,7 @@ using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using Robust.Client.GameObjects;
namespace Content.Client.Audio;
@@ -36,6 +37,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
private int _maxAmbientCount;
private bool _overlayEnabled;
private float _maxAmbientRange;
private Vector2 MaxAmbientVector => new(_maxAmbientRange, _maxAmbientRange);
private float _cooldown;
private TimeSpan _targetTime = TimeSpan.Zero;
private float _ambienceVolume = 0.0f;
@@ -210,7 +213,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
? xform.LocalPosition - state.Player.LocalPosition
: xform.WorldPosition - state.MapPos;
var range = delta.Length;
var range = delta.Length();
if (range >= ambientComp.Range)
return true;
@@ -250,7 +253,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
? xform.LocalPosition - playerXform.LocalPosition
: xform.WorldPosition - mapPos.Position;
if (distance.LengthSquared < comp.Range * comp.Range)
if (distance.LengthSquared() < comp.Range * comp.Range)
continue;
}
@@ -266,7 +269,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
var pos = mapPos.Position;
var state = new QueryState(pos, playerXform, query);
var worldAabb = new Box2(pos - _maxAmbientRange, pos + _maxAmbientRange);
var worldAabb = new Box2(pos - MaxAmbientVector, pos + MaxAmbientVector);
_treeSys.QueryAabb(ref state, Callback, mapPos.MapId, worldAabb);
// Add in range ambiences

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Audio;
using Robust.Shared.ComponentTrees;
using Robust.Shared.Physics;
@@ -13,7 +14,7 @@ public sealed class AmbientSoundTreeSystem : ComponentTreeSystem<AmbientSoundTre
protected override bool Recursive => true;
protected override Box2 ExtractAabb(in ComponentTreeEntry<AmbientSoundComponent> entry, Vector2 pos, Angle rot)
=> new Box2(pos - entry.Component.Range, pos + entry.Component.Range);
=> new Box2(pos - entry.Component.RangeVector, pos + entry.Component.RangeVector);
protected override Box2 ExtractAabb(in ComponentTreeEntry<AmbientSoundComponent> entry)
{

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Botany;
using Content.Client.Botany.Components;
using Robust.Client.GameObjects;

View File

@@ -1,4 +1,5 @@
using Robust.Client.AutoGenerated;
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -20,7 +21,7 @@ internal sealed partial class BqlResultsWindow : DefaultWindow
RobustXamlLoader.Load(this);
}
protected override Vector2 ContentsMinimumSize => (500, 700);
protected override Vector2 ContentsMinimumSize => new(500, 700);
public void Update((string name, EntityUid entity)[] entities)
{

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Camera;
namespace Content.Client.Camera;
@@ -17,15 +18,16 @@ public sealed class CameraRecoilSystem : SharedCameraRecoilSystem
public override void KickCamera(EntityUid uid, Vector2 recoil, CameraRecoilComponent? component = null)
{
if (!Resolve(uid, ref component, false)) return;
if (!Resolve(uid, ref component, false))
return;
// Use really bad math to "dampen" kicks when we're already kicked.
var existing = component.CurrentKick.Length;
var existing = component.CurrentKick.Length();
var dampen = existing / KickMagnitudeMax;
component.CurrentKick += recoil * (1 - dampen);
if (component.CurrentKick.Length > KickMagnitudeMax)
component.CurrentKick = component.CurrentKick.Normalized * KickMagnitudeMax;
if (component.CurrentKick.Length() > KickMagnitudeMax)
component.CurrentKick = component.CurrentKick.Normalized() * KickMagnitudeMax;
component.LastKickTime = 0;
}

View File

@@ -1,4 +1,5 @@
using Content.Shared.CardboardBox;
using System.Numerics;
using Content.Shared.CardboardBox;
using Content.Shared.CardboardBox.Components;
using Content.Shared.Examine;
using Content.Shared.Movement.Components;

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.EscapeMenu;
@@ -108,7 +109,7 @@ namespace Content.Client.Changelog
{
Texture = upArrow,
ModulateSelfOverride = Color.FromHex("#888"),
TextureScale = (0.5f, 0.5f),
TextureScale = new Vector2(0.5f, 0.5f),
Margin = new Thickness(4, 3),
VerticalAlignment = VAlignment.Bottom
},
@@ -122,7 +123,7 @@ namespace Content.Client.Changelog
{
Texture = upArrow,
ModulateSelfOverride = Color.FromHex("#888"),
TextureScale = (0.5f, 0.5f),
TextureScale = new Vector2(0.5f, 0.5f),
Margin = new Thickness(4, 3),
VerticalAlignment = VAlignment.Bottom
}
@@ -184,7 +185,7 @@ namespace Content.Client.Changelog
{
Texture = _resourceCache.GetTexture(new ResPath($"/Textures/Interface/Changelog/{file}")),
VerticalAlignment = VAlignment.Top,
TextureScale = (0.5f, 0.5f),
TextureScale = new Vector2(0.5f, 0.5f),
Margin = new Thickness(2, 4, 6, 2),
ModulateSelfOverride = Color.FromHex(color)
};

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Chat.Managers;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
@@ -80,7 +81,7 @@ namespace Content.Client.Chat.UI
ForceRunStyleUpdate();
bubble.Measure(Vector2.Infinity);
bubble.Measure(Vector2Helpers.Infinity);
ContentSize = bubble.DesiredSize;
_verticalOffsetAchieved = -ContentSize.Y;
}
@@ -130,7 +131,7 @@ namespace Content.Client.Chat.UI
var worldPos = xform.WorldPosition + offset;
var lowerCenter = _eyeManager.WorldToScreen(worldPos) / UIScale;
var screenPos = lowerCenter - (ContentSize.X / 2, ContentSize.Y + _verticalOffsetAchieved);
var screenPos = lowerCenter - new Vector2(ContentSize.X / 2, ContentSize.Y + _verticalOffsetAchieved);
// Round to nearest 0.5
screenPos = (screenPos * 2).Rounded() / 2;
LayoutContainer.SetPosition(this, screenPos);

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Shared.Chemistry;
@@ -59,7 +60,7 @@ namespace Content.Client.Chemistry.UI
{
Access = AccessLevel.Public,
StyleClasses = { styleBase },
MaxSize = (42, 28),
MaxSize = new Vector2(42, 28),
Group = pillTypeGroup
};
@@ -68,7 +69,7 @@ namespace Content.Client.Chemistry.UI
TextureRect pillTypeTexture = new TextureRect
{
Texture = specifier.Frame0(),
TextureScale = (1.75f, 1.75f),
TextureScale = new Vector2(1.75f, 1.75f),
Stretch = TextureRect.StretchMode.KeepCentered,
};

View File

@@ -1,4 +1,5 @@
using Robust.Client.Animations;
using Robust.Client.Graphics;
namespace Content.Client.Chemistry.Visualizers;
@@ -22,7 +23,7 @@ public sealed class FoamVisualsComponent : Component
/// <summary>
/// The state of the entities base sprite RSI that is displayed when the foam dissolves.
/// Cannot use <see cref="Robust.Graphics.RSI.StateKey"/> because it does not have <see cref="DataDefinitionAttribute"/> and I am not making an engine PR at this time.
/// Cannot use <see cref="RSI.StateKey"/> because it does not have <see cref="DataDefinitionAttribute"/> and I am not making an engine PR at this time.
/// </summary>
[DataField("animationState")]
public string State = "foam-dissolve";

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Utility;
@@ -62,7 +63,7 @@ namespace Content.Client.Clickable
if (layer.Texture != null)
{
// Convert to image coordinates
var imagePos = (Vector2i) (localPos * EyeManager.PixelsPerMeter * (1, -1) + layer.Texture.Size / 2f);
var imagePos = (Vector2i) (localPos * EyeManager.PixelsPerMeter * new Vector2(1, -1) + layer.Texture.Size / 2f);
if (_clickMapManager.IsOccluding(layer.Texture, imagePos))
return true;
@@ -80,7 +81,7 @@ namespace Content.Client.Clickable
var layerLocal = inverseMatrix.Transform(localPos);
// Convert to image coordinates
var layerImagePos = (Vector2i) (layerLocal * EyeManager.PixelsPerMeter * (1, -1) + rsiState.Size / 2f);
var layerImagePos = (Vector2i) (layerLocal * EyeManager.PixelsPerMeter * new Vector2(1, -1) + rsiState.Size / 2f);
// Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen.
// This **can** differ from the dir defined before, but can also just be the same.

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -43,7 +44,7 @@ namespace Content.Client.Cloning.UI
(new Control()
{
MinSize = (20, 0)
MinSize = new Vector2(20, 0)
}),
(DenyButton = new Button

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Clothing.Systems;
using Content.Client.Stylesheets;
using Robust.Client.AutoGenerated;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Hands.Systems;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Client.GameObjects;
@@ -77,7 +78,7 @@ public sealed class CombatModeIndicatorsOverlay : Overlay
private void DrawSight(Texture sight, DrawingHandleScreen screen, Vector2 centerPos, float scale)
{
var sightSize = sight.Size * scale;
var expandedSize = sightSize + 7f;
var expandedSize = sightSize + new Vector2(7f, 7f);
screen.DrawTextureRect(sight,
UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), StrokeColor);

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Movement.Systems;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Numerics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -21,7 +22,7 @@ namespace Content.Client.Configurable.UI
public ConfigurationMenu(ConfigurationBoundUserInterface owner)
{
MinSize = SetSize = (300, 250);
MinSize = SetSize = new Vector2(300, 250);
Owner = owner;
_inputs = new List<(string name, LineEdit input)>();

View File

@@ -1,4 +1,5 @@
using System;
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
@@ -71,7 +72,7 @@ namespace Content.Client.Construction.UI
public ConstructionMenu()
{
SetSize = MinSize = (720, 320);
SetSize = MinSize = new Vector2(720, 320);
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Threading;
using Content.Client.CombatMode;
using Content.Client.Gameplay;
@@ -171,8 +172,8 @@ namespace Content.Client.ContextMenu.UI
// open pop-up adjacent to the parent element. We want the sub-menu elements to align with this element
// which depends on the panel container style margins.
var altPos = element.GlobalPosition;
var pos = altPos + (element.Width + 2 * ContextMenuElement.ElementMargin, -2 * ContextMenuElement.ElementMargin);
element.SubMenu.Open(UIBox2.FromDimensions(pos, (1, 1)), altPos);
var pos = altPos + new Vector2(element.Width + 2 * ContextMenuElement.ElementMargin, -2 * ContextMenuElement.ElementMargin);
element.SubMenu.Open(UIBox2.FromDimensions(pos, new Vector2(1, 1)), altPos);
// draw on top of other menus
element.SubMenu.SetPositionLast();

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.CombatMode;
using Content.Client.Examine;
using Content.Client.Gameplay;
@@ -94,7 +95,7 @@ namespace Content.Client.ContextMenu.UI
Elements.Clear();
AddToUI(orderedStates);
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled.Position, (1, 1));
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled.Position, new Vector2(1, 1));
_context.RootMenu.Open(box);
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Shared.CCVar;
using Robust.Client.AutoGenerated;
@@ -86,7 +87,7 @@ namespace Content.Client.Credits
{
if (!first)
{
patronsContainer.AddChild(new Control {MinSize = (0, 10)});
patronsContainer.AddChild(new Control {MinSize = new Vector2(0, 10)});
}
first = false;
@@ -133,7 +134,7 @@ namespace Content.Client.Credits
{
if (!first)
{
ss14ContributorsContainer.AddChild(new Control {MinSize = (0, 10)});
ss14ContributorsContainer.AddChild(new Control {MinSize = new Vector2(0, 10)});
}
first = false;

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Shared.CCVar;
using Content.Shared.CrewManifest;
using Content.Shared.Roles;
@@ -146,7 +147,7 @@ public sealed partial class CrewManifestUi : DefaultWindow
{
var icon = new TextureRect()
{
TextureScale = (2, 2),
TextureScale = new Vector2(2, 2),
Stretch = TextureRect.StretchMode.KeepCentered
};

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Actions;
using Content.Client.Decals.Overlays;
using Content.Shared.Actions;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
@@ -54,7 +55,7 @@ public sealed class DecalPlacementOverlay : Overlay
if (snap)
{
localPos = (Vector2) localPos.Floored() + grid.TileSize / 2f;
localPos = (Vector2) localPos.Floored() + grid.TileSizeHalfVector;
}
// Nothing uses snap cardinals so probably don't need preview?

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.DoAfter;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;

View File

@@ -121,7 +121,7 @@ public sealed class DragDropHelper<T>
case DragState.MouseDown:
{
var screenPos = _inputManager.MouseScreenPosition;
if ((_mouseDownScreenPos.Position - screenPos.Position).Length > Deadzone)
if ((_mouseDownScreenPos.Position - screenPos.Position).Length() > Deadzone)
{
StartDragging();
}

View File

@@ -21,6 +21,7 @@ using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.DragDrop;
@@ -405,7 +406,9 @@ public sealed class DragDropSystem : SharedDragDropSystem
// find possible targets on screen even if not reachable
// TODO: Duplicated in SpriteSystem and TargetOutlineSystem. Should probably be cached somewhere for a frame?
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition);
var bounds = new Box2(mousePos.Position - 1.5f, mousePos.Position + 1.5f);
var expansion = new Vector2(1.5f, 1.5f);
var bounds = new Box2(mousePos.Position - expansion, mousePos.Position + expansion);
var pvsEntities = _lookup.GetEntitiesIntersecting(mousePos.MapId, bounds);
var spriteQuery = GetEntityQuery<SpriteComponent>();
@@ -510,7 +513,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
case DragState.MouseDown:
{
var screenPos = _inputManager.MouseScreenPosition;
if ((_mouseDownScreenPos!.Value.Position - screenPos.Position).Length > _deadzone)
if ((_mouseDownScreenPos!.Value.Position - screenPos.Position).Length() > _deadzone)
{
StartDrag();
}

View File

@@ -14,6 +14,7 @@ using Robust.Shared.Input.Binding;
using Robust.Shared.Map;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using System.Threading;
using Content.Shared.Eye.Blinding.Components;
using Robust.Client;
@@ -209,7 +210,7 @@ namespace Content.Client.Examine
hBox.AddChild(new SpriteView
{
Sprite = sprite, OverrideDirection = Direction.South,
SetSize = (32, 32),
SetSize = new Vector2(32, 32),
Margin = new Thickness(2, 0, 2, 0),
});
}
@@ -231,8 +232,8 @@ namespace Content.Client.Examine
});
}
panel.Measure(Vector2.Infinity);
var size = Vector2.ComponentMax((minWidth, 0), panel.DesiredSize);
panel.Measure(Vector2Helpers.Infinity);
var size = Vector2.Max(new Vector2(minWidth, 0), panel.DesiredSize);
_examineTooltipOpen.Open(UIBox2.FromDimensions(_popupPos.Position, size));
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Explosion;
using JetBrains.Annotations;
using Robust.Client.Graphics;
@@ -102,13 +103,13 @@ public sealed class ExplosionOverlay : Overlay
foreach (var tile in tiles)
{
var centre = ((Vector2) tile + 0.5f) * tileSize;
var centre = (tile + Vector2Helpers.Half) * tileSize;
if (!gridBounds.Contains(centre))
continue;
var texture = _robustRandom.Pick(frames);
drawHandle.DrawTextureRect(texture, Box2.CenteredAround(centre, (tileSize, tileSize)), textures.FireColor);
drawHandle.DrawTextureRect(texture, Box2.CenteredAround(centre, new Vector2(tileSize, tileSize)), textures.FireColor);
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Viewport;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
@@ -64,7 +65,7 @@ namespace Content.Client.Flash
screenSpaceHandle.UseShader(_shader);
_shader.SetParameter("percentComplete", percentComplete);
var screenSize = UIBox2.FromDimensions((0, 0), _displayManager.ScreenSize);
var screenSize = UIBox2.FromDimensions(new Vector2(0, 0), _displayManager.ScreenSize);
if (_screenshotTexture != null)
{

View File

@@ -1,4 +1,5 @@
using Content.Shared.FixedPoint;
using System.Numerics;
using Content.Shared.FixedPoint;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;
@@ -61,7 +62,7 @@ public sealed class PuddleOverlay : Overlay
foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.Owner))
{
var centre = ((Vector2) debugOverlayData.Pos + 0.5f) * mapGrid.TileSize;
var centre = (debugOverlayData.Pos + Vector2Helpers.Half) * mapGrid.TileSize;
// is the center of this tile visible
if (!gridBounds.Contains(centre))
@@ -93,7 +94,7 @@ public sealed class PuddleOverlay : Overlay
foreach (var debugOverlayData in _debugOverlaySystem.GetData(mapGrid.Owner))
{
var centre = ((Vector2) debugOverlayData.Pos + 0.5f) * mapGrid.TileSize;
var centre = (debugOverlayData.Pos + Vector2Helpers.Half) * mapGrid.TileSize;
// // is the center of this tile visible
if (!gridBounds.Contains(centre))

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Client.Clickable;
using Content.Client.ContextMenu.UI;
using Robust.Client.ComponentTrees;
@@ -90,7 +91,7 @@ namespace Content.Client.Gameplay
{
// Find all the entities intersecting our click
var spriteTree = _entityManager.EntitySysManager.GetEntitySystem<SpriteTreeSystem>();
var entities = spriteTree.QueryAabb(coordinates.MapId, Box2.CenteredAround(coordinates.Position, (1, 1)), true);
var entities = spriteTree.QueryAabb(coordinates.MapId, Box2.CenteredAround(coordinates.Position, new Vector2(1, 1)));
// Check the entities against whether or not we can click them
var foundEntities = new List<(EntityUid, int, uint, float)>(entities.Count);

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
@@ -41,7 +42,7 @@ public sealed class ReturnToBodyMenu : DefaultWindow
(new Control()
{
MinSize = (20, 0)
MinSize = new Vector2(20, 0)
}),
(DenyButton = new Button

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Gravity;
using Robust.Client.GameObjects;
using Robust.Client.Animations;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Camera;
using Content.Shared.Gravity;
using Robust.Client.Player;

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using Content.Client.ContextMenu.UI;
using Content.Client.Examine;
using Content.Client.Guidebook.Richtext;
@@ -159,7 +160,7 @@ public sealed partial class GuideEntityEmbed : BoxContainer, IDocumentTag
}
else
{
Scale = (2, 2);
Scale = new Vector2(2, 2);
}
if (args.TryGetValue("Interactive", out var interactive))

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Hands.Systems;
using Content.Shared.CCVar;
using Robust.Client.GameObjects;
@@ -63,10 +64,11 @@ namespace Content.Client.Hands
var screen = args.ScreenHandle;
var offset = _cfg.GetCVar(CCVars.HudHeldItemOffset);
var offsetVec = new Vector2(offset, offset);
if (IconOverride != null)
{
screen.DrawTexture(IconOverride, mousePos.Position - IconOverride.Size / 2 + offset, Color.White.WithAlpha(0.75f));
screen.DrawTexture(IconOverride, mousePos.Position - IconOverride.Size / 2 + offsetVec, Color.White.WithAlpha(0.75f));
return;
}
@@ -84,7 +86,7 @@ namespace Content.Client.Hands
screen.DrawEntity(handEntity.Value, halfSize, new Vector2(1f, 1f) * uiScale, Angle.Zero, Angle.Zero, Direction.South, sprite);
}, Color.Transparent);
screen.DrawTexture(_renderBackbuffer.Texture, mousePos.Position - halfSize + offset, Color.White.WithAlpha(0.75f));
screen.DrawTexture(_renderBackbuffer.Texture, mousePos.Position - halfSize + offsetVec, Color.White.WithAlpha(0.75f));
}
}
}

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using Content.Client.Animations;
using Content.Client.Examine;
using Content.Client.Strip;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Text;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
@@ -64,12 +65,12 @@ namespace Content.Client.HealthAnalyzer.UI
text.AppendLine();
}
Diagnostics.Text = text.ToString();
SetSize = (250, 600);
SetSize = new Vector2(250, 600);
}
else
{
Diagnostics.Text = Loc.GetString("health-analyzer-window-no-patient-data-text");
SetSize = (250, 100);
SetSize = new Vector2(250, 100);
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.IoC;
using Content.Client.Resources;
using Content.Shared.Damage;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.IconSmoothing;
using Robust.Client.GameObjects;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.IconSmoothing;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
@@ -35,7 +36,7 @@ namespace Content.Client.Info
Contents.AddChild(rootContainer);
SetSize = (650, 650);
SetSize = new Vector2(650, 650);
}
private void PopulateTutorial(Info tutorialList)

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Numerics;
using System.Threading.Tasks;
using Content.Client.Interactable;
using Content.Shared.ActionBlocker;
@@ -59,7 +60,7 @@ namespace Content.Client.Instruments.UI
PlaybackSlider.OnValueChanged += PlaybackSliderSeek;
PlaybackSlider.OnKeyBindUp += PlaybackSliderKeyUp;
MinSize = SetSize = (400, 150);
MinSize = SetSize = new Vector2(400, 150);
}
private void InstrumentOnMidiPlaybackEnded()

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Stylesheets;
@@ -139,14 +140,14 @@ namespace Content.Client.Inventory
// TODO fix layout container measuring (its broken atm).
// _strippingMenu.InvalidateMeasure();
// _strippingMenu.Contents.Measure(Vector2.Infinity);
// _strippingMenu.Contents.Measure(Vector2Helpers.Infinity);
// TODO allow windows to resize based on content's desired size
// for now: shit-code
// this breaks for drones (too many hands, lots of empty vertical space), and looks shit for monkeys and the like.
// but the window is realizable, so eh.
_strippingMenu.SetSize = (220, snare?.IsEnsnared == true ? 550 : 530);
_strippingMenu.SetSize = new Vector2(220, snare?.IsEnsnared == true ? 550 : 530);
}
private void AddHandButton(Hand hand)

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Immutable;
using System.Numerics;
using Content.Shared.Jittering;
using Robust.Client.Animations;
using Robust.Client.GameObjects;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.CrewManifest;
using Content.Client.GameTicking.Managers;
using Content.Client.UserInterface.Controls;
@@ -38,7 +39,7 @@ namespace Content.Client.LateJoin
public LateJoinGui()
{
MinSize = SetSize = (360, 560);
MinSize = SetSize = new Vector2(360, 560);
IoCManager.InjectDependencies(this);
_sprites = _entitySystem.GetEntitySystem<SpriteSystem>();
_crewManifest = _entitySystem.GetEntitySystem<CrewManifestSystem>();
@@ -228,7 +229,7 @@ namespace Content.Client.LateJoin
var icon = new TextureRect
{
TextureScale = (2, 2),
TextureScale = new Vector2(2, 2),
Stretch = TextureRect.StretchMode.KeepCentered
};
@@ -261,7 +262,7 @@ namespace Content.Client.LateJoin
jobSelector.AddChild(new TextureRect
{
TextureScale = (0.4f, 0.4f),
TextureScale = new Vector2(0.4f, 0.4f),
Stretch = TextureRect.StretchMode.KeepCentered,
Texture = _sprites.Frame0(new SpriteSpecifier.Texture(new ("/Textures/Interface/Nano/lock.svg.192dpi.png"))),
HorizontalExpand = true,

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Light;
using Content.Shared.Light.Component;
using Robust.Client.Graphics;
@@ -42,7 +43,7 @@ public sealed class HandheldLightStatus : Control
for (var i = 0; i < _sections.Length; i++)
{
var panel = new PanelContainer {MinSize = (20, 20)};
var panel = new PanelContainer {MinSize = new Vector2(20, 20)};
wrapper.AddChild(panel);
_sections[i] = panel;
}

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Humanoid;
using Content.Client.Inventory;
using Content.Client.Preferences;
@@ -96,7 +97,7 @@ namespace Content.Client.Lobby.UI
{
Sprite = _entityManager.GetComponent<SpriteComponent>(entity),
OverrideDirection = direction,
Scale = (2, 2)
Scale = new Vector2(2, 2)
};
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.MachineLinking;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
@@ -88,7 +89,7 @@ namespace Content.Client.MachineLinking.UI
var rightChild = RightButton.GetChild(right);
var y1 = leftChild.PixelPosition.Y + leftChild.PixelHeight / 2 + leftOffset;
var y2 = rightChild.PixelPosition.Y + rightChild.PixelHeight / 2 + rightOffset;
handle.DrawLine((0, y1), (PixelWidth, y2), Color.Cyan);
handle.DrawLine(new Vector2(0, y1), new Vector2(PixelWidth, y2), Color.Cyan);
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Maps;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
@@ -69,7 +70,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
RaiseNetworkEvent(new GridDragVelocityRequest()
{
Grid = _dragging.Value,
LinearVelocity = distance.LengthSquared > 0f ? (distance / (float) tickTime.TotalSeconds) * 0.25f : Vector2.Zero,
LinearVelocity = distance.LengthSquared() > 0f ? (distance / (float) tickTime.TotalSeconds) * 0.25f : Vector2.Zero,
});
}

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Shared.Medical.SuitSensor;
@@ -151,7 +152,7 @@ namespace Content.Client.Medical.CrewMonitoring
{
var dirIcon = new DirectionIcon()
{
SetSize = (IconSize, IconSize),
SetSize = new Vector2(IconSize, IconSize),
Margin = new(0, 0, 4, 0)
};
box.AddChild(dirIcon);
@@ -164,7 +165,7 @@ namespace Content.Client.Medical.CrewMonitoring
var displayPos = local.Floored();
var dirIcon = new DirectionIcon(snap, precision)
{
SetSize = (IconSize, IconSize),
SetSize = new Vector2(IconSize, IconSize),
Margin = new(0, 0, 4, 0)
};
box.AddChild(dirIcon);

View File

@@ -1,4 +1,5 @@
using Content.Shared.Emag.Systems;
using System.Numerics;
using Content.Shared.Emag.Systems;
using Content.Shared.Medical.Cryogenics;
using Content.Shared.Verbs;
using Robust.Client.GameObjects;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;

View File

@@ -61,7 +61,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
// Don't show particles unless the user is moving.
if (Container.TryGetContainingContainer(uid, out var container) &&
TryComp<PhysicsComponent>(container.Owner, out var body) &&
body.LinearVelocity.LengthSquared < 1f)
body.LinearVelocity.LengthSquared() < 1f)
return;
var uidXform = Transform(uid);

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;

View File

@@ -1,3 +1,5 @@
using System.Numerics;
namespace Content.Client.NPC;
[RegisterComponent]

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Physics.Controllers;
using Content.Shared.Movement.Components;
using Content.Shared.NPC;

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using System.Text;
using Content.Shared.NPC;
using Robust.Client.Graphics;
@@ -173,7 +174,7 @@ namespace Content.Client.NPC
{
var mousePos = _inputManager.MouseScreenPosition;
var mouseWorldPos = _eyeManager.ScreenToMap(mousePos);
var aabb = new Box2(mouseWorldPos.Position - SharedPathfindingSystem.ChunkSize, mouseWorldPos.Position + SharedPathfindingSystem.ChunkSize);
var aabb = new Box2(mouseWorldPos.Position - SharedPathfindingSystem.ChunkSizeVec, mouseWorldPos.Position + SharedPathfindingSystem.ChunkSizeVec);
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
if ((_system.Modes & PathfindingDebugMode.Crumb) != 0x0 &&
@@ -207,7 +208,7 @@ namespace Content.Client.NPC
foreach (var crumb in chunk.Value)
{
var crumbMapPos = worldMatrix.Transform(_system.GetCoordinate(chunk.Key, crumb.Coordinates));
var distance = (crumbMapPos - mouseWorldPos.Position).Length;
var distance = (crumbMapPos - mouseWorldPos.Position).Length();
if (distance < nearestDistance)
{
@@ -334,7 +335,9 @@ namespace Content.Client.NPC
{
if (!_system.Breadcrumbs.TryGetValue(grid.Owner, out var crumbs) ||
!xformQuery.TryGetComponent(grid.Owner, out var gridXform))
{
continue;
}
var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv();
worldHandle.SetTransform(worldMatrix);
@@ -357,6 +360,7 @@ namespace Content.Client.NPC
}
const float edge = 1f / SharedPathfindingSystem.SubStep / 4f;
var edgeVec = new Vector2(edge, edge);
var masked = crumb.Data.CollisionMask != 0 || crumb.Data.CollisionLayer != 0;
Color color;
@@ -375,7 +379,7 @@ namespace Content.Client.NPC
}
var coordinate = _system.GetCoordinate(chunk.Key, crumb.Coordinates);
worldHandle.DrawRect(new Box2(coordinate - edge, coordinate + edge), color.WithAlpha(0.25f));
worldHandle.DrawRect(new Box2(coordinate - edgeVec, coordinate + edgeVec), color.WithAlpha(0.25f));
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;

View File

@@ -1,4 +1,5 @@
using Content.Client.UserInterface.Controls;
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.DeviceLinking;
using Content.Shared.DeviceNetwork;
using Robust.Client.AutoGenerated;
@@ -6,7 +7,6 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Vector2 = Robust.Shared.Maths.Vector2;
namespace Content.Client.NetworkConfigurator;
@@ -187,7 +187,7 @@ public sealed partial class NetworkConfiguratorLinkMenu : FancyWindow
if (left == right)
{
handle.DrawLine((0, y1), (PixelWidth, y2), Color.Cyan);
handle.DrawLine(new Vector2(0, y1), new Vector2(PixelWidth, y2), Color.Cyan);
continue;
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Text;
using Content.Client.Resources;
using Robust.Client.Graphics;
@@ -89,7 +90,7 @@ namespace Content.Client.NodeContainer
sb.Append($"grid pos: {gridTile}\n");
sb.Append(group.DebugData);
args.ScreenHandle.DrawString(_font, mousePos + (20, -20), sb.ToString());
args.ScreenHandle.DrawString(_font, mousePos + new Vector2(20, -20), sb.ToString());
}
private void DrawWorld(in OverlayDrawArgs overlayDrawArgs)
@@ -105,7 +106,7 @@ namespace Content.Client.NodeContainer
_hovered = default;
var cursorBox = Box2.CenteredAround(_mouseWorldPos, (nodeSize, nodeSize));
var cursorBox = Box2.CenteredAround(_mouseWorldPos, new Vector2(nodeSize, nodeSize));
// Group visible nodes by grid tiles.
var worldAABB = overlayDrawArgs.WorldAABB;
@@ -145,14 +146,14 @@ namespace Content.Client.NodeContainer
var lCursorBox = invMatrix.TransformBox(cursorBox);
foreach (var (pos, list) in gridDict)
{
var centerPos = (Vector2) pos + grid.TileSize / 2f;
var centerPos = (Vector2) pos + grid.TileSizeHalfVector;
list.Sort(NodeDisplayComparer.Instance);
var offset = -(list.Count - 1) * nodeOffset / 2;
foreach (var (group, node) in list)
{
var nodePos = centerPos + (offset, offset);
var nodePos = centerPos + new Vector2(offset, offset);
if (lCursorBox.Contains(nodePos))
_hovered = (group.NetId, node.NetId);
@@ -166,7 +167,7 @@ namespace Content.Client.NodeContainer
foreach (var nodeRenderData in _nodeIndex.Values)
{
var pos = nodeRenderData.NodePos;
var bounds = Box2.CenteredAround(pos, (nodeSize, nodeSize));
var bounds = Box2.CenteredAround(pos, new Vector2(nodeSize, nodeSize));
var groupData = nodeRenderData.GroupData;
var color = groupData.Color;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Shared.Input;
using Robust.Client.AutoGenerated;
@@ -60,7 +61,7 @@ namespace Content.Client.Options.UI.Tabs
{
if (!first)
{
KeybindsContainer.AddChild(new Control {MinSize = (0, 8)});
KeybindsContainer.AddChild(new Control {MinSize = new Vector2(0, 8)});
}
first = false;
@@ -414,11 +415,11 @@ namespace Content.Client.Options.UI.Tabs
Orientation = LayoutOrientation.Horizontal,
Children =
{
new Control {MinSize = (5, 0)},
new Control {MinSize = new Vector2(5, 0)},
name,
BindButton1,
BindButton2,
new Control {MinSize = (10, 0)},
new Control {MinSize = new Vector2(10, 0)},
ResetButton
}
};
@@ -458,7 +459,7 @@ namespace Content.Client.Options.UI.Tabs
Button.OnKeyBindDown += ButtonOnOnKeyBindDown;
MinSize = (200, 0);
MinSize = new Vector2(200, 0);
}
protected override void EnteredTree()

View File

@@ -1,4 +1,5 @@
using Content.Shared.Follower;
using System.Numerics;
using Content.Shared.Follower;
using Content.Shared.Follower.Components;
using Robust.Client.Animations;
using Robust.Client.GameObjects;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Interaction;
using Content.Shared.Whitelist;
using Robust.Client.GameObjects;
@@ -58,7 +59,9 @@ public sealed class TargetOutlineSystem : EntitySystem
/// <summary>
/// The size of the box around the mouse to use when looking for valid targets.
/// </summary>
public float LookupSize = 2;
public float LookupSize = 1;
private Vector2 LookupVector => new(LookupSize, LookupSize);
private const string ShaderTargetValid = "SelectionOutlineInrange";
private const string ShaderTargetInvalid = "SelectionOutline";
@@ -116,7 +119,7 @@ public sealed class TargetOutlineSystem : EntitySystem
// find possible targets on screen
// TODO: Duplicated in SpriteSystem and DragDropSystem. Should probably be cached somewhere for a frame?
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition).Position;
var bounds = new Box2(mousePos - LookupSize / 2f, mousePos + LookupSize / 2f);
var bounds = new Box2(mousePos - LookupVector, mousePos + LookupVector);
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Static);
var spriteQuery = GetEntityQuery<SpriteComponent>();
@@ -159,7 +162,7 @@ public sealed class TargetOutlineSystem : EntitySystem
{
var origin = Transform(player).WorldPosition;
var target = Transform(entity).WorldPosition;
valid = (origin - target).LengthSquared <= Range;
valid = (origin - target).LengthSquared() <= Range;
}
if (sprite.PostShader != null &&

View File

@@ -1,4 +1,5 @@
using Robust.Client.AutoGenerated;
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

View File

@@ -1,4 +1,5 @@
using Robust.Client.AutoGenerated;
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;

View File

@@ -1,3 +1,5 @@
using System.Numerics;
namespace Content.Client.Paper;
[RegisterComponent]

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Paper;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;

View File

@@ -1,7 +1,4 @@
using System;
using Robust.Client.Graphics;
using Content.Client.Parallax.Data;
using Robust.Shared.Serialization.Manager.Attributes;
using System.Numerics;
namespace Content.Client.Parallax.Data;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using System.Threading.Tasks;
using Robust.Shared.Maths;

View File

@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using Content.Client.Parallax.Data;

View File

@@ -1,4 +1,5 @@
using Content.Client.Parallax.Managers;
using System.Numerics;
using Content.Client.Parallax.Managers;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Shared.Random;
@@ -22,7 +23,7 @@ public sealed class ParallaxControl : Control
{
IoCManager.InjectDependencies(this);
Offset = (_random.Next(0, 1000), _random.Next(0, 1000));
Offset = new Vector2(_random.Next(0, 1000), _random.Next(0, 1000));
RectClipContent = true;
_parallaxManager.LoadParallaxByName("FastSpace");
}
@@ -54,7 +55,7 @@ public sealed class ParallaxControl : Control
{
for (var y = -scaledOffset.Y; y < ourSize.Y; y += texSize.Y)
{
handle.DrawTextureRect(tex, UIBox2.FromDimensions((x, y), texSize));
handle.DrawTextureRect(tex, UIBox2.FromDimensions(new Vector2(x, y), texSize));
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Parallax.Managers;
using Content.Shared.CCVar;
using Content.Shared.Parallax.Biomes;
@@ -101,7 +102,7 @@ public sealed class ParallaxOverlay : Overlay
{
for (var y = flooredBL.Y; y < args.WorldAABB.Top; y += size.Y)
{
worldHandle.DrawTextureRect(tex, Box2.FromDimensions((x, y), size));
worldHandle.DrawTextureRect(tex, Box2.FromDimensions(new Vector2(x, y), size));
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
@@ -51,7 +52,7 @@ namespace Content.Client.ParticleAccelerator.UI
public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owner)
{
SetSize = (400, 320);
SetSize = new Vector2(400, 320);
_greyScaleShader = IoCManager.Resolve<IPrototypeManager>().Index<ShaderPrototype>("Greyscale").Instance();
_owner = owner;
@@ -159,11 +160,11 @@ namespace Content.Client.ParticleAccelerator.UI
new PanelContainer
{
PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold},
MinSize = (0, 2),
MinSize = new Vector2(0, 2),
},
new Control
{
MinSize = (0, 4)
MinSize = new Vector2(0, 4)
},
new BoxContainer
@@ -210,7 +211,7 @@ namespace Content.Client.ParticleAccelerator.UI
},
new Control
{
MinSize = (0, 10),
MinSize = new Vector2(0, 10),
},
_drawLabel,
new Control
@@ -237,7 +238,7 @@ namespace Content.Client.ParticleAccelerator.UI
new BoxContainer
{
Orientation = LayoutOrientation.Vertical,
MinSize = (186, 0),
MinSize = new Vector2(186, 0),
Children =
{
(_statusLabel = new Label
@@ -246,7 +247,7 @@ namespace Content.Client.ParticleAccelerator.UI
}),
new Control
{
MinSize = (0, 20)
MinSize = new Vector2(0, 20)
},
new PanelContainer
{

View File

@@ -61,7 +61,7 @@ public sealed class JointVisualsOverlay : Overlay
var posA = coordsA.ToMapPos(_entManager, xformSystem);
var posB = coordsB.ToMapPos(_entManager, xformSystem);
var diff = (posB - posA);
var length = diff.Length;
var length = diff.Length();
var midPoint = diff / 2f + posA;
var angle = (posB - posA).ToWorldAngle();

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Pinpointer;
using Robust.Client.Graphics;
using Robust.Shared.Enums;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Shared.Pinpointer;
@@ -10,7 +11,6 @@ using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components;
using Vector2 = Robust.Shared.Maths.Vector2;
namespace Content.Client.Pinpointer.UI;
@@ -87,7 +87,7 @@ public sealed class NavMapControl : MapGridControl
};
AddChild(topContainer);
topPanel.Measure(Vector2.Infinity);
topPanel.Measure(Vector2Helpers.Infinity);
_recenter.OnPressed += args =>
{
@@ -153,7 +153,7 @@ public sealed class NavMapControl : MapGridControl
var frameTime = Timing.FrameTime;
var diff = _offset * (float) frameTime.TotalSeconds;
if (_offset.LengthSquared < _recenterMinimum)
if (_offset.LengthSquared() < _recenterMinimum)
{
_offset = Vector2.Zero;
_recentering = false;
@@ -337,6 +337,6 @@ public sealed class NavMapControl : MapGridControl
private Vector2 Scale(Vector2 position)
{
return position * MinimapScale + MidPoint;
return position * MinimapScale + MidpointVector;
}
}

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.Placement;
using Robust.Shared.Map;
using Robust.Shared.Maths;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Pointing.Components;
namespace Content.Client.Pointing.Components;
@@ -16,7 +17,7 @@ public sealed class PointingArrowComponent : SharedPointingArrowComponent
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("offset")]
public readonly Vector2 Offset = (0, 0.25f);
public readonly Vector2 Offset = new(0, 0.25f);
public readonly string AnimationKey = "pointingarrow";
}

Some files were not shown because too many files have changed in this diff Show More