diff --git a/.github/labeler.yml b/.github/labeler.yml
index e9267cbbc0..e4f7b60418 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -5,9 +5,9 @@
"Changes: Map":
- changed-files:
- any-glob-to-any-file:
- - 'Resources/Maps/*.yml'
- - 'Resources/Prototypes/Maps/*.yml'
- - 'Resources/Prototypes/Corvax/Maps/*.yml'
+ - 'Resources/Maps/**/*.yml'
+ - 'Resources/Prototypes/Maps/**/*.yml'
+ - 'Resources/Prototypes/Corvax/Maps/**/*.yml'
"Changes: UI":
- changed-files:
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 0e0d3ae890..0000000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "omnisharp.analyzeOpenDocumentsOnly": true,
- "dotnet.defaultSolution": "SpaceStation14.sln"
-}
diff --git a/Content.Client/Administration/UI/AdminMenuWindow.xaml b/Content.Client/Administration/UI/AdminMenuWindow.xaml
index d3d3df02d9..311d67b826 100644
--- a/Content.Client/Administration/UI/AdminMenuWindow.xaml
+++ b/Content.Client/Administration/UI/AdminMenuWindow.xaml
@@ -6,8 +6,7 @@
xmlns:tabs="clr-namespace:Content.Client.Administration.UI.Tabs"
xmlns:playerTab="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab"
xmlns:objectsTab="clr-namespace:Content.Client.Administration.UI.Tabs.ObjectsTab"
- xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab"
- xmlns:baby="clr-namespace:Content.Client.Administration.UI.Tabs.BabyJailTab">
+ xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab">
@@ -15,7 +14,6 @@
-
diff --git a/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs b/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs
index d5c43e2a50..51330a547e 100644
--- a/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs
+++ b/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs
@@ -15,18 +15,14 @@ public AdminMenuWindow()
MinSize = new Vector2(650, 250);
Title = Loc.GetString("admin-menu-title");
RobustXamlLoader.Load(this);
- MasterTabContainer.SetTabTitle((int) TabIndex.Admin, Loc.GetString("admin-menu-admin-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Adminbus, Loc.GetString("admin-menu-adminbus-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Atmos, Loc.GetString("admin-menu-atmos-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Round, Loc.GetString("admin-menu-round-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Server, Loc.GetString("admin-menu-server-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.PanicBunker, Loc.GetString("admin-menu-panic-bunker-tab"));
- /*
- * TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
- */
- MasterTabContainer.SetTabTitle((int) TabIndex.BabyJail, Loc.GetString("admin-menu-baby-jail-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Players, Loc.GetString("admin-menu-players-tab"));
- MasterTabContainer.SetTabTitle((int) TabIndex.Objects, Loc.GetString("admin-menu-objects-tab"));
+ MasterTabContainer.SetTabTitle(0, Loc.GetString("admin-menu-admin-tab"));
+ MasterTabContainer.SetTabTitle(1, Loc.GetString("admin-menu-adminbus-tab"));
+ MasterTabContainer.SetTabTitle(2, Loc.GetString("admin-menu-atmos-tab"));
+ MasterTabContainer.SetTabTitle(3, Loc.GetString("admin-menu-round-tab"));
+ MasterTabContainer.SetTabTitle(4, Loc.GetString("admin-menu-server-tab"));
+ MasterTabContainer.SetTabTitle(5, Loc.GetString("admin-menu-panic-bunker-tab"));
+ MasterTabContainer.SetTabTitle(6, Loc.GetString("admin-menu-players-tab"));
+ MasterTabContainer.SetTabTitle(7, Loc.GetString("admin-menu-objects-tab"));
MasterTabContainer.OnTabChanged += OnTabChanged;
}
diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml
deleted file mode 100644
index b8034faf52..0000000000
--- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs
deleted file mode 100644
index 9e1d53818f..0000000000
--- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Content.Client.Message;
-using Content.Client.UserInterface.Controls;
-using Robust.Client.AutoGenerated;
-using Robust.Client.UserInterface.CustomControls;
-using Robust.Client.UserInterface.XAML;
-
-namespace Content.Client.Administration.UI.Tabs.BabyJailTab;
-
-/*
- * TODO: Remove me once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
- */
-
-[GenerateTypedNameReferences]
-public sealed partial class BabyJailStatusWindow : FancyWindow
-{
- public BabyJailStatusWindow()
- {
- RobustXamlLoader.Load(this);
- MessageLabel.SetMarkup(Loc.GetString("admin-ui-baby-jail-is-enabled"));
- }
-}
diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml
deleted file mode 100644
index dd770c2be5..0000000000
--- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs
deleted file mode 100644
index aa9d6ced95..0000000000
--- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using Content.Shared.Administration.Events;
-using Robust.Client.AutoGenerated;
-using Robust.Client.UserInterface;
-using Robust.Client.UserInterface.XAML;
-using Robust.Shared.Console;
-
-/*
- * TODO: Remove me once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
- */
-
-namespace Content.Client.Administration.UI.Tabs.BabyJailTab;
-
-[GenerateTypedNameReferences]
-public sealed partial class BabyJailTab : Control
-{
- [Dependency] private readonly IConsoleHost _console = default!;
-
- private string _maxAccountAge;
- private string _maxOverallMinutes;
-
- public BabyJailTab()
- {
- RobustXamlLoader.Load(this);
- IoCManager.InjectDependencies(this);
-
- MaxAccountAge.OnTextEntered += args => SendMaxAccountAge(args.Text);
- MaxAccountAge.OnFocusExit += args => SendMaxAccountAge(args.Text);
- _maxAccountAge = MaxAccountAge.Text;
-
- MaxOverallMinutes.OnTextEntered += args => SendMaxOverallMinutes(args.Text);
- MaxOverallMinutes.OnFocusExit += args => SendMaxOverallMinutes(args.Text);
- _maxOverallMinutes = MaxOverallMinutes.Text;
- }
-
- private void SendMaxAccountAge(string text)
- {
- if (string.IsNullOrWhiteSpace(text) ||
- text == _maxAccountAge ||
- !int.TryParse(text, out var minutes))
- {
- return;
- }
-
- _console.ExecuteCommand($"babyjail_max_account_age {minutes}");
- }
-
- private void SendMaxOverallMinutes(string text)
- {
- if (string.IsNullOrWhiteSpace(text) ||
- text == _maxOverallMinutes ||
- !int.TryParse(text, out var minutes))
- {
- return;
- }
-
- _console.ExecuteCommand($"babyjail_max_overall_minutes {minutes}");
- }
-
- public void UpdateStatus(BabyJailStatus status)
- {
- EnabledButton.Pressed = status.Enabled;
- EnabledButton.Text = Loc.GetString(status.Enabled
- ? "admin-ui-baby-jail-enabled"
- : "admin-ui-baby-jail-disabled"
- );
- EnabledButton.ModulateSelfOverride = status.Enabled ? Color.Red : null;
- ShowReasonButton.Pressed = status.ShowReason;
-
- MaxAccountAge.Text = status.MaxAccountAgeMinutes.ToString();
- _maxAccountAge = MaxAccountAge.Text;
-
- MaxOverallMinutes.Text = status.MaxOverallMinutes.ToString();
- _maxOverallMinutes = MaxOverallMinutes.Text;
- }
-}
diff --git a/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs b/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs
index 182ddd74b6..336fd2830c 100644
--- a/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs
+++ b/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs
@@ -2,21 +2,36 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Prototypes;
+using Content.Shared.Inventory;
namespace Content.Client.Chat.TypingIndicator;
public sealed class TypingIndicatorVisualizerSystem : VisualizerSystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+ [Dependency] private readonly InventorySystem _inventory = default!;
+
protected override void OnAppearanceChange(EntityUid uid, TypingIndicatorComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
- if (!_prototypeManager.TryIndex(component.Prototype, out var proto))
+ var currentTypingIndicator = component.TypingIndicatorPrototype;
+
+ var evt = new BeforeShowTypingIndicatorEvent();
+
+ if (TryComp(uid, out var inventoryComp))
+ _inventory.RelayEvent((uid, inventoryComp), ref evt);
+
+ var overrideIndicator = evt.GetMostRecentIndicator();
+
+ if (overrideIndicator != null)
+ currentTypingIndicator = overrideIndicator.Value;
+
+ if (!_prototypeManager.TryIndex(currentTypingIndicator, out var proto))
{
- Log.Error($"Unknown typing indicator id: {component.Prototype}");
+ Log.Error($"Unknown typing indicator id: {component.TypingIndicatorPrototype}");
return;
}
diff --git a/Content.Client/Clickable/ClickableComponent.cs b/Content.Client/Clickable/ClickableComponent.cs
index 6f75df4683..987473ca46 100644
--- a/Content.Client/Clickable/ClickableComponent.cs
+++ b/Content.Client/Clickable/ClickableComponent.cs
@@ -48,7 +48,7 @@ public bool CheckClick(SpriteComponent sprite, TransformComponent transform, Ent
Angle cardinalSnapping = sprite.SnapCardinals ? relativeRotation.GetCardinalDir().ToAngle() : Angle.Zero;
// First we get `localPos`, the clicked location in the sprite-coordinate frame.
- var entityXform = Matrix3Helpers.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
+ var entityXform = Matrix3Helpers.CreateInverseTransform(spritePos, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
var localPos = Vector2.Transform(Vector2.Transform(worldPos, entityXform), invSpriteMatrix);
// Check explicitly defined click-able bounds
@@ -58,8 +58,11 @@ public bool CheckClick(SpriteComponent sprite, TransformComponent transform, Ent
// Next check each individual sprite layer using automatically computed click maps.
foreach (var spriteLayer in sprite.AllLayers)
{
- if (!spriteLayer.Visible || spriteLayer is not Layer layer)
+ // TODO: Move this to a system and also use SpriteSystem.IsVisible instead.
+ if (!spriteLayer.Visible || spriteLayer is not Layer layer || layer.CopyToShaderParameters != null)
+ {
continue;
+ }
// Check the layer's texture, if it has one
if (layer.Texture != null)
diff --git a/Content.Client/Commands/ZoomCommand.cs b/Content.Client/Commands/ZoomCommand.cs
index 2bdc85e1fe..c63eeea836 100644
--- a/Content.Client/Commands/ZoomCommand.cs
+++ b/Content.Client/Commands/ZoomCommand.cs
@@ -20,7 +20,7 @@ public sealed class ZoomCommand : LocalizedCommands
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
Vector2 zoom;
- if (args.Length is not (1 or 2))
+ if (args.Length is not (1 or 2 or 3))
{
shell.WriteLine(Help);
return;
@@ -57,11 +57,18 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
}
}
+ var scalePvs = true;
+ if (args.Length == 3 && !bool.TryParse(args[2], out scalePvs))
+ {
+ shell.WriteError(LocalizationManager.GetString("cmd-parse-failure-bool", ("arg", args[2])));
+ return;
+ }
+
var player = _playerManager.LocalSession?.AttachedEntity;
if (_entityManager.TryGetComponent(player, out var content))
{
- _entityManager.System().RequestZoom(player.Value, zoom, true, content);
+ _entityManager.System().RequestZoom(player.Value, zoom, true, scalePvs, content);
return;
}
diff --git a/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml.cs b/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml.cs
index 4d8dd86a4d..bbca06f519 100644
--- a/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml.cs
+++ b/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml.cs
@@ -113,7 +113,9 @@ public void UpdateCountdown()
}
EmergencyShuttleButton.Text = Loc.GetString("comms-console-menu-recall-shuttle");
- CountdownLabel.SetMessage($"Time remaining\n{Owner.Countdown.ToString()}s");
+ var infoText = Loc.GetString($"comms-console-menu-time-remaining",
+ ("time", Owner.Countdown.ToString()));
+ CountdownLabel.SetMessage(infoText);
}
public override void Close()
diff --git a/Content.Client/Fax/AdminUI/AdminFaxEui.cs b/Content.Client/Fax/AdminUI/AdminFaxEui.cs
index ace3f3eb7b..452c54eb79 100644
--- a/Content.Client/Fax/AdminUI/AdminFaxEui.cs
+++ b/Content.Client/Fax/AdminUI/AdminFaxEui.cs
@@ -16,7 +16,7 @@ public AdminFaxEui()
_window.OnClose += () => SendMessage(new AdminFaxEuiMsg.Close());
_window.OnFollowFax += entity => SendMessage(new AdminFaxEuiMsg.Follow(entity));
_window.OnMessageSend += args => SendMessage(new AdminFaxEuiMsg.Send(args.entity, args.title,
- args.stampedBy, args.message, args.stampSprite, args.stampColor));
+ args.stampedBy, args.message, args.stampSprite, args.stampColor, args.locked));
}
public override void Opened()
diff --git a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml
index d469a0e9d3..dc4092a3b5 100644
--- a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml
+++ b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml
@@ -23,7 +23,7 @@
-
-
+
+
diff --git a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs
index c1fba48309..698b3114b7 100644
--- a/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs
+++ b/Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs
@@ -14,7 +14,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
{
private const string StampsRsiPath = "/Textures/Objects/Misc/bureaucracy.rsi";
- public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
+ public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor, bool locked)>? OnMessageSend;
public Action? OnFollowFax;
[Dependency] private readonly IResourceCache _resCache = default!;
@@ -98,6 +98,7 @@ private void SendMessage(BaseButton.ButtonEventArgs obj)
var from = FromEdit.Text;
var stampColor = StampColorSelector.Color;
- OnMessageSend?.Invoke((faxEntity.Value, title, from, message, stamp, stampColor));
+ var locked = LockPageCheckbox.Pressed;
+ OnMessageSend?.Invoke((faxEntity.Value, title, from, message, stamp, stampColor, locked));
}
}
diff --git a/Content.Client/Jittering/JitteringSystem.cs b/Content.Client/Jittering/JitteringSystem.cs
index 185bd490d3..0c11a13963 100644
--- a/Content.Client/Jittering/JitteringSystem.cs
+++ b/Content.Client/Jittering/JitteringSystem.cs
@@ -48,6 +48,9 @@ private void OnAnimationCompleted(EntityUid uid, JitteringComponent jittering, A
if(args.Key != _jitterAnimationKey)
return;
+ if (!args.Finished)
+ return;
+
if (TryComp(uid, out AnimationPlayerComponent? animationPlayer)
&& TryComp(uid, out SpriteComponent? sprite))
_animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey);
diff --git a/Content.Client/Launcher/LauncherConnectingGui.xaml.cs b/Content.Client/Launcher/LauncherConnectingGui.xaml.cs
index ac74ad7b60..5015b710eb 100644
--- a/Content.Client/Launcher/LauncherConnectingGui.xaml.cs
+++ b/Content.Client/Launcher/LauncherConnectingGui.xaml.cs
@@ -116,7 +116,7 @@ private void HandleDisconnectReason(INetStructuredReason? reason)
private void ChangeLoginTip()
{
var tipsDataset = _cfg.GetCVar(CCVars.LoginTipsDataset);
- var loginTipsEnabled = _prototype.TryIndex(tipsDataset, out var tips);
+ var loginTipsEnabled = _prototype.TryIndex(tipsDataset, out var tips);
LoginTips.Visible = loginTipsEnabled;
if (!loginTipsEnabled)
@@ -131,7 +131,7 @@ private void ChangeLoginTip()
var randomIndex = _random.Next(tipList.Count);
var tip = tipList[randomIndex];
- LoginTip.SetMessage(tip);
+ LoginTip.SetMessage(Loc.GetString(tip));
LoginTipTitle.Text = Loc.GetString("connecting-window-tip", ("numberTip", randomIndex));
}
diff --git a/Content.Client/Light/EntitySystems/LightBehaviorSystem.cs b/Content.Client/Light/EntitySystems/LightBehaviorSystem.cs
index 11f69165cf..ca19d8522c 100644
--- a/Content.Client/Light/EntitySystems/LightBehaviorSystem.cs
+++ b/Content.Client/Light/EntitySystems/LightBehaviorSystem.cs
@@ -19,6 +19,9 @@ public override void Initialize()
private void OnBehaviorAnimationCompleted(EntityUid uid, LightBehaviourComponent component, AnimationCompletedEvent args)
{
+ if (!args.Finished)
+ return;
+
var container = component.Animations.FirstOrDefault(x => x.FullKey == args.Key);
if (container == null)
diff --git a/Content.Client/Light/EntitySystems/RotatingLightSystem.cs b/Content.Client/Light/EntitySystems/RotatingLightSystem.cs
index 842c13dedf..5c2c4e4c87 100644
--- a/Content.Client/Light/EntitySystems/RotatingLightSystem.cs
+++ b/Content.Client/Light/EntitySystems/RotatingLightSystem.cs
@@ -69,6 +69,9 @@ private void OnAfterAutoHandleState(EntityUid uid, RotatingLightComponent comp,
private void OnAnimationComplete(EntityUid uid, RotatingLightComponent comp, AnimationCompletedEvent args)
{
+ if (!args.Finished)
+ return;
+
PlayAnimation(uid, comp);
}
diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs
index 8e32be02a5..fbd7ee8521 100644
--- a/Content.Client/Lobby/LobbyUIController.cs
+++ b/Content.Client/Lobby/LobbyUIController.cs
@@ -47,6 +47,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered
/// This is the characher preview panel in the chat. This should only update if their character updates.
@@ -215,6 +216,46 @@ private void SaveProfile()
ReloadCharacterSetup();
}
+ private void CloseProfileEditor()
+ {
+ if (_profileEditor == null)
+ return;
+
+ _profileEditor.SetProfile(null, null);
+ _profileEditor.Visible = false;
+
+ if (_stateManager.CurrentState is LobbyState lobbyGui)
+ {
+ lobbyGui.SwitchState(LobbyGui.LobbyGuiState.Default);
+ }
+ }
+
+ private void OpenSavePanel()
+ {
+ if (_savePanel is { IsOpen: true })
+ return;
+
+ _savePanel = new CharacterSetupGuiSavePanel();
+
+ _savePanel.SaveButton.OnPressed += _ =>
+ {
+ SaveProfile();
+
+ _savePanel.Close();
+
+ CloseProfileEditor();
+ };
+
+ _savePanel.NoSaveButton.OnPressed += _ =>
+ {
+ _savePanel.Close();
+
+ CloseProfileEditor();
+ };
+
+ _savePanel.OpenCentered();
+ }
+
private (CharacterSetupGui, HumanoidProfileEditor) EnsureGui()
{
if (_characterSetup != null && _profileEditor != null)
@@ -241,14 +282,16 @@ private void SaveProfile()
_characterSetup.CloseButton.OnPressed += _ =>
{
- // Reset sliders etc.
- _profileEditor.SetProfile(null, null);
- _profileEditor.Visible = false;
-
- if (_stateManager.CurrentState is LobbyState lobbyGui)
+ // Open the save panel if we have unsaved changes.
+ if (_profileEditor.Profile != null && _profileEditor.IsDirty)
{
- lobbyGui.SwitchState(LobbyGui.LobbyGuiState.Default);
+ OpenSavePanel();
+
+ return;
}
+
+ // Reset sliders etc.
+ CloseProfileEditor();
};
_profileEditor.Save += SaveProfile;
diff --git a/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml b/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml
new file mode 100644
index 0000000000..2dcf914353
--- /dev/null
+++ b/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml.cs b/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml.cs
new file mode 100644
index 0000000000..5f2690b7a8
--- /dev/null
+++ b/Content.Client/Lobby/UI/CharacterSetupGuiSavePanel.xaml.cs
@@ -0,0 +1,21 @@
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.CustomControls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client.Lobby.UI;
+
+[GenerateTypedNameReferences]
+public sealed partial class CharacterSetupGuiSavePanel : DefaultWindow
+{
+ public CharacterSetupGuiSavePanel()
+ {
+ RobustXamlLoader.Load(this);
+
+ CancelButton.OnPressed += _ =>
+ {
+ Close();
+ };
+
+ CloseButton.Visible = false;
+ }
+}
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index f8894697fd..cca4c1d066 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -1213,7 +1213,7 @@ private void SetSpawnPriority(SpawnPriorityPreference newSpawnPriority)
SetDirty();
}
- private bool IsDirty
+ public bool IsDirty
{
get => _isDirty;
set
diff --git a/Content.Client/MouseRotator/MouseRotatorSystem.cs b/Content.Client/MouseRotator/MouseRotatorSystem.cs
index ce174c6144..18d60d9a7b 100644
--- a/Content.Client/MouseRotator/MouseRotatorSystem.cs
+++ b/Content.Client/MouseRotator/MouseRotatorSystem.cs
@@ -2,7 +2,6 @@
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Player;
-using Robust.Client.Replays.Loading;
using Robust.Shared.Map;
using Robust.Shared.Timing;
@@ -46,13 +45,19 @@ public override void Update(float frameTime)
// only raise event if the cardinal direction has changed
if (rotator.Simple4DirMode)
{
- var angleDir = angle.GetCardinalDir();
- if (angleDir == curRot.GetCardinalDir())
+ var eyeRot = _eye.CurrentEye.Rotation; // camera rotation
+ var angleDir = (angle + eyeRot).GetCardinalDir(); // apply GetCardinalDir in the camera frame, not in the world frame
+ if (angleDir == (curRot + eyeRot).GetCardinalDir())
return;
- RaisePredictiveEvent(new RequestMouseRotatorRotationSimpleEvent()
+ var rotation = angleDir.ToAngle() - eyeRot; // convert back to world frame
+ if (rotation >= Math.PI) // convert to [-PI, +PI)
+ rotation -= 2 * Math.PI;
+ else if (rotation < -Math.PI)
+ rotation += 2 * Math.PI;
+ RaisePredictiveEvent(new RequestMouseRotatorRotationEvent
{
- Direction = angleDir,
+ Rotation = rotation
});
return;
diff --git a/Content.Client/Movement/Systems/ContentEyeSystem.cs b/Content.Client/Movement/Systems/ContentEyeSystem.cs
index 182ac92ae0..9fbd4b5c37 100644
--- a/Content.Client/Movement/Systems/ContentEyeSystem.cs
+++ b/Content.Client/Movement/Systems/ContentEyeSystem.cs
@@ -9,7 +9,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
{
[Dependency] private readonly IPlayerManager _player = default!;
- public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, ContentEyeComponent? content = null)
+ public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, bool scalePvs, ContentEyeComponent? content = null)
{
if (!Resolve(uid, ref content, false))
return;
@@ -19,6 +19,14 @@ public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, ContentEy
TargetZoom = zoom,
IgnoreLimit = ignoreLimit,
});
+
+ if (scalePvs)
+ RequestPvsScale(Math.Max(zoom.X, zoom.Y));
+ }
+
+ public void RequestPvsScale(float scale)
+ {
+ RaiseNetworkEvent(new RequestPvsScaleEvent(scale));
}
public void RequestToggleFov()
diff --git a/Content.Client/Radio/EntitySystems/RadioDeviceSystem.cs b/Content.Client/Radio/EntitySystems/RadioDeviceSystem.cs
new file mode 100644
index 0000000000..29d6c635eb
--- /dev/null
+++ b/Content.Client/Radio/EntitySystems/RadioDeviceSystem.cs
@@ -0,0 +1,23 @@
+using Content.Client.Radio.Ui;
+using Content.Shared.Radio;
+using Content.Shared.Radio.Components;
+using Robust.Client.GameObjects;
+
+namespace Content.Client.Radio.EntitySystems;
+
+public sealed class RadioDeviceSystem : EntitySystem
+{
+ [Dependency] private readonly UserInterfaceSystem _ui = default!;
+
+ ///
+ public override void Initialize()
+ {
+ SubscribeLocalEvent(OnAfterHandleState);
+ }
+
+ private void OnAfterHandleState(Entity ent, ref AfterAutoHandleStateEvent args)
+ {
+ if (_ui.TryGetOpenUi(ent.Owner, IntercomUiKey.Key, out var bui))
+ bui.Update(ent);
+ }
+}
diff --git a/Content.Client/Radio/Ui/IntercomBoundUserInterface.cs b/Content.Client/Radio/Ui/IntercomBoundUserInterface.cs
index abbb1d58ec..7b3e39aa08 100644
--- a/Content.Client/Radio/Ui/IntercomBoundUserInterface.cs
+++ b/Content.Client/Radio/Ui/IntercomBoundUserInterface.cs
@@ -1,6 +1,6 @@
using Content.Shared.Radio;
+using Content.Shared.Radio.Components;
using JetBrains.Annotations;
-using Robust.Client.GameObjects;
namespace Content.Client.Radio.Ui;
@@ -19,7 +19,9 @@ protected override void Open()
{
base.Open();
- _menu = new();
+ var comp = EntMan.GetComponent(Owner);
+
+ _menu = new((Owner, comp));
_menu.OnMicPressed += enabled =>
{
@@ -46,13 +48,8 @@ protected override void Dispose(bool disposing)
_menu?.Close();
}
- protected override void UpdateState(BoundUserInterfaceState state)
+ public void Update(Entity ent)
{
- base.UpdateState(state);
-
- if (state is not IntercomBoundUIState msg)
- return;
-
- _menu?.Update(msg);
+ _menu?.Update(ent);
}
}
diff --git a/Content.Client/Radio/Ui/IntercomMenu.xaml.cs b/Content.Client/Radio/Ui/IntercomMenu.xaml.cs
index 8b4b38753c..2e08913051 100644
--- a/Content.Client/Radio/Ui/IntercomMenu.xaml.cs
+++ b/Content.Client/Radio/Ui/IntercomMenu.xaml.cs
@@ -1,8 +1,9 @@
using Content.Client.UserInterface.Controls;
-using Content.Shared.Radio;
+using Content.Shared.Radio.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Client.Radio.Ui;
@@ -17,38 +18,54 @@ public sealed partial class IntercomMenu : FancyWindow
private readonly List _channels = new();
- public IntercomMenu()
+ public IntercomMenu(Entity entity)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
MicButton.OnPressed += args => OnMicPressed?.Invoke(args.Button.Pressed);
SpeakerButton.OnPressed += args => OnSpeakerPressed?.Invoke(args.Button.Pressed);
+
+ Update(entity);
}
- public void Update(IntercomBoundUIState state)
+ public void Update(Entity entity)
{
- MicButton.Pressed = state.MicEnabled;
- SpeakerButton.Pressed = state.SpeakerEnabled;
+ MicButton.Pressed = entity.Comp.MicrophoneEnabled;
+ SpeakerButton.Pressed = entity.Comp.SpeakerEnabled;
+
+ MicButton.Disabled = entity.Comp.SupportedChannels.Count == 0;
+ SpeakerButton.Disabled = entity.Comp.SupportedChannels.Count == 0;
+ ChannelOptions.Disabled = entity.Comp.SupportedChannels.Count == 0;
ChannelOptions.Clear();
_channels.Clear();
- for (var i = 0; i < state.AvailableChannels.Count; i++)
+ for (var i = 0; i < entity.Comp.SupportedChannels.Count; i++)
{
- var channel = state.AvailableChannels[i];
- if (!_prototype.TryIndex(channel, out var prototype))
+ var channel = entity.Comp.SupportedChannels[i];
+ if (!_prototype.TryIndex(channel, out var prototype))
continue;
_channels.Add(channel);
ChannelOptions.AddItem(Loc.GetString(prototype.Name), i);
- if (channel == state.SelectedChannel)
+ if (channel == entity.Comp.CurrentChannel)
ChannelOptions.Select(i);
}
+
+ if (entity.Comp.SupportedChannels.Count == 0)
+ {
+ ChannelOptions.AddItem(Loc.GetString("intercom-options-none"), 0);
+ ChannelOptions.Select(0);
+ }
+
ChannelOptions.OnItemSelected += args =>
{
+ if (!_channels.TryGetValue(args.Id, out var proto))
+ return;
+
ChannelOptions.SelectId(args.Id);
- OnChannelSelected?.Invoke(_channels[args.Id]);
+ OnChannelSelected?.Invoke(proto);
};
}
}
diff --git a/Content.Client/Rotation/RotationVisualizerSystem.cs b/Content.Client/Rotation/RotationVisualizerSystem.cs
index 6105c10c80..6d3be4d1c0 100644
--- a/Content.Client/Rotation/RotationVisualizerSystem.cs
+++ b/Content.Client/Rotation/RotationVisualizerSystem.cs
@@ -23,8 +23,8 @@ private void OnAppearanceChange(EntityUid uid, RotationVisualsComponent componen
if (args.Sprite == null)
return;
- // If not defined, defaults to standing.
- _appearance.TryGetData(uid, RotationVisuals.RotationState, out var state, args.Component);
+ if (!_appearance.TryGetData(uid, RotationVisuals.RotationState, out var state, args.Component))
+ return;
switch (state)
{
diff --git a/Content.Client/Shuttles/UI/MapScreen.xaml.cs b/Content.Client/Shuttles/UI/MapScreen.xaml.cs
index 10800b8c5f..489dbc8c90 100644
--- a/Content.Client/Shuttles/UI/MapScreen.xaml.cs
+++ b/Content.Client/Shuttles/UI/MapScreen.xaml.cs
@@ -261,7 +261,7 @@ private void RebuildMapObjects()
ourMap = shuttleXform.MapID;
}
- while (mapComps.MoveNext(out var mapComp, out var mapXform, out var mapMetadata))
+ while (mapComps.MoveNext(out var mapUid, out var mapComp, out var mapXform, out var mapMetadata))
{
if (_console != null && !_shuttles.CanFTLTo(_shuttleEntity.Value, mapComp.MapId, _console.Value))
{
@@ -327,8 +327,10 @@ private void RebuildMapObjects()
{
AddMapObject(mapComp.MapId, gridObj);
}
- else if (!_shuttles.IsBeaconMap(_mapManager.GetMapEntityId(mapComp.MapId)) && (iffComp == null ||
- (iffComp.Flags & IFFFlags.Hide) == 0x0))
+ // If we can show it then add it to pending.
+ else if (!_shuttles.IsBeaconMap(mapUid) && (iffComp == null ||
+ (iffComp.Flags & IFFFlags.Hide) == 0x0) &&
+ !gridObj.HideButton)
{
_pendingMapObjects.Add((mapComp.MapId, gridObj));
}
@@ -336,11 +338,17 @@ private void RebuildMapObjects()
foreach (var (beacon, _) in _shuttles.GetExclusions(mapComp.MapId, _exclusions))
{
+ if (beacon.HideButton)
+ continue;
+
_pendingMapObjects.Add((mapComp.MapId, beacon));
}
foreach (var (beacon, _) in _shuttles.GetBeacons(mapComp.MapId, _beacons))
{
+ if (beacon.HideButton)
+ continue;
+
_pendingMapObjects.Add((mapComp.MapId, beacon));
}
@@ -425,9 +433,6 @@ private void AddMapObject(MapId mapId, IMapObject mapObj)
var existing = _mapObjects.GetOrNew(mapId);
existing.Add(mapObj);
- if (mapObj.HideButton)
- return;
-
var gridContents = _mapHeadings[mapId];
var gridButton = new Button()
diff --git a/Content.Client/Throwing/ThrownItemVisualizerSystem.cs b/Content.Client/Throwing/ThrownItemVisualizerSystem.cs
index b25b4fbb7d..28a07ae94a 100644
--- a/Content.Client/Throwing/ThrownItemVisualizerSystem.cs
+++ b/Content.Client/Throwing/ThrownItemVisualizerSystem.cs
@@ -59,7 +59,6 @@ private void OnShutdown(EntityUid uid, ThrownItemComponent component, ComponentS
if (length <= TimeSpan.Zero)
return null;
- length += TimeSpan.FromSeconds(ThrowingSystem.FlyTime);
var scale = ent.Comp2.Scale;
var lenFloat = (float) length.TotalSeconds;
diff --git a/Content.Client/UserInterface/Controls/RadialContainer.cs b/Content.Client/UserInterface/Controls/RadialContainer.cs
index be263d1277..be9b8817a0 100644
--- a/Content.Client/UserInterface/Controls/RadialContainer.cs
+++ b/Content.Client/UserInterface/Controls/RadialContainer.cs
@@ -67,11 +67,18 @@ public RadialContainer()
{
}
-
+
protected override void Draw(DrawingHandleScreen handle)
{
+
+ const float baseRadius = 100f;
+ const float radiusIncrement = 5f;
+
var children = ReserveSpaceForHiddenChildren ? Children : Children.Where(x => x.Visible);
var childCount = children.Count();
+
+ // Add padding from the center at higher child counts so they don't overlap.
+ Radius = baseRadius + (childCount * radiusIncrement);
// Determine the size of the arc, accounting for clockwise and anti-clockwise arrangements
var arc = AngularRange.Y - AngularRange.X;
diff --git a/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml b/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml
index 52346adba2..443b79242e 100644
--- a/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml
+++ b/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml
@@ -3,7 +3,7 @@
xmlns:windows="clr-namespace:Content.Client.UserInterface.Systems.Actions.Windows"
Name="ActionsList"
HorizontalExpand="True"
- Title="Actions"
+ Title="{Loc ui-actionmenu-title}"
VerticalExpand="True"
Resizable="True"
MinHeight="300"
diff --git a/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml.cs b/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml.cs
index fbe1e71535..f972a96eb7 100644
--- a/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Actions/Windows/ActionsWindow.xaml.cs
@@ -26,7 +26,7 @@ public ActionsWindow()
foreach (var filter in Enum.GetValues())
{
- FilterButton.AddItem(filter.ToString(), filter);
+ FilterButton.AddItem(Loc.GetString($"ui-actionmenu-{filter.ToString().ToLower()}"), filter);
}
}
diff --git a/Content.Client/UserInterface/Systems/Admin/AdminUIController.cs b/Content.Client/UserInterface/Systems/Admin/AdminUIController.cs
index d36a91c373..392a1a96de 100644
--- a/Content.Client/UserInterface/Systems/Admin/AdminUIController.cs
+++ b/Content.Client/UserInterface/Systems/Admin/AdminUIController.cs
@@ -3,7 +3,6 @@
using Content.Client.Administration.UI;
using Content.Client.Administration.UI.Tabs.ObjectsTab;
using Content.Client.Administration.UI.Tabs.PanicBunkerTab;
-using Content.Client.Administration.UI.Tabs.BabyJailTab;
using Content.Client.Administration.UI.Tabs.PlayerTab;
using Content.Client.Gameplay;
using Content.Client.Lobby;
@@ -38,13 +37,11 @@ public sealed class AdminUIController : UIController,
private AdminMenuWindow? _window;
private MenuButton? AdminButton => UIManager.GetActiveUIWidgetOrNull()?.AdminButton;
private PanicBunkerStatus? _panicBunker;
- private BabyJailStatus? _babyJail;
public override void Initialize()
{
base.Initialize();
SubscribeNetworkEvent(OnPanicBunkerUpdated);
- SubscribeNetworkEvent(OnBabyJailUpdated);
}
private void OnPanicBunkerUpdated(PanicBunkerChangedEvent msg, EntitySessionEventArgs args)
@@ -59,18 +56,6 @@ private void OnPanicBunkerUpdated(PanicBunkerChangedEvent msg, EntitySessionEven
}
}
- private void OnBabyJailUpdated(BabyJailChangedEvent msg, EntitySessionEventArgs args)
- {
- var showDialog = _babyJail == null && msg.Status.Enabled;
- _babyJail = msg.Status;
- _window?.BabyJailControl.UpdateStatus(msg.Status);
-
- if (showDialog)
- {
- UIManager.CreateWindow().OpenCentered();
- }
- }
-
public void OnStateEntered(GameplayState state)
{
EnsureWindow();
@@ -116,13 +101,6 @@ private void EnsureWindow()
if (_panicBunker != null)
_window.PanicBunkerControl.UpdateStatus(_panicBunker);
- /*
- * TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
- */
-
- if (_babyJail != null)
- _window.BabyJailControl.UpdateStatus(_babyJail);
-
_window.PlayerTabControl.OnEntryKeyBindDown += PlayerTabEntryKeyBindDown;
_window.ObjectsTabControl.OnEntryKeyBindDown += ObjectsTabEntryKeyBindDown;
_window.OnOpen += OnWindowOpen;
diff --git a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs
index fb74779917..5d7a775104 100644
--- a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs
+++ b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs
@@ -132,6 +132,9 @@ private void UpdateInventoryHotbar(InventorySlotsComponent? clientInv)
if (clientInv == null)
{
_inventoryHotbar?.ClearButtons();
+ if (_inventoryButton != null)
+ _inventoryButton.Visible = false;
+
return;
}
@@ -409,6 +412,8 @@ private void UnloadSlots()
{
slotGroup.ClearButtons();
}
+
+ UpdateInventoryHotbar(null);
}
private void SpriteUpdated(SlotSpriteUpdate update)
diff --git a/Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs b/Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs
index 32b1525226..c232e82313 100644
--- a/Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs
+++ b/Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs
@@ -18,7 +18,7 @@ public sealed class ActionsAddedTest
[Test]
public async Task TestCombatActionsAdded()
{
- await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true, DummyTicker = false});
+ await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true, DummyTicker = false });
var server = pair.Server;
var client = pair.Client;
var sEntMan = server.ResolveDependency();
diff --git a/Content.IntegrationTests/Tests/Body/GibTest.cs b/Content.IntegrationTests/Tests/Body/GibTest.cs
index c0032a8524..4627c79f64 100644
--- a/Content.IntegrationTests/Tests/Body/GibTest.cs
+++ b/Content.IntegrationTests/Tests/Body/GibTest.cs
@@ -5,7 +5,7 @@
namespace Content.IntegrationTests.Tests.Body;
[TestFixture]
-public sealed class GibTest
+public sealed class GibTest
{
[Test]
public async Task TestGib()
diff --git a/Content.IntegrationTests/Tests/Body/LegTest.cs b/Content.IntegrationTests/Tests/Body/LegTest.cs
index e86966f8f5..7b49bbe84a 100644
--- a/Content.IntegrationTests/Tests/Body/LegTest.cs
+++ b/Content.IntegrationTests/Tests/Body/LegTest.cs
@@ -5,7 +5,6 @@
using Content.Shared.Rotation;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
-using Robust.Shared.Maths;
namespace Content.IntegrationTests.Tests.Body
{
@@ -40,13 +39,14 @@ public async Task RemoveLegsFallTest()
var appearanceSystem = entityManager.System();
var xformSystem = entityManager.System();
+ var map = await pair.CreateTestMap();
+
await server.WaitAssertion(() =>
{
- var mapId = mapManager.CreateMap();
BodyComponent body = null;
human = entityManager.SpawnEntity("HumanBodyAndAppearanceDummy",
- new MapCoordinates(Vector2.Zero, mapId));
+ new MapCoordinates(Vector2.Zero, map.MapId));
Assert.Multiple(() =>
{
@@ -61,7 +61,7 @@ await server.WaitAssertion(() =>
foreach (var leg in legs)
{
- xformSystem.DetachParentToNull(leg.Id, entityManager.GetComponent(leg.Id));
+ xformSystem.DetachEntity(leg.Id, entityManager.GetComponent(leg.Id));
}
});
diff --git a/Content.IntegrationTests/Tests/Body/LungTest.cs b/Content.IntegrationTests/Tests/Body/LungTest.cs
index dce3741c98..9b5ee431f1 100644
--- a/Content.IntegrationTests/Tests/Body/LungTest.cs
+++ b/Content.IntegrationTests/Tests/Body/LungTest.cs
@@ -60,8 +60,8 @@ public async Task AirConsistencyTest()
var mapManager = server.ResolveDependency();
var entityManager = server.ResolveDependency();
var mapLoader = entityManager.System();
+ var mapSys = entityManager.System();
- MapId mapId;
EntityUid? grid = null;
BodyComponent body = default;
RespiratorComponent resp = default;
@@ -73,7 +73,7 @@ public async Task AirConsistencyTest()
await server.WaitPost(() =>
{
- mapId = mapManager.CreateMap();
+ mapSys.CreateMap(out var mapId);
Assert.That(mapLoader.TryLoad(mapId, testMapName, out var roots));
var query = entityManager.GetEntityQuery();
@@ -142,8 +142,8 @@ public async Task NoSuffocationTest()
var entityManager = server.ResolveDependency();
var cfg = server.ResolveDependency();
var mapLoader = entityManager.System();
+ var mapSys = entityManager.System();
- MapId mapId;
EntityUid? grid = null;
RespiratorComponent respirator = null;
EntityUid human = default;
@@ -152,7 +152,7 @@ public async Task NoSuffocationTest()
await server.WaitPost(() =>
{
- mapId = mapManager.CreateMap();
+ mapSys.CreateMap(out var mapId);
Assert.That(mapLoader.TryLoad(mapId, testMapName, out var ents), Is.True);
var query = entityManager.GetEntityQuery();
diff --git a/Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs b/Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs
index 670ce1a474..01482ba8ee 100644
--- a/Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs
+++ b/Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs
@@ -33,10 +33,11 @@ public async Task Test()
var mapLoader = entities.System();
var bodySystem = entities.System();
var containerSystem = entities.System();
+ var mapSys = entities.System();
await server.WaitAssertion(() =>
{
- var mapId = maps.CreateMap();
+ mapSys.CreateMap(out var mapId);
maps.CreateGrid(mapId);
var human = entities.SpawnEntity("HumanBodyDummy", new MapCoordinates(0, 0, mapId));
@@ -115,7 +116,7 @@ await server.WaitAssertion(() =>
mapLoader.SaveMap(mapId, mapPath);
maps.DeleteMap(mapId);
- mapId = maps.CreateMap();
+ mapSys.CreateMap(out mapId);
Assert.That(mapLoader.TryLoad(mapId, mapPath, out _), Is.True);
var query = EnumerateQueryEnumerator(
diff --git a/Content.IntegrationTests/Tests/Buckle/BuckleDragTest.cs b/Content.IntegrationTests/Tests/Buckle/BuckleDragTest.cs
index 8df151d5a0..82d5d3baa0 100644
--- a/Content.IntegrationTests/Tests/Buckle/BuckleDragTest.cs
+++ b/Content.IntegrationTests/Tests/Buckle/BuckleDragTest.cs
@@ -38,13 +38,13 @@ public async Task BucklePullTest()
await RunTicks(5);
Assert.That(buckle.Buckled, Is.True);
Assert.That(buckle.BuckledTo, Is.EqualTo(STarget));
- Assert.That(strap.BuckledEntities, Is.EquivalentTo(new[]{sUrist}));
+ Assert.That(strap.BuckledEntities, Is.EquivalentTo(new[] { sUrist }));
Assert.That(puller.Pulling, Is.Null);
Assert.That(pullable.Puller, Is.Null);
Assert.That(pullable.BeingPulled, Is.False);
// Start pulling, and thus unbuckle them
- await PressKey(ContentKeyFunctions.TryPullObject, cursorEntity:urist);
+ await PressKey(ContentKeyFunctions.TryPullObject, cursorEntity: urist);
await RunTicks(5);
Assert.That(buckle.Buckled, Is.False);
Assert.That(buckle.BuckledTo, Is.Null);
diff --git a/Content.IntegrationTests/Tests/CargoTest.cs b/Content.IntegrationTests/Tests/CargoTest.cs
index 8e1d536054..89018d9d17 100644
--- a/Content.IntegrationTests/Tests/CargoTest.cs
+++ b/Content.IntegrationTests/Tests/CargoTest.cs
@@ -19,11 +19,11 @@ namespace Content.IntegrationTests.Tests;
[TestFixture]
public sealed class CargoTest
{
- public static HashSet> Ignored = new ()
- {
+ private static readonly HashSet> Ignored =
+ [
// This is ignored because it is explicitly intended to be able to sell for more than it costs.
new("FunCrateGambling")
- };
+ ];
[Test]
public async Task NoCargoOrderArbitrage()
diff --git a/Content.IntegrationTests/Tests/Chemistry/FixedPoint2SerializationTest.cs b/Content.IntegrationTests/Tests/Chemistry/FixedPoint2SerializationTest.cs
index 8e3b89bff1..0e3f89c282 100644
--- a/Content.IntegrationTests/Tests/Chemistry/FixedPoint2SerializationTest.cs
+++ b/Content.IntegrationTests/Tests/Chemistry/FixedPoint2SerializationTest.cs
@@ -9,10 +9,10 @@ namespace Content.IntegrationTests.Tests.Chemistry
{
public sealed class FixedPoint2SerializationTest : SerializationTest
{
- protected override Assembly[] Assemblies => new[]
- {
+ protected override Assembly[] Assemblies =>
+ [
typeof(FixedPoint2SerializationTest).Assembly
- };
+ ];
[Test]
public void DeserializeNullTest()
@@ -53,6 +53,6 @@ public void DeserializeNullDefinitionTest()
[DataDefinition]
public sealed partial class FixedPoint2TestDefinition
{
- [DataField("unit")] public FixedPoint2? Unit { get; set; } = FixedPoint2.New(5);
+ [DataField] public FixedPoint2? Unit { get; set; } = FixedPoint2.New(5);
}
}
diff --git a/Content.IntegrationTests/Tests/Chemistry/SolutionRoundingTest.cs b/Content.IntegrationTests/Tests/Chemistry/SolutionRoundingTest.cs
index 4d19a96d9e..89d33186a2 100644
--- a/Content.IntegrationTests/Tests/Chemistry/SolutionRoundingTest.cs
+++ b/Content.IntegrationTests/Tests/Chemistry/SolutionRoundingTest.cs
@@ -1,5 +1,5 @@
-using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
@@ -76,7 +76,7 @@ public async Task Test()
await server.WaitPost(() =>
{
- var system = server.System();
+ var system = server.System();
var beaker = server.EntMan.SpawnEntity("SolutionRoundingTestContainer", testMap.GridCoords);
system.TryGetSolution(beaker, "beaker", out var newSolutionEnt, out var newSolution);
diff --git a/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs b/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs
index d96a035b2d..6b71dd08be 100644
--- a/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs
+++ b/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs
@@ -1,5 +1,5 @@
-using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.FixedPoint;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
@@ -11,7 +11,7 @@ namespace Content.IntegrationTests.Tests.Chemistry;
// To ensure volume(A) + volume(B) = volume(A+B)
// reactions can change this assumption
[TestFixture]
-[TestOf(typeof(SolutionContainerSystem))]
+[TestOf(typeof(SharedSolutionContainerSystem))]
public sealed class SolutionSystemTests
{
[TestPrototypes]
@@ -51,7 +51,7 @@ public async Task TryAddTwoNonReactiveReagent()
var entityManager = server.ResolveDependency();
var protoMan = server.ResolveDependency();
- var containerSystem = entityManager.System();
+ var containerSystem = entityManager.System();
var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
@@ -97,7 +97,7 @@ public async Task TryAddTooMuchNonReactiveReagent()
var entityManager = server.ResolveDependency();
var protoMan = server.ResolveDependency();
- var containerSystem = entityManager.System();
+ var containerSystem = entityManager.System();
var coordinates = testMap.GridCoords;
EntityUid beaker;
@@ -141,7 +141,7 @@ public async Task TryMixAndOverflowTooMuchReagent()
var entityManager = server.ResolveDependency();
var protoMan = server.ResolveDependency();
var testMap = await pair.CreateTestMap();
- var containerSystem = entityManager.System();
+ var containerSystem = entityManager.System();
var coordinates = testMap.GridCoords;
EntityUid beaker;
@@ -194,7 +194,7 @@ public async Task TryMixAndOverflowTooBigOverflow()
var entityManager = server.ResolveDependency();
var protoMan = server.ResolveDependency();
- var containerSystem = entityManager.System();
+ var containerSystem = entityManager.System();
var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
diff --git a/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs b/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs
index ddfe7b3481..3664cda922 100644
--- a/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs
+++ b/Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs
@@ -1,4 +1,3 @@
-using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Components;
using Robust.Shared.GameObjects;
@@ -6,6 +5,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;
+using Content.Shared.Chemistry.EntitySystems;
namespace Content.IntegrationTests.Tests.Chemistry
{
@@ -34,7 +34,7 @@ public async Task TryAllTest()
var prototypeManager = server.ResolveDependency();
var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
- var solutionContainerSystem = entityManager.System();
+ var solutionContainerSystem = entityManager.System();
foreach (var reactionPrototype in prototypeManager.EnumeratePrototypes())
{
diff --git a/Content.IntegrationTests/Tests/Commands/PardonCommand.cs b/Content.IntegrationTests/Tests/Commands/PardonCommand.cs
index b3a66e3211..4db9eabf5c 100644
--- a/Content.IntegrationTests/Tests/Commands/PardonCommand.cs
+++ b/Content.IntegrationTests/Tests/Commands/PardonCommand.cs
@@ -28,7 +28,7 @@ public async Task PardonTest()
Assert.That(netMan.IsConnected);
- Assert.That(sPlayerManager.Sessions.Count(), Is.EqualTo(1));
+ Assert.That(sPlayerManager.Sessions, Has.Length.EqualTo(1));
// No bans on record
Assert.Multiple(async () =>
{
@@ -50,7 +50,7 @@ public async Task PardonTest()
var banReason = "test";
- Assert.That(sPlayerManager.Sessions.Count(), Is.EqualTo(1));
+ Assert.That(sPlayerManager.Sessions, Has.Length.EqualTo(1));
// Ban the client for 24 hours
await server.WaitPost(() => sConsole.ExecuteCommand($"ban {clientSession.Name} {banReason} 1440"));
@@ -63,7 +63,7 @@ public async Task PardonTest()
});
await pair.RunTicksSync(5);
- Assert.That(sPlayerManager.Sessions.Count(), Is.EqualTo(0));
+ Assert.That(sPlayerManager.Sessions, Has.Length.EqualTo(0));
Assert.That(!netMan.IsConnected);
// Try to pardon a ban that does not exist
@@ -143,11 +143,11 @@ public async Task PardonTest()
});
// Reconnect client. Slightly faster than dirtying the pair.
- Assert.That(sPlayerManager.Sessions.Count(), Is.EqualTo(0));
+ Assert.That(sPlayerManager.Sessions, Is.Empty);
client.SetConnectTarget(server);
await client.WaitPost(() => netMan.ClientConnect(null!, 0, null!));
await pair.RunTicksSync(5);
- Assert.That(sPlayerManager.Sessions.Count(), Is.EqualTo(1));
+ Assert.That(sPlayerManager.Sessions, Has.Length.EqualTo(1));
await pair.CleanReturnAsync();
}
diff --git a/Content.IntegrationTests/Tests/Commands/RejuvenateTest.cs b/Content.IntegrationTests/Tests/Commands/RejuvenateTest.cs
index 2fda3ad58e..cfc8007306 100644
--- a/Content.IntegrationTests/Tests/Commands/RejuvenateTest.cs
+++ b/Content.IntegrationTests/Tests/Commands/RejuvenateTest.cs
@@ -37,9 +37,9 @@ public async Task RejuvenateDeadTest()
var server = pair.Server;
var entManager = server.ResolveDependency();
var prototypeManager = server.ResolveDependency();
- var mobStateSystem = entManager.EntitySysManager.GetEntitySystem();
- var damSystem = entManager.EntitySysManager.GetEntitySystem();
- var rejuvenateSystem = entManager.EntitySysManager.GetEntitySystem();
+ var mobStateSystem = entManager.System();
+ var damSystem = entManager.System();
+ var rejuvenateSystem = entManager.System();
await server.WaitAssertion(() =>
{
diff --git a/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs b/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs
index ff24ec0968..72a05b5246 100644
--- a/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs
+++ b/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs
@@ -26,7 +26,7 @@ public async Task RestartRoundAfterStart(bool lobbyEnabled)
var configManager = server.ResolveDependency();
var entityManager = server.ResolveDependency();
- var gameTicker = entityManager.EntitySysManager.GetEntitySystem();
+ var gameTicker = entityManager.System();
await pair.RunTicksSync(5);
diff --git a/Content.IntegrationTests/Tests/ContainerOcclusionTest.cs b/Content.IntegrationTests/Tests/ContainerOcclusionTest.cs
index c61a70faf0..37c4b0c9b5 100644
--- a/Content.IntegrationTests/Tests/ContainerOcclusionTest.cs
+++ b/Content.IntegrationTests/Tests/ContainerOcclusionTest.cs
@@ -43,11 +43,11 @@ public async Task TestA()
EntityUid dummy = default;
var mapManager = server.ResolveDependency();
- var mapId = mapManager.CreateMap();
+ var map = await pair.CreateTestMap();
await server.WaitPost(() =>
{
- var pos = new MapCoordinates(Vector2.Zero, mapId);
+ var pos = new MapCoordinates(Vector2.Zero, map.MapId);
var entStorage = serverEntManager.EntitySysManager.GetEntitySystem();
var container = serverEntManager.SpawnEntity("ContainerOcclusionA", pos);
dummy = serverEntManager.SpawnEntity("ContainerOcclusionDummy", pos);
@@ -85,11 +85,12 @@ public async Task TestB()
EntityUid dummy = default;
var mapManager = server.ResolveDependency();
- var mapId = mapManager.CreateMap();
+
+ var map = await pair.CreateTestMap();
await server.WaitPost(() =>
{
- var pos = new MapCoordinates(Vector2.Zero, mapId);
+ var pos = new MapCoordinates(Vector2.Zero, map.MapId);
var entStorage = serverEntManager.EntitySysManager.GetEntitySystem();
var container = serverEntManager.SpawnEntity("ContainerOcclusionB", pos);
dummy = serverEntManager.SpawnEntity("ContainerOcclusionDummy", pos);
@@ -127,11 +128,12 @@ public async Task TestAb()
EntityUid dummy = default;
var mapManager = server.ResolveDependency();
- var mapId = mapManager.CreateMap();
+
+ var map = await pair.CreateTestMap();
await server.WaitPost(() =>
{
- var pos = new MapCoordinates(Vector2.Zero, mapId);
+ var pos = new MapCoordinates(Vector2.Zero, map.MapId);
var entStorage = serverEntManager.EntitySysManager.GetEntitySystem();
var containerA = serverEntManager.SpawnEntity("ContainerOcclusionA", pos);
var containerB = serverEntManager.SpawnEntity("ContainerOcclusionB", pos);
diff --git a/Content.IntegrationTests/Tests/Damageable/DamageSpecifierTest.cs b/Content.IntegrationTests/Tests/Damageable/DamageSpecifierTest.cs
index 41d17ddeda..bd5cac05dd 100644
--- a/Content.IntegrationTests/Tests/Damageable/DamageSpecifierTest.cs
+++ b/Content.IntegrationTests/Tests/Damageable/DamageSpecifierTest.cs
@@ -14,39 +14,39 @@ public void TestDamageSpecifierOperations()
// Test basic math operations.
// I've already nearly broken these once. When editing the operators.
- DamageSpecifier input1 = new() { DamageDict = _input1 };
- DamageSpecifier input2 = new() { DamageDict = _input2 };
- DamageSpecifier output1 = new() { DamageDict = _output1 };
- DamageSpecifier output2 = new() { DamageDict = _output2 };
- DamageSpecifier output3 = new() { DamageDict = _output3 };
- DamageSpecifier output4 = new() { DamageDict = _output4 };
- DamageSpecifier output5 = new() { DamageDict = _output5 };
+ DamageSpecifier input1 = new() { DamageDict = Input1 };
+ DamageSpecifier input2 = new() { DamageDict = Input2 };
+ DamageSpecifier output1 = new() { DamageDict = Output1 };
+ DamageSpecifier output2 = new() { DamageDict = Output2 };
+ DamageSpecifier output3 = new() { DamageDict = Output3 };
+ DamageSpecifier output4 = new() { DamageDict = Output4 };
+ DamageSpecifier output5 = new() { DamageDict = Output5 };
Assert.Multiple(() =>
{
- Assert.That((-input1).Equals(output1));
- Assert.That((input1 / 2).Equals(output2));
- Assert.That((input1 * 2).Equals(output3));
+ Assert.That(-input1, Is.EqualTo(output1));
+ Assert.That(input1 / 2, Is.EqualTo(output2));
+ Assert.That(input1 * 2, Is.EqualTo(output3));
});
- var difference = (input1 - input2);
- Assert.That(difference.Equals(output4));
+ var difference = input1 - input2;
+ Assert.That(difference, Is.EqualTo(output4));
- var difference2 = (-input2) + input1;
- Assert.That(difference.Equals(difference2));
+ var difference2 = -input2 + input1;
+ Assert.That(difference, Is.EqualTo(difference2));
difference.Clamp(-0.25f, 0.25f);
- Assert.That(difference.Equals(output5));
+ Assert.That(difference, Is.EqualTo(output5));
}
- static Dictionary _input1 = new()
+ private static readonly Dictionary Input1 = new()
{
{ "A", 1.5f },
{ "B", 2 },
{ "C", 3 }
};
- static Dictionary _input2 = new()
+ private static readonly Dictionary Input2 = new()
{
{ "A", 1 },
{ "B", 2 },
@@ -54,28 +54,28 @@ public void TestDamageSpecifierOperations()
{ "D", 0.05f }
};
- static Dictionary _output1 = new()
+ private static readonly Dictionary Output1 = new()
{
{ "A", -1.5f },
{ "B", -2 },
{ "C", -3 }
};
- static Dictionary _output2 = new()
+ private static readonly Dictionary Output2 = new()
{
{ "A", 0.75f },
{ "B", 1 },
{ "C", 1.5 }
};
- static Dictionary _output3 = new()
+ private static readonly Dictionary Output3 = new()
{
{ "A", 3f },
{ "B", 4 },
{ "C", 6 }
};
- static Dictionary _output4 = new()
+ private static readonly Dictionary Output4 = new()
{
{ "A", 0.5f },
{ "B", 0 },
@@ -83,7 +83,7 @@ public void TestDamageSpecifierOperations()
{ "D", -0.05f }
};
- static Dictionary _output5 = new()
+ private static readonly Dictionary Output5 = new()
{
{ "A", 0.25f },
{ "B", 0 },
diff --git a/Content.IntegrationTests/Tests/Damageable/DamageableTest.cs b/Content.IntegrationTests/Tests/Damageable/DamageableTest.cs
index c40b8ed286..69069fc82f 100644
--- a/Content.IntegrationTests/Tests/Damageable/DamageableTest.cs
+++ b/Content.IntegrationTests/Tests/Damageable/DamageableTest.cs
@@ -107,10 +107,11 @@ public async Task TestDamageableComponents()
FixedPoint2 typeDamage;
+ var map = await pair.CreateTestMap();
+
await server.WaitPost(() =>
{
- var map = sMapManager.CreateMap();
- var coordinates = new MapCoordinates(0, 0, map);
+ var coordinates = map.MapCoords;
sDamageableEntity = sEntityManager.SpawnEntity("TestDamageableEntityId", coordinates);
sDamageableComponent = sEntityManager.GetComponent(sDamageableEntity);
diff --git a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs
index 2fbaa91456..e47c73611a 100644
--- a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs
+++ b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs
@@ -123,24 +123,24 @@ public async Task AirlockBlockTest()
var xformSystem = entityManager.System();
PhysicsComponent physBody = null;
- EntityUid AirlockPhysicsDummy = default;
+ EntityUid airlockPhysicsDummy = default;
EntityUid airlock = default;
DoorComponent doorComponent = null;
- var AirlockPhysicsDummyStartingX = -1;
+ var airlockPhysicsDummyStartingX = -1;
+
+ var map = await pair.CreateTestMap();
await server.WaitAssertion(() =>
{
- var mapId = mapManager.CreateMap();
-
- var humanCoordinates = new MapCoordinates(new Vector2(AirlockPhysicsDummyStartingX, 0), mapId);
- AirlockPhysicsDummy = entityManager.SpawnEntity("AirlockPhysicsDummy", humanCoordinates);
+ var humanCoordinates = new MapCoordinates(new Vector2(airlockPhysicsDummyStartingX, 0), map.MapId);
+ airlockPhysicsDummy = entityManager.SpawnEntity("AirlockPhysicsDummy", humanCoordinates);
- airlock = entityManager.SpawnEntity("AirlockDummy", new MapCoordinates(new Vector2(0, 0), mapId));
+ airlock = entityManager.SpawnEntity("AirlockDummy", new MapCoordinates(new Vector2(0, 0), map.MapId));
Assert.Multiple(() =>
{
- Assert.That(entityManager.TryGetComponent(AirlockPhysicsDummy, out physBody), Is.True);
+ Assert.That(entityManager.TryGetComponent(airlockPhysicsDummy, out physBody), Is.True);
Assert.That(entityManager.TryGetComponent(airlock, out doorComponent), Is.True);
});
Assert.That(doorComponent.State, Is.EqualTo(DoorState.Closed));
@@ -152,7 +152,7 @@ await server.WaitAssertion(() =>
await server.WaitAssertion(() => Assert.That(physBody, Is.Not.EqualTo(null)));
await server.WaitPost(() =>
{
- physicsSystem.SetLinearVelocity(AirlockPhysicsDummy, new Vector2(0.5f, 0f), body: physBody);
+ physicsSystem.SetLinearVelocity(airlockPhysicsDummy, new Vector2(0.5f, 0f), body: physBody);
});
for (var i = 0; i < 240; i += 10)
@@ -176,7 +176,7 @@ await server.WaitPost(() =>
// Blocked by the airlock
await server.WaitAssertion(() =>
{
- Assert.That(Math.Abs(xformSystem.GetWorldPosition(AirlockPhysicsDummy).X - 1), Is.GreaterThan(0.01f));
+ Assert.That(Math.Abs(xformSystem.GetWorldPosition(airlockPhysicsDummy).X - 1), Is.GreaterThan(0.01f));
});
await pair.CleanReturnAsync();
}
diff --git a/Content.IntegrationTests/Tests/DummyIconTest.cs b/Content.IntegrationTests/Tests/DummyIconTest.cs
index a11191a51e..df2d28a2ea 100644
--- a/Content.IntegrationTests/Tests/DummyIconTest.cs
+++ b/Content.IntegrationTests/Tests/DummyIconTest.cs
@@ -21,7 +21,7 @@ await client.WaitAssertion(() =>
{
foreach (var proto in prototypeManager.EnumeratePrototypes())
{
- if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto) || !proto.Components.ContainsKey("Sprite"))
+ if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto) || !proto.Components.ContainsKey("Sprite"))
continue;
Assert.DoesNotThrow(() =>
diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs
index 1fc739fb0c..42bea8989c 100644
--- a/Content.IntegrationTests/Tests/EntityTest.cs
+++ b/Content.IntegrationTests/Tests/EntityTest.cs
@@ -1,15 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
-using Content.Server.Humanoid.Components;
-using Content.Shared.Coordinates;
-using Content.Shared.Prototypes;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
-using Robust.Shared.Map.Components;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
@@ -47,7 +43,7 @@ await server.WaitPost(() =>
foreach (var protoId in protoIds)
{
- var mapId = mapManager.CreateMap();
+ mapSystem.CreateMap(out var mapId);
var grid = mapManager.CreateGridEntity(mapId);
// TODO: Fix this better in engine.
mapSystem.SetTile(grid.Owner, grid.Comp, Vector2i.Zero, new Tile(1));
@@ -155,6 +151,7 @@ public async Task SpawnAndDirtyAllEntities()
var prototypeMan = server.ResolveDependency();
var mapManager = server.ResolveDependency();
var sEntMan = server.ResolveDependency();
+ var mapSys = server.System();
Assert.That(cfg.GetCVar(CVars.NetPVS), Is.False);
@@ -170,7 +167,7 @@ await server.WaitPost(() =>
{
foreach (var protoId in protoIds)
{
- var mapId = mapManager.CreateMap();
+ mapSys.CreateMap(out var mapId);
var grid = mapManager.CreateGridEntity(mapId);
var ent = sEntMan.SpawnEntity(protoId, new EntityCoordinates(grid.Owner, 0.5f, 0.5f));
foreach (var (_, component) in sEntMan.GetNetComponents(ent))
@@ -227,6 +224,7 @@ public async Task SpawnAndDeleteEntityCountTest()
var settings = new PoolSettings { Connected = true, Dirty = true };
await using var pair = await PoolManager.GetServerClient(settings);
var mapManager = pair.Server.ResolveDependency();
+ var mapSys = pair.Server.System();
var server = pair.Server;
var client = pair.Client;
@@ -256,7 +254,7 @@ public async Task SpawnAndDeleteEntityCountTest()
await server.WaitPost(() =>
{
- mapId = mapManager.CreateMap();
+ mapSys.CreateMap(out mapId);
});
var coords = new MapCoordinates(Vector2.Zero, mapId);
diff --git a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs
index 6e88d6928e..d6f9bf3598 100644
--- a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs
+++ b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs
@@ -16,14 +16,15 @@ namespace Content.IntegrationTests.Tests.Fluids;
[TestOf(typeof(SpreaderSystem))]
public sealed class FluidSpill
{
- private static PuddleComponent? GetPuddle(IEntityManager entityManager, MapGridComponent mapGrid, Vector2i pos)
+ private static PuddleComponent? GetPuddle(IEntityManager entityManager, Entity mapGrid, Vector2i pos)
{
return GetPuddleEntity(entityManager, mapGrid, pos)?.Comp;
}
- private static Entity? GetPuddleEntity(IEntityManager entityManager, MapGridComponent mapGrid, Vector2i pos)
+ private static Entity? GetPuddleEntity(IEntityManager entityManager, Entity mapGrid, Vector2i pos)
{
- foreach (var uid in mapGrid.GetAnchoredEntities(pos))
+ var mapSys = entityManager.System();
+ foreach (var uid in mapSys.GetAnchoredEntities(mapGrid, mapGrid.Comp, pos))
{
if (entityManager.TryGetComponent(uid, out PuddleComponent? puddleComponent))
return (uid, puddleComponent);
@@ -39,9 +40,9 @@ public async Task SpillCorner()
var server = pair.Server;
var mapManager = server.ResolveDependency();
var entityManager = server.ResolveDependency();
- var puddleSystem = server.ResolveDependency().GetEntitySystem();
+ var puddleSystem = server.System();
+ var mapSystem = server.System();
var gameTiming = server.ResolveDependency();
- MapId mapId;
EntityUid gridId = default;
/*
@@ -52,7 +53,7 @@ . . .
*/
await server.WaitPost(() =>
{
- mapId = mapManager.CreateMap();
+ mapSystem.CreateMap(out var mapId);
var grid = mapManager.CreateGridEntity(mapId);
gridId = grid.Owner;
@@ -60,12 +61,12 @@ await server.WaitPost(() =>
{
for (var y = 0; y < 3; y++)
{
- grid.Comp.SetTile(new Vector2i(x, y), new Tile(1));
+ mapSystem.SetTile(grid, new Vector2i(x, y), new Tile(1));
}
}
- entityManager.SpawnEntity("WallReinforced", grid.Comp.GridTileToLocal(new Vector2i(0, 1)));
- entityManager.SpawnEntity("WallReinforced", grid.Comp.GridTileToLocal(new Vector2i(1, 0)));
+ entityManager.SpawnEntity("WallReinforced", mapSystem.GridTileToLocal(grid, grid.Comp, new Vector2i(0, 1)));
+ entityManager.SpawnEntity("WallReinforced", mapSystem.GridTileToLocal(grid, grid.Comp, new Vector2i(1, 0)));
});
@@ -74,10 +75,10 @@ await server.WaitAssertion(() =>
{
var grid = entityManager.GetComponent(gridId);
var solution = new Solution("Blood", FixedPoint2.New(100));
- var tileRef = grid.GetTileRef(puddleOrigin);
+ var tileRef = mapSystem.GetTileRef(gridId, grid, puddleOrigin);
#pragma warning disable NUnit2045 // Interdependent tests
Assert.That(puddleSystem.TrySpillAt(tileRef, solution, out _), Is.True);
- Assert.That(GetPuddle(entityManager, grid, puddleOrigin), Is.Not.Null);
+ Assert.That(GetPuddle(entityManager, (gridId, grid), puddleOrigin), Is.Not.Null);
#pragma warning restore NUnit2045
});
@@ -87,7 +88,7 @@ await server.WaitAssertion(() =>
await server.WaitAssertion(() =>
{
var grid = entityManager.GetComponent(gridId);
- var puddle = GetPuddleEntity(entityManager, grid, puddleOrigin);
+ var puddle = GetPuddleEntity(entityManager, (gridId, grid), puddleOrigin);
#pragma warning disable NUnit2045 // Interdependent tests
Assert.That(puddle, Is.Not.Null);
@@ -104,7 +105,7 @@ await server.WaitAssertion(() =>
}
var newPos = new Vector2i(x, y);
- var sidePuddle = GetPuddle(entityManager, grid, newPos);
+ var sidePuddle = GetPuddle(entityManager, (gridId, grid), newPos);
Assert.That(sidePuddle, Is.Null);
}
}
diff --git a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs
index a9069892df..ee2d0cb1f7 100644
--- a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs
+++ b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs
@@ -5,7 +5,6 @@
using Content.Shared.Fluids.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
-using Robust.Shared.Map.Components;
namespace Content.IntegrationTests.Tests.Fluids
{
@@ -21,8 +20,7 @@ public async Task TilePuddleTest()
var testMap = await pair.CreateTestMap();
- var entitySystemManager = server.ResolveDependency();
- var spillSystem = entitySystemManager.GetEntitySystem();
+ var spillSystem = server.System();
await server.WaitAssertion(() =>
{
@@ -46,17 +44,19 @@ public async Task SpaceNoPuddleTest()
var server = pair.Server;
var testMap = await pair.CreateTestMap();
- var grid = testMap.Grid.Comp;
+ var grid = testMap.Grid;
var entitySystemManager = server.ResolveDependency();
- var spillSystem = entitySystemManager.GetEntitySystem();
+ var spillSystem = server.System();
+ var mapSystem = server.System();
// Remove all tiles
await server.WaitPost(() =>
{
- foreach (var tile in grid.GetAllTiles())
+ var tiles = mapSystem.GetAllTiles(grid.Owner, grid.Comp);
+ foreach (var tile in tiles)
{
- grid.SetTile(tile.GridIndices, Tile.Empty);
+ mapSystem.SetTile(grid, tile.GridIndices, Tile.Empty);
}
});
diff --git a/Content.IntegrationTests/Tests/FollowerSystemTest.cs b/Content.IntegrationTests/Tests/FollowerSystemTest.cs
index 4d308c6d91..f4447426c7 100644
--- a/Content.IntegrationTests/Tests/FollowerSystemTest.cs
+++ b/Content.IntegrationTests/Tests/FollowerSystemTest.cs
@@ -22,6 +22,7 @@ public async Task FollowerMapDeleteTest()
var mapMan = server.ResolveDependency();
var sysMan = server.ResolveDependency();
var logMan = server.ResolveDependency();
+ var mapSys = server.System();
var logger = logMan.RootSawmill;
await server.WaitPost(() =>
@@ -29,7 +30,7 @@ await server.WaitPost(() =>
var followerSystem = sysMan.GetEntitySystem();
// Create a map to spawn the observers on.
- var map = mapMan.CreateMap();
+ mapSys.CreateMap(out var map);
// Spawn an observer to be followed.
var followed = entMan.SpawnEntity(GameTicker.ObserverPrototypeName, new MapCoordinates(0, 0, map));
@@ -41,7 +42,7 @@ await server.WaitPost(() =>
followerSystem.StartFollowingEntity(follower, followed);
- entMan.DeleteEntity(mapMan.GetMapEntityId(map));
+ entMan.DeleteEntity(mapSys.GetMap(map));
});
await pair.CleanReturnAsync();
}
diff --git a/Content.IntegrationTests/Tests/GameObjects/Components/ActionBlocking/HandCuffTest.cs b/Content.IntegrationTests/Tests/GameObjects/Components/ActionBlocking/HandCuffTest.cs
index 0ac6b68a3e..2570e2246a 100644
--- a/Content.IntegrationTests/Tests/GameObjects/Components/ActionBlocking/HandCuffTest.cs
+++ b/Content.IntegrationTests/Tests/GameObjects/Components/ActionBlocking/HandCuffTest.cs
@@ -1,5 +1,4 @@
#nullable enable
-using System.Numerics;
using Content.Server.Cuffs;
using Content.Shared.Body.Components;
using Content.Shared.Cuffs.Components;
@@ -7,7 +6,6 @@
using Robust.Server.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
-using Robust.Shared.Maths;
namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
{
@@ -52,10 +50,11 @@ public async Task Test()
var mapManager = server.ResolveDependency();
var host = server.ResolveDependency();
+ var map = await pair.CreateTestMap();
+
await server.WaitAssertion(() =>
{
- var mapId = mapManager.CreateMap();
- var coordinates = new MapCoordinates(Vector2.Zero, mapId);
+ var coordinates = map.MapCoords;
var cuffableSys = entityManager.System();
var xformSys = entityManager.System();
diff --git a/Content.IntegrationTests/Tests/GameRules/AntagPreferenceTest.cs b/Content.IntegrationTests/Tests/GameRules/AntagPreferenceTest.cs
index 1bea33a82b..b215584c57 100644
--- a/Content.IntegrationTests/Tests/GameRules/AntagPreferenceTest.cs
+++ b/Content.IntegrationTests/Tests/GameRules/AntagPreferenceTest.cs
@@ -47,7 +47,7 @@ public async Task TestLobbyPlayersValid()
Assert.That(sys.IsEntityValid(client.AttachedEntity, def), Is.True);
// By default, traitor/antag preferences are disabled, so the pool should be empty.
- var sessions = new List{pair.Player!};
+ var sessions = new List { pair.Player! };
var pool = sys.GetPlayerPool(rule, sessions, def);
Assert.That(pool.Count, Is.EqualTo(0));
diff --git a/Content.IntegrationTests/Tests/GameRules/FailAndStartPresetTest.cs b/Content.IntegrationTests/Tests/GameRules/FailAndStartPresetTest.cs
index f660eccf30..518166ed86 100644
--- a/Content.IntegrationTests/Tests/GameRules/FailAndStartPresetTest.cs
+++ b/Content.IntegrationTests/Tests/GameRules/FailAndStartPresetTest.cs
@@ -110,7 +110,7 @@ public async Task FailAndStartTest()
player = pair.Player!.AttachedEntity!.Value;
Assert.That(entMan.EntityExists(player));
- ticker.SetGamePreset((GamePresetPrototype?)null);
+ ticker.SetGamePreset((GamePresetPrototype?) null);
server.CfgMan.SetCVar(CCVars.GridFill, false);
server.CfgMan.SetCVar(CCVars.GameLobbyFallbackEnabled, true);
server.CfgMan.SetCVar(CCVars.GameLobbyDefaultPreset, "secret");
diff --git a/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs b/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
index fc50d0bd33..7b3c994302 100644
--- a/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
+++ b/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
@@ -7,6 +7,7 @@
using Content.Server.Mind;
using Content.Server.Pinpointer;
using Content.Server.Roles;
+using Content.Server.RoundEnd;
using Content.Server.Shuttles.Components;
using Content.Server.Station.Components;
using Content.Shared.CCVar;
@@ -49,6 +50,7 @@ public async Task TryStopNukeOpsFromConstantlyFailing()
var roleSys = server.System();
var invSys = server.System();
var factionSys = server.System();
+ var roundEndSys = server.System();
server.CfgMan.SetCVar(CCVars.GridFill, true);
@@ -63,11 +65,11 @@ public async Task TryStopNukeOpsFromConstantlyFailing()
// Opt into the nukies role.
await pair.SetAntagPreference("NukeopsCommander", true);
- await pair.SetAntagPreference( "NukeopsMedic", true, dummies[1].UserId);
+ await pair.SetAntagPreference("NukeopsMedic", true, dummies[1].UserId);
// Initially, the players have no attached entities
Assert.That(pair.Player?.AttachedEntity, Is.Null);
- Assert.That(dummies.All(x => x.AttachedEntity == null));
+ Assert.That(dummies.All(x => x.AttachedEntity == null));
// There are no grids or maps
Assert.That(entMan.Count(), Is.Zero);
@@ -150,7 +152,8 @@ void CheckDummy(int i)
}
// The game rule exists, and all the stations/shuttles/maps are properly initialized
- var rule = entMan.AllComponents().Single().Component;
+ var rule = entMan.AllComponents().Single();
+ var ruleComp = rule.Component;
var gridsRule = entMan.AllComponents().Single().Component;
foreach (var grid in gridsRule.MapGrids)
{
@@ -158,12 +161,14 @@ void CheckDummy(int i)
Assert.That(entMan.HasComponent(grid));
Assert.That(entMan.HasComponent(grid));
}
- Assert.That(entMan.EntityExists(rule.TargetStation));
+ Assert.That(entMan.EntityExists(ruleComp.TargetStation));
- Assert.That(entMan.HasComponent(rule.TargetStation));
+ Assert.That(entMan.HasComponent(ruleComp.TargetStation));
- var nukieShuttlEnt = entMan.AllComponents().FirstOrDefault().Uid;
+ var nukieShuttle = entMan.AllComponents().Single();
+ var nukieShuttlEnt = nukieShuttle.Uid;
Assert.That(entMan.EntityExists(nukieShuttlEnt));
+ Assert.That(nukieShuttle.Component.AssociatedRule, Is.EqualTo(rule.Uid));
EntityUid? nukieStationEnt = null;
foreach (var grid in gridsRule.MapGrids)
@@ -179,12 +184,12 @@ void CheckDummy(int i)
var nukieStation = entMan.GetComponent(nukieStationEnt!.Value);
Assert.That(entMan.EntityExists(nukieStation.Station));
- Assert.That(nukieStation.Station, Is.Not.EqualTo(rule.TargetStation));
+ Assert.That(nukieStation.Station, Is.Not.EqualTo(ruleComp.TargetStation));
Assert.That(server.MapMan.MapExists(gridsRule.Map));
var nukieMap = mapSys.GetMap(gridsRule.Map!.Value);
- var targetStation = entMan.GetComponent(rule.TargetStation!.Value);
+ var targetStation = entMan.GetComponent(ruleComp.TargetStation!.Value);
var targetGrid = targetStation.Grids.First();
var targetMap = entMan.GetComponent(targetGrid).MapUid!.Value;
Assert.That(targetMap, Is.Not.EqualTo(nukieMap));
@@ -206,7 +211,7 @@ void CheckDummy(int i)
Assert.That(LifeStage(targetMap), Is.GreaterThan(EntityLifeStage.Initialized));
Assert.That(LifeStage(nukieStationEnt.Value), Is.GreaterThan(EntityLifeStage.Initialized));
Assert.That(LifeStage(nukieShuttlEnt), Is.GreaterThan(EntityLifeStage.Initialized));
- Assert.That(LifeStage(rule.TargetStation), Is.GreaterThan(EntityLifeStage.Initialized));
+ Assert.That(LifeStage(ruleComp.TargetStation), Is.GreaterThan(EntityLifeStage.Initialized));
// Make sure the player has hands. We've had fucking disarmed nukies before.
Assert.That(entMan.HasComponent(player));
@@ -222,10 +227,10 @@ void CheckDummy(int i)
}
Assert.That(total, Is.GreaterThan(3));
- // Finally lets check the nukie commander passed basic training and figured out how to breathe.
+ // Check the nukie commander passed basic training and figured out how to breathe.
var totalSeconds = 30;
var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
- int increment = 5;
+ var increment = 5;
var resp = entMan.GetComponent(player);
var damage = entMan.GetComponent(player);
for (var tick = 0; tick < totalTicks; tick += increment)
@@ -235,7 +240,24 @@ void CheckDummy(int i)
Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero));
}
- ticker.SetGamePreset((GamePresetPrototype?)null);
+ // Check that the round does not end prematurely when agents are deleted in the outpost
+ var nukies = dummyEnts.Where(entMan.HasComponent).Append(player).ToArray();
+ await server.WaitAssertion(() =>
+ {
+ for (var i = 0; i < nukies.Length - 1; i++)
+ {
+ entMan.DeleteEntity(nukies[i]);
+ Assert.That(roundEndSys.IsRoundEndRequested, Is.False,
+ $"The round ended, but {nukies.Length - i - 1} nukies are still alive!");
+ }
+ // Delete the last nukie and make sure the round ends.
+ entMan.DeleteEntity(nukies[^1]);
+
+ Assert.That(roundEndSys.IsRoundEndRequested,
+ "All nukies were deleted, but the round didn't end!");
+ });
+
+ ticker.SetGamePreset((GamePresetPrototype?) null);
await pair.CleanReturnAsync();
}
}
diff --git a/Content.IntegrationTests/Tests/GravityGridTest.cs b/Content.IntegrationTests/Tests/GravityGridTest.cs
index 7f817e8a1e..64f7a6d082 100644
--- a/Content.IntegrationTests/Tests/GravityGridTest.cs
+++ b/Content.IntegrationTests/Tests/GravityGridTest.cs
@@ -34,29 +34,25 @@ public async Task Test()
var testMap = await pair.CreateTestMap();
- EntityUid generator = default;
- var entityMan = server.ResolveDependency();
- var mapMan = server.ResolveDependency();
+ var entityMan = server.EntMan;
+ var mapMan = server.MapMan;
var mapSys = entityMan.System();
- MapGridComponent grid1 = null;
- MapGridComponent grid2 = null;
- EntityUid grid1Entity = default!;
- EntityUid grid2Entity = default!;
+ EntityUid generator = default;
+ Entity grid1 = default;
+ Entity grid2 = default;
// Create grids
await server.WaitAssertion(() =>
{
var mapId = testMap.MapId;
- grid1 = mapMan.CreateGrid(mapId);
- grid2 = mapMan.CreateGrid(mapId);
- grid1Entity = grid1.Owner;
- grid2Entity = grid2.Owner;
+ grid1 = mapMan.CreateGridEntity(mapId);
+ grid2 = mapMan.CreateGridEntity(mapId);
- mapSys.SetTile(grid1Entity, grid1, Vector2i.Zero, new Tile(1));
- mapSys.SetTile(grid2Entity, grid2, Vector2i.Zero, new Tile(1));
+ mapSys.SetTile(grid1, grid1, Vector2i.Zero, new Tile(1));
+ mapSys.SetTile(grid2, grid2, Vector2i.Zero, new Tile(1));
- generator = entityMan.SpawnEntity("GridGravityGeneratorDummy", new EntityCoordinates(grid1Entity, 0.5f, 0.5f));
+ generator = entityMan.SpawnEntity("GridGravityGeneratorDummy", new EntityCoordinates(grid1, 0.5f, 0.5f));
Assert.Multiple(() =>
{
Assert.That(entityMan.HasComponent(generator));
@@ -77,8 +73,8 @@ await server.WaitAssertion(() =>
Assert.Multiple(() =>
{
Assert.That(generatorComponent.GravityActive, Is.True);
- Assert.That(!entityMan.GetComponent(grid1Entity).EnabledVV);
- Assert.That(entityMan.GetComponent(grid2Entity).EnabledVV);
+ Assert.That(!entityMan.GetComponent(grid1).EnabledVV);
+ Assert.That(entityMan.GetComponent(grid2).EnabledVV);
});
// Re-enable needs power so it turns off again.
@@ -95,7 +91,7 @@ await server.WaitAssertion(() =>
Assert.Multiple(() =>
{
Assert.That(generatorComponent.GravityActive, Is.False);
- Assert.That(entityMan.GetComponent(grid2Entity).EnabledVV, Is.False);
+ Assert.That(entityMan.GetComponent(grid2).EnabledVV, Is.False);
});
});
diff --git a/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs b/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs
index 2b844d34f0..6ac40e92a1 100644
--- a/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs
+++ b/Content.IntegrationTests/Tests/Interaction/Click/InteractionSystemTests.cs
@@ -48,13 +48,9 @@ public async Task InteractionTest()
var sysMan = server.ResolveDependency();
var handSys = sysMan.GetEntitySystem();
- var mapId = MapId.Nullspace;
- var coords = MapCoordinates.Nullspace;
- await server.WaitAssertion(() =>
- {
- mapId = mapManager.CreateMap();
- coords = new MapCoordinates(Vector2.Zero, mapId);
- });
+ var map = await pair.CreateTestMap();
+ var mapId = map.MapId;
+ var coords = map.MapCoords;
await server.WaitIdleAsync();
EntityUid user = default;
@@ -119,13 +115,9 @@ public async Task InteractionObstructionTest()
var sysMan = server.ResolveDependency();
var handSys = sysMan.GetEntitySystem();
- var mapId = MapId.Nullspace;
- var coords = MapCoordinates.Nullspace;
- await server.WaitAssertion(() =>
- {
- mapId = mapManager.CreateMap();
- coords = new MapCoordinates(Vector2.Zero, mapId);
- });
+ var map = await pair.CreateTestMap();
+ var mapId = map.MapId;
+ var coords = map.MapCoords;
await server.WaitIdleAsync();
EntityUid user = default;
@@ -190,13 +182,9 @@ public async Task InteractionInRangeTest()
var sysMan = server.ResolveDependency();
var handSys = sysMan.GetEntitySystem();
- var mapId = MapId.Nullspace;
- var coords = MapCoordinates.Nullspace;
- await server.WaitAssertion(() =>
- {
- mapId = mapManager.CreateMap();
- coords = new MapCoordinates(Vector2.Zero, mapId);
- });
+ var map = await pair.CreateTestMap();
+ var mapId = map.MapId;
+ var coords = map.MapCoords;
await server.WaitIdleAsync();
EntityUid user = default;
@@ -261,13 +249,9 @@ public async Task InteractionOutOfRangeTest()
var sysMan = server.ResolveDependency();
var handSys = sysMan.GetEntitySystem();
- var mapId = MapId.Nullspace;
- var coords = MapCoordinates.Nullspace;
- await server.WaitAssertion(() =>
- {
- mapId = mapManager.CreateMap();
- coords = new MapCoordinates(Vector2.Zero, mapId);
- });
+ var map = await pair.CreateTestMap();
+ var mapId = map.MapId;
+ var coords = map.MapCoords;
await server.WaitIdleAsync();
EntityUid user = default;
@@ -331,13 +315,9 @@ public async Task InsideContainerInteractionBlockTest()
var handSys = sysMan.GetEntitySystem();
var conSystem = sysMan.GetEntitySystem();
- var mapId = MapId.Nullspace;
- var coords = MapCoordinates.Nullspace;
- await server.WaitAssertion(() =>
- {
- mapId = mapManager.CreateMap();
- coords = new MapCoordinates(Vector2.Zero, mapId);
- });
+ var map = await pair.CreateTestMap();
+ var mapId = map.MapId;
+ var coords = map.MapCoords;
await server.WaitIdleAsync();
EntityUid user = default;
diff --git a/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs b/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs
index 719367e54e..801433ae72 100644
--- a/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs
+++ b/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs
@@ -39,10 +39,11 @@ public async Task EntityEntityTest()
EntityUid other = default;
MapCoordinates mapCoordinates = default;
+ var map = await pair.CreateTestMap();
+
await server.WaitAssertion(() =>
{
- var mapId = mapManager.CreateMap();
- var coordinates = new MapCoordinates(Vector2.Zero, mapId);
+ var coordinates = map.MapCoords;
origin = sEntities.SpawnEntity(HumanId, coordinates);
other = sEntities.SpawnEntity(HumanId, coordinates);
diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
index a61a059301..a09126a7f7 100644
--- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
+++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
@@ -571,11 +571,11 @@ protected async Task AssertTile(string? proto, NetCoordinates? coords = null)
var tile = Tile.Empty;
var serverCoords = SEntMan.GetCoordinates(coords ?? TargetCoords);
- var pos = serverCoords.ToMap(SEntMan, Transform);
+ var pos = Transform.ToMapCoordinates(serverCoords);
await Server.WaitPost(() =>
{
- if (MapMan.TryFindGridAt(pos, out _, out var grid))
- tile = grid.GetTileRef(serverCoords).Tile;
+ if (MapMan.TryFindGridAt(pos, out var gridUid, out var grid))
+ tile = MapSystem.GetTileRef(gridUid, grid, serverCoords).Tile;
});
Assert.That(tile.TypeId, Is.EqualTo(targetTile.TypeId));
@@ -757,33 +757,41 @@ protected bool TryComp([NotNullWhen(true)] out T? comp) where T : IComponent
///
/// Set the tile at the target position to some prototype.
///
- protected async Task SetTile(string? proto, NetCoordinates? coords = null, MapGridComponent? grid = null)
+ protected async Task SetTile(string? proto, NetCoordinates? coords = null, Entity? grid = null)
{
var tile = proto == null
? Tile.Empty
: new Tile(TileMan[proto].TileId);
- var pos = SEntMan.GetCoordinates(coords ?? TargetCoords).ToMap(SEntMan, Transform);
+ var pos = Transform.ToMapCoordinates(SEntMan.GetCoordinates(coords ?? TargetCoords));
+ EntityUid gridUid;
+ MapGridComponent? gridComp;
await Server.WaitPost(() =>
{
- if (grid != null || MapMan.TryFindGridAt(pos, out var gridUid, out grid))
+ if (grid is { } gridEnt)
{
- grid.SetTile(SEntMan.GetCoordinates(coords ?? TargetCoords), tile);
+ MapSystem.SetTile(gridEnt, SEntMan.GetCoordinates(coords ?? TargetCoords), tile);
+ return;
+ }
+ else if (MapMan.TryFindGridAt(pos, out var gUid, out var gComp))
+ {
+ MapSystem.SetTile(gUid, gComp, SEntMan.GetCoordinates(coords ?? TargetCoords), tile);
return;
}
if (proto == null)
return;
- var gridEnt = MapMan.CreateGridEntity(MapData.MapId);
+ gridEnt = MapMan.CreateGridEntity(MapData.MapId);
grid = gridEnt;
gridUid = gridEnt;
+ gridComp = gridEnt.Comp;
var gridXform = SEntMan.GetComponent(gridUid);
Transform.SetWorldPosition(gridXform, pos.Position);
- grid.SetTile(SEntMan.GetCoordinates(coords ?? TargetCoords), tile);
+ MapSystem.SetTile((gridUid, gridComp), SEntMan.GetCoordinates(coords ?? TargetCoords), tile);
- if (!MapMan.TryFindGridAt(pos, out _, out grid))
+ if (!MapMan.TryFindGridAt(pos, out _, out _))
Assert.Fail("Failed to create grid?");
});
await AssertTile(proto, coords);
diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
index 37102481ed..457d3e3192 100644
--- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
+++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
@@ -1,5 +1,4 @@
#nullable enable
-using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using Content.Client.Construction;
@@ -108,6 +107,7 @@ public abstract partial class InteractionTest
protected SharedItemToggleSystem ItemToggleSys = default!;
protected InteractionTestSystem STestSystem = default!;
protected SharedTransformSystem Transform = default!;
+ protected SharedMapSystem MapSystem = default!;
protected ISawmill SLogger = default!;
protected SharedUserInterfaceSystem SUiSys = default!;
@@ -153,7 +153,7 @@ public abstract partial class InteractionTest
[SetUp]
public virtual async Task Setup()
{
- Pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true, Dirty = true});
+ Pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true, Dirty = true });
// server dependencies
SEntMan = Server.ResolveDependency();
@@ -168,6 +168,7 @@ public virtual async Task Setup()
ItemToggleSys = SEntMan.System();
DoAfterSys = SEntMan.System();
Transform = SEntMan.System();
+ MapSystem = SEntMan.System();
SConstruction = SEntMan.System();
STestSystem = SEntMan.System();
Stack = SEntMan.System();
@@ -188,9 +189,10 @@ public virtual async Task Setup()
// Setup map.
await Pair.CreateTestMap();
- PlayerCoords = SEntMan.GetNetCoordinates(MapData.GridCoords.Offset(new Vector2(0.5f, 0.5f)).WithEntityId(MapData.MapUid, Transform, SEntMan));
- TargetCoords = SEntMan.GetNetCoordinates(MapData.GridCoords.Offset(new Vector2(1.5f, 0.5f)).WithEntityId(MapData.MapUid, Transform, SEntMan));
- await SetTile(Plating, grid: MapData.Grid.Comp);
+
+ PlayerCoords = SEntMan.GetNetCoordinates(Transform.WithEntityId(MapData.GridCoords.Offset(new Vector2(0.5f, 0.5f)), MapData.MapUid));
+ TargetCoords = SEntMan.GetNetCoordinates(Transform.WithEntityId(MapData.GridCoords.Offset(new Vector2(1.5f, 0.5f)), MapData.MapUid));
+ await SetTile(Plating, grid: MapData.Grid);
// Get player data
var sPlayerMan = Server.ResolveDependency();
@@ -263,7 +265,8 @@ public async Task TearDownInternal()
await TearDown();
}
- protected virtual async Task TearDown()
+ protected virtual Task TearDown()
{
+ return Task.CompletedTask;
}
}
diff --git a/Content.IntegrationTests/Tests/Linter/StaticFieldValidationTest.cs b/Content.IntegrationTests/Tests/Linter/StaticFieldValidationTest.cs
index 30724b50a6..0632fe1347 100644
--- a/Content.IntegrationTests/Tests/Linter/StaticFieldValidationTest.cs
+++ b/Content.IntegrationTests/Tests/Linter/StaticFieldValidationTest.cs
@@ -26,26 +26,26 @@ public async Task TestStaticFieldValidation()
protos.Add(kind, ids);
}
- Assert.That(protoMan.ValidateStaticFields(typeof(StringValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(StringArrayValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdArrayValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdTestValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdArrayValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdListValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdSetValid), protos).Count, Is.Zero);
- Assert.That(protoMan.ValidateStaticFields(typeof(PrivateProtoIdArrayValid), protos).Count, Is.Zero);
-
- Assert.That(protoMan.ValidateStaticFields(typeof(StringInvalid), protos).Count, Is.EqualTo(1));
- Assert.That(protoMan.ValidateStaticFields(typeof(StringArrayInvalid), protos).Count, Is.EqualTo(2));
- Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdInvalid), protos).Count, Is.EqualTo(1));
- Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdArrayInvalid), protos).Count, Is.EqualTo(2));
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdTestInvalid), protos).Count, Is.EqualTo(1));
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdArrayInvalid), protos).Count, Is.EqualTo(2));
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdListInvalid), protos).Count, Is.EqualTo(2));
- Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdSetInvalid), protos).Count, Is.EqualTo(2));
- Assert.That(protoMan.ValidateStaticFields(typeof(PrivateProtoIdArrayInvalid), protos).Count, Is.EqualTo(2));
-
+ Assert.That(protoMan.ValidateStaticFields(typeof(StringValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(StringArrayValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdArrayValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdTestValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdArrayValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdListValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdSetValid), protos), Is.Empty);
+ Assert.That(protoMan.ValidateStaticFields(typeof(PrivateProtoIdArrayValid), protos), Is.Empty);
+
+ Assert.That(protoMan.ValidateStaticFields(typeof(StringInvalid), protos), Has.Count.EqualTo(1));
+ Assert.That(protoMan.ValidateStaticFields(typeof(StringArrayInvalid), protos), Has.Count.EqualTo(2));
+ Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdInvalid), protos), Has.Count.EqualTo(1));
+ Assert.That(protoMan.ValidateStaticFields(typeof(EntProtoIdArrayInvalid), protos), Has.Count.EqualTo(2));
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdTestInvalid), protos), Has.Count.EqualTo(1));
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdArrayInvalid), protos), Has.Count.EqualTo(2));
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdListInvalid), protos), Has.Count.EqualTo(2));
+ Assert.That(protoMan.ValidateStaticFields(typeof(ProtoIdSetInvalid), protos), Has.Count.EqualTo(2));
+ Assert.That(protoMan.ValidateStaticFields(typeof(PrivateProtoIdArrayInvalid), protos), Has.Count.EqualTo(2));
+
await pair.CleanReturnAsync();
}
@@ -58,93 +58,111 @@ public async Task TestStaticFieldValidation()
id: StaticFieldTestTag
";
- [Reflect(false)] private sealed class StringValid
+ [Reflect(false)]
+ private sealed class StringValid
{
[ValidatePrototypeId] public static string Tag = "StaticFieldTestTag";
}
- [Reflect(false)] private sealed class StringInvalid
+ [Reflect(false)]
+ private sealed class StringInvalid
{
[ValidatePrototypeId] public static string Tag = string.Empty;
}
- [Reflect(false)] private sealed class StringArrayValid
+ [Reflect(false)]
+ private sealed class StringArrayValid
{
- [ValidatePrototypeId] public static string[] Tag = {"StaticFieldTestTag", "StaticFieldTestTag"};
+ [ValidatePrototypeId] public static string[] Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
}
- [Reflect(false)] private sealed class StringArrayInvalid
+ [Reflect(false)]
+ private sealed class StringArrayInvalid
{
- [ValidatePrototypeId] public static string[] Tag = {string.Empty, "StaticFieldTestTag", string.Empty};
+ [ValidatePrototypeId] public static string[] Tag = [string.Empty, "StaticFieldTestTag", string.Empty];
}
- [Reflect(false)] private sealed class EntProtoIdValid
+ [Reflect(false)]
+ private sealed class EntProtoIdValid
{
public static EntProtoId Tag = "StaticFieldTestEnt";
}
- [Reflect(false)] private sealed class EntProtoIdInvalid
+ [Reflect(false)]
+ private sealed class EntProtoIdInvalid
{
public static EntProtoId Tag = string.Empty;
}
- [Reflect(false)] private sealed class EntProtoIdArrayValid
+ [Reflect(false)]
+ private sealed class EntProtoIdArrayValid
{
- public static EntProtoId[] Tag = {"StaticFieldTestEnt", "StaticFieldTestEnt"};
+ public static EntProtoId[] Tag = ["StaticFieldTestEnt", "StaticFieldTestEnt"];
}
- [Reflect(false)] private sealed class EntProtoIdArrayInvalid
+ [Reflect(false)]
+ private sealed class EntProtoIdArrayInvalid
{
- public static EntProtoId[] Tag = {string.Empty, "StaticFieldTestEnt", string.Empty};
+ public static EntProtoId[] Tag = [string.Empty, "StaticFieldTestEnt", string.Empty];
}
- [Reflect(false)] private sealed class ProtoIdTestValid
+ [Reflect(false)]
+ private sealed class ProtoIdTestValid
{
public static ProtoId Tag = "StaticFieldTestTag";
}
- [Reflect(false)] private sealed class ProtoIdTestInvalid
+ [Reflect(false)]
+ private sealed class ProtoIdTestInvalid
{
public static ProtoId Tag = string.Empty;
}
- [Reflect(false)] private sealed class ProtoIdArrayValid
+ [Reflect(false)]
+ private sealed class ProtoIdArrayValid
{
- public static ProtoId[] Tag = {"StaticFieldTestTag", "StaticFieldTestTag"};
+ public static ProtoId[] Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
}
- [Reflect(false)] private sealed class ProtoIdArrayInvalid
+ [Reflect(false)]
+ private sealed class ProtoIdArrayInvalid
{
- public static ProtoId[] Tag = {string.Empty, "StaticFieldTestTag", string.Empty};
+ public static ProtoId[] Tag = [string.Empty, "StaticFieldTestTag", string.Empty];
}
- [Reflect(false)] private sealed class ProtoIdListValid
+ [Reflect(false)]
+ private sealed class ProtoIdListValid
{
- public static List> Tag = new() {"StaticFieldTestTag", "StaticFieldTestTag"};
+ public static List> Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
}
- [Reflect(false)] private sealed class ProtoIdListInvalid
+ [Reflect(false)]
+ private sealed class ProtoIdListInvalid
{
- public static List> Tag = new() {string.Empty, "StaticFieldTestTag", string.Empty};
+ public static List> Tag = [string.Empty, "StaticFieldTestTag", string.Empty];
}
- [Reflect(false)] private sealed class ProtoIdSetValid
+ [Reflect(false)]
+ private sealed class ProtoIdSetValid
{
- public static HashSet> Tag = new() {"StaticFieldTestTag", "StaticFieldTestTag"};
+ public static HashSet> Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
}
- [Reflect(false)] private sealed class ProtoIdSetInvalid
+ [Reflect(false)]
+ private sealed class ProtoIdSetInvalid
{
- public static HashSet> Tag = new() {string.Empty, "StaticFieldTestTag", string.Empty, " "};
+ public static HashSet> Tag = [string.Empty, "StaticFieldTestTag", string.Empty, " "];
}
- [Reflect(false)] private sealed class PrivateProtoIdArrayValid
+ [Reflect(false)]
+ private sealed class PrivateProtoIdArrayValid
{
- private static ProtoId[] Tag = {"StaticFieldTestTag", "StaticFieldTestTag"};
+ private static readonly ProtoId[] Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
}
- [Reflect(false)] private sealed class PrivateProtoIdArrayInvalid
+ [Reflect(false)]
+ private sealed class PrivateProtoIdArrayInvalid
{
- private static ProtoId[] Tag = {string.Empty, "StaticFieldTestTag", string.Empty};
+ private static readonly ProtoId[] Tag = [string.Empty, "StaticFieldTestTag", string.Empty];
}
}
diff --git a/Content.IntegrationTests/Tests/MachineBoardTest.cs b/Content.IntegrationTests/Tests/MachineBoardTest.cs
index e741935be3..e1533bbb8d 100644
--- a/Content.IntegrationTests/Tests/MachineBoardTest.cs
+++ b/Content.IntegrationTests/Tests/MachineBoardTest.cs
@@ -2,7 +2,6 @@
using System.Linq;
using Content.Server.Construction.Components;
using Content.Shared.Construction.Components;
-using Content.Shared.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
@@ -37,6 +36,7 @@ public async Task TestMachineBoardHasValidMachine()
var server = pair.Server;
var protoMan = server.ResolveDependency();
+ var compFact = server.ResolveDependency();
await server.WaitAssertion(() =>
{
@@ -45,7 +45,7 @@ await server.WaitAssertion(() =>
.Where(p => !pair.IsTestPrototype(p))
.Where(p => !_ignoredPrototypes.Contains(p.ID)))
{
- if (!p.TryGetComponent(out var mbc))
+ if (!p.TryGetComponent(out var mbc, compFact))
continue;
var mId = mbc.Prototype;
@@ -53,7 +53,7 @@ await server.WaitAssertion(() =>
{
Assert.That(protoMan.TryIndex(mId, out var mProto),
$"Machine board {p.ID}'s corresponding machine has an invalid prototype.");
- Assert.That(mProto.TryGetComponent(out var mComp),
+ Assert.That(mProto.TryGetComponent(out var mComp, compFact),
$"Machine board {p.ID}'s corresponding machine {mId} does not have MachineComponent");
Assert.That(mComp.Board, Is.EqualTo(p.ID),
$"Machine {mId}'s BoardPrototype is not equal to it's corresponding machine board, {p.ID}");
@@ -75,6 +75,7 @@ public async Task TestComputerBoardHasValidComputer()
var server = pair.Server;
var protoMan = server.ResolveDependency();
+ var compFact = server.ResolveDependency();
await server.WaitAssertion(() =>
{
@@ -83,7 +84,7 @@ await server.WaitAssertion(() =>
.Where(p => !pair.IsTestPrototype(p))
.Where(p => !_ignoredPrototypes.Contains(p.ID)))
{
- if (!p.TryGetComponent(out var cbc))
+ if (!p.TryGetComponent(out var cbc, compFact))
continue;
var cId = cbc.Prototype;
@@ -92,7 +93,7 @@ await server.WaitAssertion(() =>
Assert.That(cId, Is.Not.Null, $"Computer board \"{p.ID}\" does not have a corresponding computer.");
Assert.That(protoMan.TryIndex(cId, out var cProto),
$"Computer board \"{p.ID}\"'s corresponding computer has an invalid prototype.");
- Assert.That(cProto.TryGetComponent(out var cComp),
+ Assert.That(cProto.TryGetComponent(out var cComp, compFact),
$"Computer board {p.ID}'s corresponding computer \"{cId}\" does not have ComputerComponent");
Assert.That(cComp.BoardPrototype, Is.EqualTo(p.ID),
$"Computer \"{cId}\"'s BoardPrototype is not equal to it's corresponding computer board, \"{p.ID}\"");
diff --git a/Content.IntegrationTests/Tests/Mapping/MappingTests.cs b/Content.IntegrationTests/Tests/Mapping/MappingTests.cs
index 287e30eb8b..be8bad229b 100644
--- a/Content.IntegrationTests/Tests/Mapping/MappingTests.cs
+++ b/Content.IntegrationTests/Tests/Mapping/MappingTests.cs
@@ -13,7 +13,7 @@ public sealed class MappingTests
[Test]
public async Task MappingTest()
{
- await using var pair = await PoolManager.GetServerClient(new PoolSettings {Dirty = true, Connected = true, DummyTicker = false});
+ await using var pair = await PoolManager.GetServerClient(new PoolSettings { Dirty = true, Connected = true, DummyTicker = false });
var server = pair.Server;
var entMan = server.EntMan;
diff --git a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs
index 19780591bd..f64b7c79df 100644
--- a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs
+++ b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs
@@ -38,15 +38,16 @@ public async Task NoMaterialArbitrage()
await server.WaitIdleAsync();
var entManager = server.ResolveDependency();
- var sysManager = server.ResolveDependency();
var mapManager = server.ResolveDependency();
- Assert.That(mapManager.IsMapInitialized(testMap.MapId));
-
var protoManager = server.ResolveDependency();
- var pricing = sysManager.GetEntitySystem();
- var stackSys = sysManager.GetEntitySystem();
+
+ var pricing = entManager.System();
+ var stackSys = entManager.System();
+ var mapSystem = server.System();
var compFact = server.ResolveDependency();
+ Assert.That(mapSystem.IsInitialized(testMap.MapId));
+
var constructionName = compFact.GetComponentName(typeof(ConstructionComponent));
var compositionName = compFact.GetComponentName(typeof(PhysicalCompositionComponent));
var materialName = compFact.GetComponentName(typeof(MaterialComponent));
@@ -67,7 +68,7 @@ public async Task NoMaterialArbitrage()
Dictionary constructionRecipes = new();
foreach (var proto in protoManager.EnumeratePrototypes())
{
- if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
+ if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(constructionName, out var destructible))
@@ -127,7 +128,7 @@ public async Task NoMaterialArbitrage()
// Here we get the set of entities/materials spawned when destroying an entity.
foreach (var proto in protoManager.EnumeratePrototypes())
{
- if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
+ if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(destructibleName, out var destructible))
@@ -298,7 +299,7 @@ public async Task NoMaterialArbitrage()
Dictionary physicalCompositions = new();
foreach (var proto in protoManager.EnumeratePrototypes())
{
- if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
+ if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(compositionName, out var composition))
diff --git a/Content.IntegrationTests/Tests/Minds/GhostTests.cs b/Content.IntegrationTests/Tests/Minds/GhostTests.cs
index 7a156e71e4..3a860267e5 100644
--- a/Content.IntegrationTests/Tests/Minds/GhostTests.cs
+++ b/Content.IntegrationTests/Tests/Minds/GhostTests.cs
@@ -14,7 +14,7 @@ namespace Content.IntegrationTests.Tests.Minds;
[TestFixture]
public sealed class GhostTests
{
- struct GhostTestData
+ private struct GhostTestData
{
public IEntityManager SEntMan;
public Robust.Server.Player.IPlayerManager SPlayerMan;
@@ -23,10 +23,10 @@ struct GhostTestData
public TestPair Pair = default!;
- public TestMapData MapData => Pair.TestMap!;
+ public readonly TestMapData MapData => Pair.TestMap!;
- public RobustIntegrationTest.ServerIntegrationInstance Server => Pair.Server;
- public RobustIntegrationTest.ClientIntegrationInstance Client => Pair.Client;
+ public readonly RobustIntegrationTest.ServerIntegrationInstance Server => Pair.Server;
+ public readonly RobustIntegrationTest.ClientIntegrationInstance Client => Pair.Client;
///
/// Initial player coordinates. Note that this does not necessarily correspond to the position of the
@@ -47,15 +47,16 @@ public GhostTestData()
private async Task SetupData()
{
- var data = new GhostTestData();
-
- // Client is needed to create a session for the ghost system. Creating a dummy session was too difficult.
- data.Pair = await PoolManager.GetServerClient(new PoolSettings
+ var data = new GhostTestData
{
- DummyTicker = false,
- Connected = true,
- Dirty = true
- });
+ // Client is needed to create a session for the ghost system. Creating a dummy session was too difficult.
+ Pair = await PoolManager.GetServerClient(new PoolSettings
+ {
+ DummyTicker = false,
+ Connected = true,
+ Dirty = true
+ })
+ };
data.SEntMan = data.Pair.Server.ResolveDependency();
data.SPlayerMan = data.Pair.Server.ResolveDependency