Skip to content

Commit

Permalink
Merge branch 'test-merge' into 'arumoon-server'
Browse files Browse the repository at this point in the history
Upstream & TG Maps update

See merge request Workbench-Team/space-station-14!89
  • Loading branch information
AruMoon committed Jul 20, 2023
2 parents 084c3dd + ee2365c commit 82de679
Show file tree
Hide file tree
Showing 1,549 changed files with 156,786 additions and 55,989 deletions.
6 changes: 3 additions & 3 deletions Content.Client/Access/UI/AccessStorageBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed class AccessStorageBoundUserInterface : BoundUserInterface
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;

public AccessStorageBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public AccessStorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

Expand All @@ -23,7 +23,7 @@ protected override void Open()

List<string> accessLevels;

if (_entityManager.TryGetComponent<AccessStorageComponent>(Owner.Owner, out var accessStorage))
if (EntMan.TryGetComponent<AccessStorageComponent>(Owner, out var accessStorage))
{
accessLevels = accessStorage.AccessLevels;
accessLevels.Sort();
Expand All @@ -33,7 +33,7 @@ protected override void Open()
accessLevels = new List<string>();
}

_window = new AccessStorageWindow(this, _prototypeManager, accessLevels) {Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
_window = new AccessStorageWindow(this, _prototypeManager, accessLevels) {Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName};

_window.OnClose += Close;
_window.OpenCentered();
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed class AgentIDCardBoundUserInterface : BoundUserInterface
{
private AgentIDCardWindow? _window;

public AgentIDCardBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public AgentIDCardBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

Expand Down
17 changes: 11 additions & 6 deletions Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ namespace Content.Client.Access.UI
public sealed class IdCardConsoleBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly SharedIdCardConsoleSystem _idCardConsoleSystem = default!;

public IdCardConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
private IdCardConsoleWindow? _window;

public IdCardConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_idCardConsoleSystem = EntMan.System<SharedIdCardConsoleSystem>();
}
private IdCardConsoleWindow? _window;

protected override void Open()
{
base.Open();
List<string> accessLevels;

if (_entityManager.TryGetComponent<IdCardConsoleComponent>(Owner.Owner, out var idCard))
if (EntMan.TryGetComponent<IdCardConsoleComponent>(Owner, out var idCard))
{
accessLevels = idCard.AccessLevels;
accessLevels.Sort();
}
else
{
accessLevels = new List<string>();
Logger.ErrorS(SharedIdCardConsoleSystem.Sawmill, $"No IdCardConsole component found for {_entityManager.ToPrettyString(Owner.Owner)}!");
_idCardConsoleSystem.Log.Error($"No IdCardConsole component found for {EntMan.ToPrettyString(Owner)}!");
}

_window = new IdCardConsoleWindow(this, _prototypeManager, accessLevels) {Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
_window = new IdCardConsoleWindow(this, _prototypeManager, accessLevels)
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName
};

_window.CrewManifestButton.OnPressed += _ => SendMessage(new CrewManifestOpenUiMessage());
_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Administration/AdminNameOverlay.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Administration.Systems;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Administration/Systems/KillSignSystem.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Administration/UI/AdminMenuWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -11,7 +12,7 @@ public sealed partial class AdminMenuWindow : DefaultWindow

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"));
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -57,7 +58,7 @@ private bool LineIdsClicked(BanListLine line)

_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;
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Administration/UI/CustomControls/VSeparator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Robust.Client.Graphics;
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Maths;

Expand All @@ -10,7 +11,7 @@ public sealed class VSeparator : PanelContainer

public VSeparator(Color color)
{
MinSize = (2, 5);
MinSize = new Vector2(2, 5);

AddChild(new PanelContainer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Shared.Administration.Notes;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -67,7 +68,7 @@ private bool NoteClicked(AdminNotesLine line)
};
_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;
Expand Down
7 changes: 4 additions & 3 deletions Content.Client/Administration/UI/PermissionsEui.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -339,7 +340,7 @@ public Menu(PermissionsEui ui)
Contents.AddChild(tab);
}

protected override Vector2 ContentsMinimumSize => (600, 400);
protected override Vector2 ContentsMinimumSize => new Vector2(600, 400);
}

private sealed class EditAdminWindow : DefaultWindow
Expand All @@ -356,7 +357,7 @@ private sealed class EditAdminWindow : DefaultWindow

public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data)
{
MinSize = (600, 400);
MinSize = new Vector2(600, 400);
SourceData = data;

Control nameControl;
Expand Down Expand Up @@ -534,7 +535,7 @@ private sealed class EditAdminRankWindow : DefaultWindow
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
Expand All @@ -22,7 +23,7 @@ public sealed partial class SetOutfitMenu : DefaultWindow

public SetOutfitMenu()
{
MinSize = SetSize = (250, 320);
MinSize = SetSize = new Vector2(250, 320);
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Shared.Enums;
using Robust.Shared.Map;
using System.Linq;
using System.Numerics;

namespace Content.Client.Administration.UI.SpawnExplosion;

Expand Down Expand Up @@ -94,7 +95,7 @@ private void DrawText(

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))
Expand All @@ -105,9 +106,9 @@ private void DrawText(
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"));
}
Expand All @@ -116,8 +117,8 @@ private void DrawText(
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);
}
Expand Down Expand Up @@ -168,7 +169,7 @@ private void DrawTiles(

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))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Explosion;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
Expand Down Expand Up @@ -120,7 +121,7 @@ private void UpdatePreview()
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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ namespace Content.Client.AirlockPainter.UI
{
public sealed class AirlockPainterBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private AirlockPainterWindow? _window;
private AirlockPainterSystem? _painter;

[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
[ViewVariables]
private AirlockPainterSystem? _painter;

public AirlockPainterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public AirlockPainterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

Expand All @@ -21,7 +22,7 @@ protected override void Open()

_window = new AirlockPainterWindow();

_painter = _entitySystems.GetEntitySystem<AirlockPainterSystem>();
_painter = EntMan.System<AirlockPainterSystem>();

_window.OpenCentered();
_window.OnClose += Close;
Expand Down
8 changes: 5 additions & 3 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Shared.Alert;
using Content.Shared.Mobs.Systems;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Player;
Expand Down Expand Up @@ -34,7 +35,7 @@ protected override void LoadPrototypes()

AlertOrder = _prototypeManager.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();
if (AlertOrder == null)
Logger.ErrorS("alert", "no alertOrder prototype found, alerts will be in random order");
Log.Error("alert", "no alertOrder prototype found, alerts will be in random order");
}

public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
Expand Down Expand Up @@ -67,9 +68,10 @@ protected override void AfterClearAlert(AlertsComponent alertsComponent)
private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args)
{
var componentAlerts = (args.Current as AlertsComponentState)?.Alerts;
if (componentAlerts == null) return;
if (componentAlerts == null)
return;

component.Alerts = new(componentAlerts);
component.Alerts = new Dictionary<AlertKey, AlertState>(componentAlerts);

if (_playerManager.LocalPlayer?.ControlledEntity == uid)
SyncAlerts?.Invoke(this, componentAlerts);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Ame/UI/AmeControllerBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class AmeControllerBoundUserInterface : BoundUserInterface
{
private AmeWindow? _window;

public AmeControllerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public AmeControllerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

Expand Down
1 change: 1 addition & 0 deletions Content.Client/Animations/ReusableAnimations.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Numerics;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Anomaly/AnomalySystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client. Anomaly.Ui;
namespace Content.Client.Anomaly.Ui;

[UsedImplicitly]
public sealed class AnomalyGeneratorBoundUserInterface : BoundUserInterface
{
private AnomalyGeneratorWindow? _window;

public AnomalyGeneratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base (owner, uiKey)
public AnomalyGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = new (Owner.Owner);
_window = new(Owner);

_window.OpenCentered();
_window.OnClose += Close;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class AnomalyScannerBoundUserInterface : BoundUserInterface
{
private AnomalyScannerMenu? _menu;

public AnomalyScannerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public AnomalyScannerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{

}
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Arcade/BlockGameMenu.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -61,7 +62,7 @@ public BlockGameMenu(BlockGameBoundUserInterface owner)
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");
Expand Down
Loading

0 comments on commit 82de679

Please sign in to comment.