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;