Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -377,7 +377,7 @@ namespace Content.Benchmarks
throw new EndOfStreamException(); throw new EndOfStreamException();
streamBytesLeft -= bytesInBuffer; streamBytesLeft -= bytesInBuffer;
bool flush = streamBytesLeft == 0 ? true : false; bool flush = streamBytesLeft == 0;
bool completed = false; bool completed = false;

View File

@@ -108,7 +108,7 @@ namespace Content.Client.Administration.UI.Bwoink
return a.ActiveThisRound ? -1 : 1; return a.ActiveThisRound ? -1 : 1;
// Finally, sort by the most recent message. // Finally, sort by the most recent message.
return bch!.LastMessage.CompareTo(ach!.LastMessage); return bch.LastMessage.CompareTo(ach.LastMessage);
}; };
Bans.OnPressed += _ => Bans.OnPressed += _ =>

View File

@@ -104,12 +104,12 @@ public sealed class ExplosionDebugOverlay : Overlay
var screenCenter = _eyeManager.WorldToScreen(worldCenter); var screenCenter = _eyeManager.WorldToScreen(worldCenter);
if (Intensity![i] > 9) if (Intensity[i] > 9)
screenCenter += (-12, -8); screenCenter += (-12, -8);
else else
screenCenter += (-8, -8); screenCenter += (-8, -8);
handle.DrawString(_font, screenCenter, Intensity![i].ToString("F2")); handle.DrawString(_font, screenCenter, Intensity[i].ToString("F2"));
} }
} }
@@ -118,7 +118,7 @@ public sealed class ExplosionDebugOverlay : Overlay
var epicenter = tileSets[0].First(); var epicenter = tileSets[0].First();
var worldCenter = transform.Transform(((Vector2) epicenter + 0.5f) * tileSize); var worldCenter = transform.Transform(((Vector2) epicenter + 0.5f) * tileSize);
var screenCenter = _eyeManager.WorldToScreen(worldCenter) + (-24, -24); var screenCenter = _eyeManager.WorldToScreen(worldCenter) + (-24, -24);
var text = $"{Intensity![0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}"; var text = $"{Intensity[0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}";
handle.DrawString(_font, screenCenter, text); handle.DrawString(_font, screenCenter, text);
} }
} }
@@ -159,7 +159,7 @@ public sealed class ExplosionDebugOverlay : Overlay
{ {
for (var i = 0; i < Intensity.Count; i++) for (var i = 0; i < Intensity.Count; i++)
{ {
var color = ColorMap(Intensity![i]); var color = ColorMap(Intensity[i]);
var colorTransparent = color; var colorTransparent = color;
colorTransparent.A = 0.2f; colorTransparent.A = 0.2f;
@@ -183,7 +183,7 @@ public sealed class ExplosionDebugOverlay : Overlay
private Color ColorMap(float intensity) private Color ColorMap(float intensity)
{ {
var frac = 1 - intensity / Intensity![0]; var frac = 1 - intensity / Intensity[0];
Color result; Color result;
if (frac < 0.5f) if (frac < 0.5f)
result = Color.InterpolateBetween(Color.Red, Color.Orange, frac * 2); result = Color.InterpolateBetween(Color.Red, Color.Orange, frac * 2);

View File

@@ -1,5 +1,4 @@
<Control xmlns="https://spacestation14.io" <Control xmlns="https://spacestation14.io"
xmlns:pt="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"> xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<BoxContainer Orientation="Vertical"> <BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">

View File

@@ -32,7 +32,7 @@ public sealed partial class ObjectsTab : Control
foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection))) foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection)))
{ {
_selections.Add((ObjectsTabSelection)type!); _selections.Add((ObjectsTabSelection)type!);
ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type!)!); ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type)!);
} }
RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]); RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]);
@@ -43,9 +43,9 @@ public sealed partial class ObjectsTab : Control
var entities = selection switch var entities = selection switch
{ {
ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations.ToList(), ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations.ToList(),
ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => ((Component) x).Owner).ToList(), ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => x.Owner).ToList(),
ObjectsTabSelection.Maps => _entityManager.EntityQuery<MapComponent>(true).Select(x => x.Owner).ToList(), ObjectsTabSelection.Maps => _entityManager.EntityQuery<MapComponent>(true).Select(x => x.Owner).ToList(),
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null) _ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null),
}; };
foreach (var control in _objects) foreach (var control in _objects)

View File

@@ -43,7 +43,7 @@ public sealed partial class PumpControl : BoxContainer
PumpDataChanged?.Invoke(_address, _data); PumpDataChanged?.Invoke(_address, _data);
}; };
_internalBound.Value = (float) _data.InternalPressureBound; _internalBound.Value = _data.InternalPressureBound;
_internalBound.OnValueChanged += _ => _internalBound.OnValueChanged += _ =>
{ {
_data.InternalPressureBound = _internalBound.Value; _data.InternalPressureBound = _internalBound.Value;
@@ -51,7 +51,7 @@ public sealed partial class PumpControl : BoxContainer
}; };
_internalBound.IsValid += value => value >= 0; _internalBound.IsValid += value => value >= 0;
_externalBound.Value = (float) _data.ExternalPressureBound; _externalBound.Value = _data.ExternalPressureBound;
_externalBound.OnValueChanged += _ => _externalBound.OnValueChanged += _ =>
{ {
_data.ExternalPressureBound = _externalBound.Value; _data.ExternalPressureBound = _externalBound.Value;

View File

@@ -33,7 +33,7 @@ public sealed partial class ThresholdBoundControl : BoxContainer
public void SetValue(float value) public void SetValue(float value)
{ {
_value = value; _value = value;
CSpinner.Value = (float) ScaledValue!; CSpinner.Value = ScaledValue;
} }
public void SetEnabled(bool enabled) public void SetEnabled(bool enabled)

View File

@@ -55,7 +55,7 @@ namespace Content.Client.Atmos.Overlays
var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Owner, tile.GridIndices); var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Owner, tile.GridIndices);
if (dataMaybeNull != null) if (dataMaybeNull != null)
{ {
var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull!; var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull;
if (pass == 0) if (pass == 0)
{ {
// -- Mole Count -- // -- Mole Count --

View File

@@ -40,7 +40,7 @@ namespace Content.Client.Atmos.Overlays
private int _gasCount; private int _gasCount;
public const int GasOverlayZIndex = (int) Content.Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else public const int GasOverlayZIndex = (int) Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else
public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys) public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys)
{ {

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
MinSize="480 400" Title="Filter"> MinSize="480 400" Title="Filter">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10"> <BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"> <BoxContainer Orientation="Horizontal" HorizontalExpand="True">

View File

@@ -37,7 +37,7 @@ namespace Content.Client.Atmos.UI
FilterTransferRateInput.OnTextChanged += _ => SetFilterRate.Disabled = false; FilterTransferRateInput.OnTextChanged += _ => SetFilterRate.Disabled = false;
SetFilterRate.OnPressed += _ => SetFilterRate.OnPressed += _ =>
{ {
FilterTransferRateChanged?.Invoke(FilterTransferRateInput.Text ??= ""); FilterTransferRateChanged?.Invoke(FilterTransferRateInput.Text);
SetFilterRate.Disabled = true; SetFilterRate.Disabled = true;
}; };

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
MinSize="200 200" Title="Gas Mixer"> MinSize="200 200" Title="Gas Mixer">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10"> <BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"> <BoxContainer Orientation="Horizontal" HorizontalExpand="True">

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
MinSize="200 120" Title="Pressure Pump"> MinSize="200 120" Title="Pressure Pump">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10"> <BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"> <BoxContainer Orientation="Horizontal" HorizontalExpand="True">

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
MinSize="200 120" Title="Volume Pump"> MinSize="200 120" Title="Volume Pump">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10"> <BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"> <BoxContainer Orientation="Horizontal" HorizontalExpand="True">

View File

@@ -75,8 +75,8 @@ namespace Content.Client.Cargo.BUI
description.PushColor(Color.White); // Rich text default color is grey description.PushColor(Color.White); // Rich text default color is grey
if (row.MainButton.ToolTip != null) if (row.MainButton.ToolTip != null)
description.AddText(row.MainButton.ToolTip); description.AddText(row.MainButton.ToolTip);
_orderMenu.Description.SetMessage(description);
_orderMenu.Description.SetMessage(description);
_product = row.Product; _product = row.Product;
_orderMenu.ProductName.Text = row.ProductName.Text; _orderMenu.ProductName.Text = row.ProductName.Text;
_orderMenu.PointCost.Text = row.PointCost.Text; _orderMenu.PointCost.Text = row.PointCost.Text;

View File

@@ -153,8 +153,8 @@ namespace Content.Client.Chemistry.UI
/// <param name="state">State data for the dispenser.</param> /// <param name="state">State data for the dispenser.</param>
private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state) private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
{ {
BufferTransferButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Transfer; BufferTransferButton.Pressed = state.Mode == ChemMasterMode.Transfer;
BufferDiscardButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Discard; BufferDiscardButton.Pressed = state.Mode == ChemMasterMode.Discard;
BuildContainerUI(InputContainerInfo, state.InputContainerInfo, true); BuildContainerUI(InputContainerInfo, state.InputContainerInfo, true);
BuildContainerUI(OutputContainerInfo, state.OutputContainerInfo, false); BuildContainerUI(OutputContainerInfo, state.OutputContainerInfo, false);

View File

@@ -53,7 +53,7 @@ namespace Content.Client.Clickable
var pathStr = obj.Path.ToString(); var pathStr = obj.Path.ToString();
foreach (var path in IgnoreTexturePaths) foreach (var path in IgnoreTexturePaths)
{ {
if (pathStr.StartsWith(path)) if (pathStr.StartsWith(path, StringComparison.Ordinal))
return; return;
} }

View File

@@ -85,7 +85,7 @@ namespace Content.Client.Clickable
// Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen. // Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen.
// This **can** differ from the dir defined before, but can also just be the same. // This **can** differ from the dir defined before, but can also just be the same.
if (sprite.EnableDirectionOverride) if (sprite.EnableDirectionOverride)
dir = sprite.DirectionOverride.Convert(rsiState.Directions);; dir = sprite.DirectionOverride.Convert(rsiState.Directions);
dir = dir.OffsetRsiDir(layer.DirOffset); dir = dir.OffsetRsiDir(layer.DirOffset);
if (_clickMapManager.IsOccluding(layer.ActualRsi!, layer.State, dir, layer.AnimationFrame, layerImagePos)) if (_clickMapManager.IsOccluding(layer.ActualRsi!, layer.State, dir, layer.AnimationFrame, layerImagePos))

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'comp-pda-ui-menu-title'}" Title="{Loc 'comp-pda-ui-menu-title'}"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
SetSize="400 400" SetSize="400 400"
MinSize="400 400"> MinSize="400 400">
<TabContainer Name="MasterTabContainer"> <TabContainer Name="MasterTabContainer">

View File

@@ -2,7 +2,6 @@ using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Content.Client.Message; using Content.Client.Message;
using Robust.Shared.Timing;
using Content.Shared.Cloning.CloningConsole; using Content.Shared.Cloning.CloningConsole;
namespace Content.Client.CloningConsole.UI namespace Content.Client.CloningConsole.UI
@@ -18,11 +17,6 @@ namespace Content.Client.CloningConsole.UI
private CloningConsoleBoundUserInterfaceState? _lastUpdate; private CloningConsoleBoundUserInterfaceState? _lastUpdate;
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
}
public void Populate(CloningConsoleBoundUserInterfaceState state) public void Populate(CloningConsoleBoundUserInterfaceState state)
{ {
_lastUpdate = state; _lastUpdate = state;

View File

@@ -52,7 +52,7 @@ namespace Content.Client.Computer
} }
/// <summary> /// <summary>
/// This class is to avoid a lot of <> being written when we just want to refer to SendMessage. /// This class is to avoid a lot of &lt;&gt; being written when we just want to refer to SendMessage.
/// We could instead qualify a lot of generics even further, but that is a waste of time. /// We could instead qualify a lot of generics even further, but that is a waste of time.
/// </summary> /// </summary>
[Virtual] [Virtual]

View File

@@ -1,5 +1,4 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.Decals.UI"
Title="{Loc 'decal-placer-window-title'}" Title="{Loc 'decal-placer-window-title'}"
MinSize="250 500" MinSize="250 500"
SetSize="250 500"> SetSize="250 500">

View File

@@ -61,10 +61,7 @@ namespace Content.Client.DragDrop
/// <param name="onBeginDrag"><see cref="OnBeginDrag"/></param> /// <param name="onBeginDrag"><see cref="OnBeginDrag"/></param>
/// <param name="onContinueDrag"><see cref="OnContinueDrag"/></param> /// <param name="onContinueDrag"><see cref="OnContinueDrag"/></param>
/// <param name="onEndDrag"><see cref="OnEndDrag"/></param> /// <param name="onEndDrag"><see cref="OnEndDrag"/></param>
/// <param name="deadzone">drag will be triggered when mouse leaves public DragDropHelper(OnBeginDrag onBeginDrag, OnContinueDrag onContinueDrag, OnEndDrag onEndDrag)
/// this deadzone around the mousedown position</param>
public DragDropHelper(OnBeginDrag onBeginDrag, OnContinueDrag onContinueDrag,
OnEndDrag onEndDrag)
{ {
_inputManager = IoCManager.Resolve<IInputManager>(); _inputManager = IoCManager.Resolve<IInputManager>();
_onBeginDrag = onBeginDrag; _onBeginDrag = onBeginDrag;

View File

@@ -1,5 +1,4 @@
<DefaultWindow xmlns="https://spacestation14.io" <DefaultWindow xmlns="https://spacestation14.io"
xmlns:viewport="clr-namespace:Content.Client.Viewport"
Title="{Loc 'fax-machine-ui-window'}" Title="{Loc 'fax-machine-ui-window'}"
MinWidth="250"> MinWidth="250">
<BoxContainer Orientation="Vertical" VerticalExpand="True"> <BoxContainer Orientation="Vertical" VerticalExpand="True">

View File

@@ -45,59 +45,38 @@ namespace Content.Client.Fluids
return; return;
} }
if (args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale) if (!args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale)
&& args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume) || !args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume)
&& args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor) || !args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor)
&& args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating)) || !args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating))
{ {
return;
}
// volumeScale is our opacity based on level of fullness to overflow. The lower bound is hard-capped for visibility reasons. // volumeScale is our opacity based on level of fullness to overflow. The lower bound is hard-capped for visibility reasons.
var cappedScale = Math.Min(1.0f, volumeScale * 0.75f + 0.25f); var cappedScale = Math.Min(1.0f, volumeScale * 0.75f + 0.25f);
Color newColor; var newColor = component.Recolor ? solutionColor.WithAlpha(cappedScale) : args.Sprite.Color.WithAlpha(cappedScale);
if (component.Recolor)
{
newColor = solutionColor.WithAlpha(cappedScale);
}
else
{
newColor = args.Sprite.Color.WithAlpha(cappedScale);
}
args.Sprite.LayerSetColor(0, newColor); args.Sprite.LayerSetColor(0, newColor);
if (component.CustomPuddleSprite) //Don't consider wet floor effects if we're using a custom sprite. // Don't consider wet floor effects if we're using a custom sprite.
{ if (component.CustomPuddleSprite)
return; return;
}
bool wetFloorEffectNeeded; if (isEvaporating && currentVolume <= component.WetFloorEffectThreshold)
if (isEvaporating
&& currentVolume <= component.WetFloorEffectThreshold)
{
wetFloorEffectNeeded = true;
}
else
wetFloorEffectNeeded = false;
if (wetFloorEffectNeeded)
{
if (args.Sprite.LayerGetState(0) != "sparkles") // If we need the effect but don't already have it - start it
{ {
// If we need the effect but don't already have it - start it
if (args.Sprite.LayerGetState(0) != "sparkles")
StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha); StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha);
} }
}
else else
{ {
if (args.Sprite.LayerGetState(0) == "sparkles") // If we have the effect but don't need it - end it // If we have the effect but don't need it - end it
if (args.Sprite.LayerGetState(0) == "sparkles")
EndWetFloorEffect(args.Sprite, component.OriginalRsi); EndWetFloorEffect(args.Sprite, component.OriginalRsi);
} }
} }
else
{
return;
}
}
private void StartWetFloorEffect(SpriteComponent sprite, float alpha) private void StartWetFloorEffect(SpriteComponent sprite, float alpha)
{ {

View File

@@ -1,5 +1,4 @@
<controls:FancyWindow xmlns:ui="clr-namespace:Content.Client.UserInterface" <controls:FancyWindow xmlns="https://spacestation14.io"
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:fancyTree="clr-namespace:Content.Client.UserInterface.Controls.FancyTree" xmlns:fancyTree="clr-namespace:Content.Client.UserInterface.Controls.FancyTree"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"

View File

@@ -205,7 +205,7 @@ public sealed class GuidebookSystem : EntitySystem
bool includeChildren = true, bool includeChildren = true,
string? selected = null) string? selected = null)
{ {
Dictionary<string, GuideEntry>? guides = new(); Dictionary<string, GuideEntry> guides = new();
foreach (var guideId in guideList) foreach (var guideId in guideList)
{ {
if (!_prototypeManager.TryIndex<GuideEntryPrototype>(guideId, out var guide)) if (!_prototypeManager.TryIndex<GuideEntryPrototype>(guideId, out var guide))

View File

@@ -37,7 +37,7 @@ namespace Content.Client.HealthAnalyzer.UI
text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n"); text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n");
/// Status Effects / Components // Status Effects / Components
if (entities.HasComponent<DiseasedComponent>(msg.TargetEntity)) if (entities.HasComponent<DiseasedComponent>(msg.TargetEntity))
{ {
text.Append($"{Loc.GetString("disease-scanner-diseased")}\n"); text.Append($"{Loc.GetString("disease-scanner-diseased")}\n");
@@ -46,7 +46,7 @@ namespace Content.Client.HealthAnalyzer.UI
text.Append($"{Loc.GetString("disease-scanner-not-diseased")}\n"); text.Append($"{Loc.GetString("disease-scanner-not-diseased")}\n");
} }
/// Damage // Damage
text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n"); text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n");
HashSet<string> shownTypes = new(); HashSet<string> shownTypes = new();

View File

@@ -282,6 +282,7 @@ public sealed partial class MarkingPicker : Control
_currentMarkings.ShiftRankUpFromEnd(_selectedMarkingCategory, src); _currentMarkings.ShiftRankUpFromEnd(_selectedMarkingCategory, src);
break; break;
// do nothing? // do nothing?
// ReSharper disable once RedundantEmptySwitchSection
default: default:
break; break;
} }

View File

@@ -150,13 +150,6 @@ public sealed class InstrumentSystem : SharedInstrumentSystem
var tick = instrument.Renderer.SequencerTick-1; var tick = instrument.Renderer.SequencerTick-1;
instrument.MidiEventBuffer.Add(RobustMidiEvent.SystemReset(tick)); instrument.MidiEventBuffer.Add(RobustMidiEvent.SystemReset(tick));
// We add a "all notes off" message.
for (byte i = 0; i < 16; i++)
{
//instrument.MidiEventBuffer.Add(RobustMidiEvent.AllNotesOff(i, tick));
}
instrument.Renderer.PlayerTick = playerTick; instrument.Renderer.PlayerTick = playerTick;
} }

View File

@@ -1,7 +1,5 @@
<DefaultWindow <DefaultWindow
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'lathe-menu-title'}" Title="{Loc 'lathe-menu-title'}"
MinSize="300 450" MinSize="300 450"
SetSize="300 450"> SetSize="300 450">

View File

@@ -1,6 +1,5 @@
<DefaultWindow <DefaultWindow
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'lathe-queue-menu-title'}" Title="{Loc 'lathe-queue-menu-title'}"
MinSize="300 450" MinSize="300 450"
SetSize="300 450"> SetSize="300 450">

View File

@@ -142,7 +142,7 @@ namespace Content.Client.Lobby.UI
var highPriorityJob = profile.JobPriorities.FirstOrDefault(p => p.Value == JobPriority.High).Key; var highPriorityJob = profile.JobPriorities.FirstOrDefault(p => p.Value == JobPriority.High).Key;
// ReSharper disable once ConstantNullCoalescingCondition // ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract (what is resharper smoking?)
var job = protoMan.Index<JobPrototype>(highPriorityJob ?? SharedGameTicker.FallbackOverflowJob); var job = protoMan.Index<JobPrototype>(highPriorityJob ?? SharedGameTicker.FallbackOverflowJob);
if (job.StartingGear != null && invSystem.TryGetSlots(dummy, out var slots)) if (job.StartingGear != null && invSystem.TryGetSlots(dummy, out var slots))

View File

@@ -1,3 +1,4 @@
using System.Globalization;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
@@ -111,11 +112,11 @@ namespace Content.Client.Options.UI.Tabs
ApplyButton.Disabled = isEverythingSame; ApplyButton.Disabled = isEverythingSame;
ResetButton.Disabled = isEverythingSame; ResetButton.Disabled = isEverythingSame;
NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(); NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(); NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(); NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(); NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(); NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(CultureInfo.InvariantCulture);
// TODO disable / grey-out the predict and interp sliders if prediction is disabled. // TODO disable / grey-out the predict and interp sliders if prediction is disabled.
// Currently no option to do this, but should be added to the slider control in general // Currently no option to do this, but should be added to the slider control in general

View File

@@ -9,14 +9,14 @@ namespace Content.Client.PDA.Ringer
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public sealed partial class RingtoneMenu : DefaultWindow public sealed partial class RingtoneMenu : DefaultWindow
{ {
public string[] PreviousNoteInputs = new string[] { "A", "A", "A", "A"}; public string[] PreviousNoteInputs = new[] { "A", "A", "A", "A" };
public LineEdit[] RingerNoteInputs = default!; public LineEdit[] RingerNoteInputs = default!;
public RingtoneMenu() public RingtoneMenu()
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
RingerNoteInputs = new LineEdit[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput }; RingerNoteInputs = new[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput };
for (int i = 0; i < RingerNoteInputs.Length; i++) for (int i = 0; i < RingerNoteInputs.Length; i++)
{ {

View File

@@ -1,7 +1,5 @@
<paper:PaperWindow xmlns="https://spacestation14.io" <paper:PaperWindow xmlns="https://spacestation14.io"
xmlns:paper="clr-namespace:Content.Client.Paper.UI" xmlns:paper="clr-namespace:Content.Client.Paper.UI"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
MouseFilter="Stop" Resizable="True" MinSize="150 150" MouseFilter="Stop" Resizable="True" MinSize="150 150"
SetSize="300 400"> <!-- Provide some reasonable sizes by default. Can be changed by the component --> SetSize="300 400"> <!-- Provide some reasonable sizes by default. Can be changed by the component -->

View File

@@ -46,7 +46,7 @@ namespace Content.Client.Paper.UI
{ {
var resCache = IoCManager.Resolve<IResourceCache>(); var resCache = IoCManager.Resolve<IResourceCache>();
/// Initialize the background: // Initialize the background:
PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate; PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate;
var backgroundImage = visuals.BackgroundImagePath != null? resCache.GetResource<TextureResource>(visuals.BackgroundImagePath) : null; var backgroundImage = visuals.BackgroundImagePath != null? resCache.GetResource<TextureResource>(visuals.BackgroundImagePath) : null;
if (backgroundImage != null) if (backgroundImage != null)
@@ -111,7 +111,7 @@ namespace Content.Client.Paper.UI
// So, we'll make the window non-resizable and fix the size of the content. // So, we'll make the window non-resizable and fix the size of the content.
// Ideally, would like to be able to allow resizing only one direction. // Ideally, would like to be able to allow resizing only one direction.
ScrollingContents.MinSize = Vector2.Zero; ScrollingContents.MinSize = Vector2.Zero;
ScrollingContents.MinSize = (Vector2)(a); ScrollingContents.MinSize = a;
if (a.X > 0.0f) if (a.X > 0.0f)
{ {

View File

@@ -1,14 +1,8 @@
<paper:StampWidget xmlns="https://spacestation14.io" <paper:StampWidget xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:style="clr-namespace:Content.Client.Stylesheets" xmlns:style="clr-namespace:Content.Client.Stylesheets"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:paper="clr-namespace:Content.Client.Paper.UI" HorizontalAlignment="Center" Margin="6"> xmlns:paper="clr-namespace:Content.Client.Paper.UI" HorizontalAlignment="Center" Margin="6">
<!--
<TextureButton Margin="6 6 6 2" MinSize="24 12"
TexturePath="/Textures/Interface/Nano/nano_stamp.192dpi.png">
-->
<BoxContainer Orientation="Vertical"> <BoxContainer Orientation="Vertical">
<PanelContainer> <PanelContainer>

View File

@@ -76,7 +76,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource
catch (Exception ex) catch (Exception ex)
{ {
Logger.ErrorS("parallax", $"Couldn't retrieve parallax cached texture: {ex}"); Logger.ErrorS("parallax", $"Couldn't retrieve parallax cached texture: {ex}");
// The show must go on.
try try
{ {
// Also try to at least sort of fix this if we've been fooled by a config backup // Also try to at least sort of fix this if we've been fooled by a config backup
@@ -84,6 +84,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource
} }
catch (Exception) catch (Exception)
{ {
// The show must go on.
} }
return Texture.Transparent; return Texture.Transparent;
} }

View File

@@ -14,7 +14,7 @@ namespace Content.Client.Parallax.Data;
public sealed class ParallaxPrototype : IPrototype public sealed class ParallaxPrototype : IPrototype
{ {
/// <inheritdoc/> /// <inheritdoc/>
[IdDataFieldAttribute] [IdDataField]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>

View File

@@ -1,7 +1,6 @@
<Control xmlns="https://spacestation14.io" <Control xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:parallax="clr-namespace:Content.Client.Parallax"
xmlns:style="clr-namespace:Content.Client.Stylesheets" xmlns:style="clr-namespace:Content.Client.Stylesheets"
VerticalExpand="True"> VerticalExpand="True">
<Control> <Control>

View File

@@ -22,7 +22,7 @@ namespace Content.Client.Stylesheets
public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false) public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
{ {
var ds = display ? "Display" : ""; var ds = display ? "Display" : "";
var sv = variation.StartsWith("Bold") ? "Bold" : "Regular"; var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular";
return resCache.GetFont return resCache.GetFont
( (
// Ew, but ok // Ew, but ok
@@ -30,7 +30,7 @@ namespace Content.Client.Stylesheets
{ {
$"/Fonts/NotoSans{ds}/NotoSans{ds}-{variation}.ttf", $"/Fonts/NotoSans{ds}/NotoSans{ds}-{variation}.ttf",
$"/Fonts/NotoSans/NotoSansSymbols-{sv}.ttf", $"/Fonts/NotoSans/NotoSansSymbols-{sv}.ttf",
"/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf",
}, },
size size
); );

View File

@@ -56,7 +56,7 @@ public sealed partial class SurveillanceCameraSetupWindow : DefaultWindow
id++; id++;
} }
idList.Sort((a, b) => a.networkName.CompareTo(b.networkName)); idList.Sort((a, b) => string.Compare(a.networkName, b.networkName, StringComparison.Ordinal));
foreach (var (networkId, network) in idList) foreach (var (networkId, network) in idList)
{ {

View File

@@ -1,17 +1,7 @@
<targeting:TargetingDoll xmlns="https://spacestation14.io" <targeting:TargetingDoll xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maths="clr-namespace:Robust.Shared.Maths;assembly=Robust.Shared.Maths"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:parallax="clr-namespace:Content.Client.Parallax"
xmlns:vote="clr-namespace:Content.Client.Voting.UI"
xmlns:style="clr-namespace:Content.Client.Stylesheets"
xmlns:chatUi="clr-namespace:Content.Client.Chat.UI"
xmlns:lobbyUi="clr-namespace:Content.Client.Lobby.UI"
xmlns:info="clr-namespace:Content.Client.Info"
xmlns:targeting="clr-namespace:Content.Client.Targeting.UI" xmlns:targeting="clr-namespace:Content.Client.Targeting.UI"
Orientation="Vertical" Orientation="Vertical">
>
<TextureButton Name = "ButtonHigh" TexturePath="/Textures/Interface/target-doll-high.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/> <TextureButton Name = "ButtonHigh" TexturePath="/Textures/Interface/target-doll-high.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>
<TextureButton Name = "ButtonMedium" TexturePath="/Textures/Interface/target-doll-middle.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/> <TextureButton Name = "ButtonMedium" TexturePath="/Textures/Interface/target-doll-middle.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>
<TextureButton Name = "ButtonLow" TexturePath="/Textures/Interface/target-doll-low.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/> <TextureButton Name = "ButtonLow" TexturePath="/Textures/Interface/target-doll-low.svg.96dpi.png" HorizontalAlignment="Center" StyleIdentifier="target-doll-zone"/>

View File

@@ -26,11 +26,11 @@ public sealed class MenuButton : ContainerButton
private BoundKeyFunction _function; private BoundKeyFunction _function;
private readonly BoxContainer _root; private readonly BoxContainer _root;
private readonly TextureRect _buttonIcon; private readonly TextureRect? _buttonIcon;
private readonly Label _buttonLabel; private readonly Label? _buttonLabel;
public string AppendStyleClass { set => AddStyleClass(value); } public string AppendStyleClass { set => AddStyleClass(value); }
public Texture? Icon { get => _buttonIcon.Texture; set => _buttonIcon.Texture = value; } public Texture? Icon { get => _buttonIcon!.Texture; set => _buttonIcon!.Texture = value; }
public BoundKeyFunction BoundKey public BoundKeyFunction BoundKey
{ {
@@ -38,7 +38,7 @@ public sealed class MenuButton : ContainerButton
set set
{ {
_function = value; _function = value;
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(value); _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(value);
} }
} }
@@ -95,12 +95,12 @@ public sealed class MenuButton : ContainerButton
private void OnKeyBindingChanged(IKeyBinding obj) private void OnKeyBindingChanged(IKeyBinding obj)
{ {
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function); _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
} }
private void OnKeyBindingChanged() private void OnKeyBindingChanged()
{ {
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function); _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
} }
protected override void StylePropertiesChanged() protected override void StylePropertiesChanged()

View File

@@ -886,7 +886,6 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
/// If currently targeting with no slot or a different slot, switches to /// If currently targeting with no slot or a different slot, switches to
/// targeting with the specified slot. /// targeting with the specified slot.
/// </summary> /// </summary>
/// <param name="slot"></param>
public void ToggleTargeting(TargetedAction action) public void ToggleTargeting(TargetedAction action)
{ {
if (SelectingTargetFor == action) if (SelectingTargetFor == action)
@@ -952,7 +951,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
_targetOutline?.Disable(); _targetOutline?.Disable();
_interactionOutline?.SetEnabled(true); _interactionOutline?.SetEnabled(true);
if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay) || handOverlay == null) if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay))
return; return;
handOverlay.IconOverride = null; handOverlay.IconOverride = null;

View File

@@ -1,7 +1,6 @@
<widgets:ActionsBar <widgets:ActionsBar
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:in="clr-namespace:Content.Shared.Input;assembly=Content.Shared"
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Actions.Widgets" xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Actions.Widgets"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Actions.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Actions.Controls"
VerticalExpand="False" VerticalExpand="False"

View File

@@ -141,7 +141,7 @@ public sealed class AHelpUIController: UIController, IOnStateChanged<GameplaySta
return; return;
UIHelper?.Dispose(); UIHelper?.Dispose();
var ownerUserId = _playerManager!.LocalPlayer!.UserId; var ownerUserId = _playerManager.LocalPlayer!.UserId;
UIHelper = isAdmin ? new AdminAHelpUIHandler(ownerUserId) : new UserAHelpUIHandler(ownerUserId); UIHelper = isAdmin ? new AdminAHelpUIHandler(ownerUserId) : new UserAHelpUIHandler(ownerUserId);
UIHelper.SendMessageAction = (userId, textMessage) => _bwoinkSystem?.Send(userId, textMessage); UIHelper.SendMessageAction = (userId, textMessage) => _bwoinkSystem?.Send(userId, textMessage);

View File

@@ -1,6 +1,5 @@
<controls:CharacterObjectiveControl <controls:CharacterObjectiveControl
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Character.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Character.Controls"
Orientation="Vertical" Orientation="Vertical"
Modulate="#808080"> Modulate="#808080">

View File

@@ -11,7 +11,7 @@ public sealed class ChannelFilterButton : ContainerButton
private static readonly Color ColorNormal = Color.FromHex("#7b7e9e"); private static readonly Color ColorNormal = Color.FromHex("#7b7e9e");
private static readonly Color ColorHovered = Color.FromHex("#9699bb"); private static readonly Color ColorHovered = Color.FromHex("#9699bb");
private static readonly Color ColorPressed = Color.FromHex("#789B8C"); private static readonly Color ColorPressed = Color.FromHex("#789B8C");
private readonly TextureRect _textureRect; private readonly TextureRect? _textureRect;
public readonly ChannelFilterPopup ChatFilterPopup; public readonly ChannelFilterPopup ChatFilterPopup;
private readonly ChatUIController _chatUIController; private readonly ChatUIController _chatUIController;
private const int FilterDropdownOffset = 120; private const int FilterDropdownOffset = 120;

View File

@@ -21,7 +21,7 @@ public sealed class InventoryDisplay : LayoutContainer
AddChild(resizer); AddChild(resizer);
} }
public SlotControl? AddButton(SlotControl newButton, Vector2i buttonOffset) public SlotControl AddButton(SlotControl newButton, Vector2i buttonOffset)
{ {
AddChild(newButton); AddChild(newButton);
HorizontalExpand = true; HorizontalExpand = true;

View File

@@ -1,6 +1,5 @@
<controls:ObjectiveBriefingControl <controls:ObjectiveBriefingControl
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Objectives.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Objectives.Controls"
Orientation="Horizontal"> Orientation="Horizontal">
<Label Name="Label" Access="Public" Modulate="#FFFF00"/> <Label Name="Label" Access="Public" Modulate="#FFFF00"/>

View File

@@ -16,7 +16,6 @@ public sealed partial class GunSystem
if (args.Control is DefaultStatusControl control) if (args.Control is DefaultStatusControl control)
{ {
control.Update(GetBallisticShots(component), component.Capacity); control.Update(GetBallisticShots(component), component.Capacity);
return;
} }
} }

View File

@@ -159,13 +159,13 @@ public sealed class SolutionSystemTests
Assert.That(containerSystem Assert.That(containerSystem
.TryMixAndOverflow(beaker, solution, oilAdded, threshold, out var overflowingSolution)); .TryMixAndOverflow(beaker, solution, oilAdded, threshold, out var overflowingSolution));
Assert.That((FixedPoint2) solution.Volume, Is.EqualTo(FixedPoint2.New(threshold))); Assert.That(solution.Volume, Is.EqualTo(FixedPoint2.New(threshold)));
solution.TryGetReagent("Water", out var waterMix); solution.TryGetReagent("Water", out var waterMix);
solution.TryGetReagent("Oil", out var oilMix); solution.TryGetReagent("Oil", out var oilMix);
Assert.That(waterMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1)))); Assert.That(waterMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1))));
Assert.That(oilMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1) * ratio))); Assert.That(oilMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1) * ratio)));
Assert.That((FixedPoint2) overflowingSolution.Volume, Is.EqualTo(FixedPoint2.New(80))); Assert.That(overflowingSolution.Volume, Is.EqualTo(FixedPoint2.New(80)));
overflowingSolution.TryGetReagent("Water", out var waterOverflow); overflowingSolution.TryGetReagent("Water", out var waterOverflow);
overflowingSolution.TryGetReagent("Oil", out var oilOverFlow); overflowingSolution.TryGetReagent("Oil", out var oilOverFlow);
Assert.That(waterOverflow, Is.EqualTo(waterQuantity - waterMix)); Assert.That(waterOverflow, Is.EqualTo(waterQuantity - waterMix));

View File

@@ -32,7 +32,7 @@ namespace Content.IntegrationTests.Tests.Commands
await server.WaitAssertion(() => await server.WaitAssertion(() =>
{ {
Assert.That(configManager.GetCVar<bool>(CCVars.GameLobbyEnabled), Is.EqualTo(false)); Assert.That(configManager.GetCVar(CCVars.GameLobbyEnabled), Is.EqualTo(false));
configManager.SetCVar(CCVars.GameLobbyEnabled, lobbyEnabled); configManager.SetCVar(CCVars.GameLobbyEnabled, lobbyEnabled);
Assert.That(gameTicker.RunLevel, Is.EqualTo(GameRunLevel.InRound)); Assert.That(gameTicker.RunLevel, Is.EqualTo(GameRunLevel.InRound));

View File

@@ -124,7 +124,7 @@ namespace Content.IntegrationTests.Tests.Damageable
await server.WaitAssertion(() => await server.WaitAssertion(() =>
{ {
var uid = (EntityUid) sDamageableEntity; var uid = sDamageableEntity;
// Check that the correct types are supported. // Check that the correct types are supported.
Assert.That(sDamageableComponent.Damage.DamageDict.ContainsKey(type1.ID), Is.False); Assert.That(sDamageableComponent.Damage.DamageDict.ContainsKey(type1.ID), Is.False);

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -28,7 +29,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components
.ToList() .ToList()
.AsParallel() .AsParallel()
.Where(filePath => filePath.Extension == "yml" && .Where(filePath => filePath.Extension == "yml" &&
!filePath.Filename.StartsWith(".")) !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray(); .ToArray();
var cComponentFactory = client.ResolveDependency<IComponentFactory>(); var cComponentFactory = client.ResolveDependency<IComponentFactory>();

View File

@@ -8,13 +8,12 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests.Materials
{
/// <summary> /// <summary>
/// Materials and stacks have some odd relationships to entities, /// Materials and stacks have some odd relationships to entities,
/// so we need some test coverage for them. /// so we need some test coverage for them.
/// </summary> /// </summary>
namespace Content.IntegrationTests.Tests.Materials
{
[TestFixture] [TestFixture]
[TestOf(typeof(StackSystem))] [TestOf(typeof(StackSystem))]
[TestOf(typeof(MaterialPrototype))] [TestOf(typeof(MaterialPrototype))]

View File

@@ -92,7 +92,7 @@ namespace Content.IntegrationTests.Tests
var mapFolder = new ResourcePath("/Maps"); var mapFolder = new ResourcePath("/Maps");
var maps = resourceManager var maps = resourceManager
.ContentFindFiles(mapFolder) .ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".")) .Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray(); .ToArray();
foreach (var map in maps) foreach (var map in maps)
@@ -100,7 +100,7 @@ namespace Content.IntegrationTests.Tests
var rootedPath = map.ToRootedPath(); var rootedPath = map.ToRootedPath();
// ReSharper disable once RedundantLogicalConditionalExpressionOperand // ReSharper disable once RedundantLogicalConditionalExpressionOperand
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath)) if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath, StringComparison.Ordinal))
{ {
continue; continue;
} }
@@ -259,7 +259,7 @@ namespace Content.IntegrationTests.Tests
.Where(spawnpoint => spawnpoint.SpawnType == SpawnPointType.Job) .Where(spawnpoint => spawnpoint.SpawnType == SpawnPointType.Job)
.Select(spawnpoint => spawnpoint.Job.ID) .Select(spawnpoint => spawnpoint.Job.ID)
.Distinct(); .Distinct();
List<string> missingSpawnPoints = new() { }; List<string> missingSpawnPoints = new();
foreach (var spawnpoint in jobList.Except(spawnPoints)) foreach (var spawnpoint in jobList.Except(spawnPoints))
{ {
if (protoManager.Index<JobPrototype>(spawnpoint).SetPreference) if (protoManager.Index<JobPrototype>(spawnpoint).SetPreference)
@@ -302,7 +302,7 @@ namespace Content.IntegrationTests.Tests
var mapFolder = new ResourcePath("/Maps"); var mapFolder = new ResourcePath("/Maps");
var maps = resourceManager var maps = resourceManager
.ContentFindFiles(mapFolder) .ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".")) .Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray(); .ToArray();
var mapNames = new List<string>(); var mapNames = new List<string>();
foreach (var map in maps) foreach (var map in maps)
@@ -310,7 +310,7 @@ namespace Content.IntegrationTests.Tests
var rootedPath = map.ToRootedPath(); var rootedPath = map.ToRootedPath();
// ReSharper disable once RedundantLogicalConditionalExpressionOperand // ReSharper disable once RedundantLogicalConditionalExpressionOperand
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath) || if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath, StringComparison.Ordinal) ||
gameMaps.Contains(map)) gameMaps.Contains(map))
{ {
continue; continue;

View File

@@ -35,12 +35,9 @@ namespace Content.Server.Abilities.Mime
Event = new InvisibleWallActionEvent(), Event = new InvisibleWallActionEvent(),
}; };
// The vow zone lies below
/// The vow zone lies below
public bool VowBroken = false; public bool VowBroken = false;
/// <summary> /// <summary>
/// Whether this mime is ready to take the vow again. /// Whether this mime is ready to take the vow again.
/// Note that if they already have the vow, this is also false. /// Note that if they already have the vow, this is also false.
@@ -55,7 +52,7 @@ namespace Content.Server.Abilities.Mime
/// <summary> /// <summary>
/// How long it takes the mime to get their powers back /// How long it takes the mime to get their powers back
/// </summary>
[DataField("vowCooldown", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("vowCooldown", customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan VowCooldown = TimeSpan.FromMinutes(5); public TimeSpan VowCooldown = TimeSpan.FromMinutes(5);
} }

View File

@@ -40,7 +40,7 @@ namespace Content.Server.Access.Systems
// if really unlucky, burn card // if really unlucky, burn card
if (randomPick <= 0.15f) if (randomPick <= 0.15f)
{ {
TryComp<TransformComponent>(uid, out TransformComponent? transformComponent); TryComp(uid, out TransformComponent? transformComponent);
if (transformComponent != null) if (transformComponent != null)
{ {
_popupSystem.PopupCoordinates(Loc.GetString("id-card-component-microwave-burnt", ("id", uid)), _popupSystem.PopupCoordinates(Loc.GetString("id-card-component-microwave-burnt", ("id", uid)),

View File

@@ -13,11 +13,6 @@ namespace Content.Server.Actions
[Dependency] private readonly ChatSystem _chat = default!; [Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!; [Dependency] private readonly MetaDataSystem _metaSystem = default!;
public override void Initialize()
{
base.Initialize();
}
protected override bool PerformBasicActions(EntityUid user, ActionType action, bool predicted) protected override bool PerformBasicActions(EntityUid user, ActionType action, bool predicted)
{ {
var result = base.PerformBasicActions(user, action, predicted); var result = base.PerformBasicActions(user, action, predicted);

View File

@@ -115,7 +115,7 @@ public sealed class RoleBanManager
if (!_cachedRoleBans.TryGetValue(playerUserId, out var roleBans)) if (!_cachedRoleBans.TryGetValue(playerUserId, out var roleBans))
return null; return null;
return roleBans return roleBans
.Where(ban => ban.Role.StartsWith(JobPrefix)) .Where(ban => ban.Role.StartsWith(JobPrefix, StringComparison.Ordinal))
.Select(ban => ban.Role[JobPrefix.Length..]) .Select(ban => ban.Role[JobPrefix.Length..])
.ToHashSet(); .ToHashSet();
} }

View File

@@ -826,8 +826,6 @@ public sealed partial class AdminVerbSystem
yield return ent; yield return ent;
} }
} }
yield break;
} }
else if (HasComp<MapComponent>(target)) else if (HasComp<MapComponent>(target))
@@ -839,8 +837,6 @@ public sealed partial class AdminVerbSystem
yield return ent; yield return ent;
} }
} }
yield break;
} }
else else
{ {

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Advertisements
public sealed class AdvertisementsPackPrototype : IPrototype public sealed class AdvertisementsPackPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[IdDataFieldAttribute] [IdDataField]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("advertisements")] [DataField("advertisements")]

View File

@@ -91,7 +91,6 @@ public sealed class AFKSystem : EntitySystem
{ {
var ev = new UnAFKEvent(pSession); var ev = new UnAFKEvent(pSession);
RaiseLocalEvent(ref ev); RaiseLocalEvent(ref ev);
continue;
} }
} }
} }

View File

@@ -40,7 +40,7 @@ namespace Content.Server.AirlockPainter
{ {
ev.Component.IsSpraying = false; ev.Component.IsSpraying = false;
if (TryComp<AppearanceComponent>(ev.Target, out var appearance) && if (TryComp<AppearanceComponent>(ev.Target, out var appearance) &&
TryComp<PaintableAirlockComponent>(ev.Target, out PaintableAirlockComponent? airlock)) TryComp(ev.Target, out PaintableAirlockComponent? airlock))
{ {
SoundSystem.Play(ev.Component.SpraySound.GetSound(), Filter.Pvs(ev.UsedTool, entityManager:EntityManager), ev.UsedTool); SoundSystem.Play(ev.Component.SpraySound.GetSound(), Filter.Pvs(ev.UsedTool, entityManager:EntityManager), ev.UsedTool);
appearance.SetData(DoorVisuals.BaseRSI, ev.Sprite); appearance.SetData(DoorVisuals.BaseRSI, ev.Sprite);

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Announcements;
[Prototype("roundAnnouncement")] [Prototype("roundAnnouncement")]
public sealed class RoundAnnouncementPrototype : IPrototype public sealed class RoundAnnouncementPrototype : IPrototype
{ {
[IdDataFieldAttribute] [IdDataField]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("sound")] public SoundSpecifier? Sound; [DataField("sound")] public SoundSpecifier? Sound;

View File

@@ -52,9 +52,10 @@ public sealed class PyroclasticAnomalySystem : EntitySystem
var mix = _atmosphere.GetTileMixture(grid, map, indices, true); var mix = _atmosphere.GetTileMixture(grid, map, indices, true);
if (mix is not { }) if (mix is not { })
continue; continue;
mix.AdjustMoles(component.SupercriticalGas, component.SupercriticalMoleAmount); mix.AdjustMoles(component.SupercriticalGas, component.SupercriticalMoleAmount);
mix.Temperature += component.HotspotExposeTemperature; mix.Temperature += component.HotspotExposeTemperature;
_atmosphere.HotspotExpose(grid.Value, indices, component.HotspotExposeTemperature, mix?.Volume ?? component.SupercriticalMoleAmount, true); _atmosphere.HotspotExpose(grid.Value, indices, component.HotspotExposeTemperature, mix.Volume, true);
} }
} }
IgniteNearby(xform.Coordinates, 1, component.MaximumIgnitionRadius * 2); IgniteNearby(xform.Coordinates, 1, component.MaximumIgnitionRadius * 2);

View File

@@ -80,8 +80,6 @@ namespace Content.Server.Armor
var examineMarkup = GetArmorExamine(armorModifiers); var examineMarkup = GetArmorExamine(armorModifiers);
_examine.AddDetailedExamineVerb(args, component, examineMarkup, Loc.GetString("armor-examinable-verb-text"), "/Textures/Interface/VerbIcons/dot.svg.192dpi.png", Loc.GetString("armor-examinable-verb-message")); _examine.AddDetailedExamineVerb(args, component, examineMarkup, Loc.GetString("armor-examinable-verb-text"), "/Textures/Interface/VerbIcons/dot.svg.192dpi.png", Loc.GetString("armor-examinable-verb-message"));
return;
} }
private static FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers) private static FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers)

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Atmos.EntitySystems
/// <summary> /// <summary>
/// List of gas reactions ordered by priority. /// List of gas reactions ordered by priority.
/// </summary> /// </summary>
public IEnumerable<GasReactionPrototype> GasReactions => _gasReactions!; public IEnumerable<GasReactionPrototype> GasReactions => _gasReactions;
/// <summary> /// <summary>
/// Cached array of gas specific heats. /// Cached array of gas specific heats.

View File

@@ -125,7 +125,7 @@ namespace Content.Server.Atmos.EntitySystems
// We step through tiles according to the pressure direction on the current tile. // We step through tiles according to the pressure direction on the current tile.
// The goal is to get a general direction of the airflow in the area. // The goal is to get a general direction of the airflow in the area.
// 3 is the magic number - enough to go around corners, but not U-turns. // 3 is the magic number - enough to go around corners, but not U-turns.
var curTile = tile!; var curTile = tile;
for (var i = 0; i < 3; i++) for (var i = 0; i < 3; i++)
{ {
if (curTile.PressureDirection == AtmosDirection.Invalid if (curTile.PressureDirection == AtmosDirection.Invalid

View File

@@ -51,7 +51,7 @@ namespace Content.Server.Atmos.EntitySystems
if (!TryComp(uid, out MapGridComponent? mapGridComp)) if (!TryComp(uid, out MapGridComponent? mapGridComp))
return true; return true;
var mapUid = _mapManager.GetMapEntityIdOrThrow(Transform(((Component) mapGridComp).Owner).MapID); var mapUid = _mapManager.GetMapEntityIdOrThrow(Transform(mapGridComp.Owner).MapID);
var volume = GetVolumeForTiles(mapGridComp, 1); var volume = GetVolumeForTiles(mapGridComp, 1);

View File

@@ -1,9 +1,9 @@
namespace Content.Server.Atmos.Miasma namespace Content.Server.Atmos.Miasma
{ {
[RegisterComponent]
/// <summary> /// <summary>
/// Entities inside this container will not rot. /// Entities inside this container will not rot.
/// </summary> /// </summary>
[RegisterComponent]
public sealed class AntiRottingContainerComponent : Component public sealed class AntiRottingContainerComponent : Component
{} {}
} }

View File

@@ -1,9 +1,9 @@
namespace Content.Server.Atmos.Miasma namespace Content.Server.Atmos.Miasma
{ {
[RegisterComponent]
/// <summary> /// <summary>
/// Way for natural sources of rotting to tell if there are more unnatural preservation forces at play. /// Way for natural sources of rotting to tell if there are more unnatural preservation forces at play.
/// </summary> /// </summary>
[RegisterComponent]
public sealed class BodyPreservedComponent : Component public sealed class BodyPreservedComponent : Component
{ {
public int PreservationSources = 0; public int PreservationSources = 0;

View File

@@ -2,11 +2,11 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Atmos.Miasma namespace Content.Server.Atmos.Miasma
{ {
[RegisterComponent]
/// <summary> /// <summary>
/// This makes mobs eventually start rotting when they die. /// This makes mobs eventually start rotting when they die.
/// It may be expanded to food at some point, but it's just for mobs right now. /// It may be expanded to food at some point, but it's just for mobs right now.
/// </summary> /// </summary>
[RegisterComponent]
public sealed class PerishableComponent : Component public sealed class PerishableComponent : Component
{ {
/// <summary> /// <summary>

View File

@@ -78,7 +78,7 @@ namespace Content.Server.Atmos.Piping.Unary.Components
if (!data.FilterGases.SequenceEqual(FilterGases)) if (!data.FilterGases.SequenceEqual(FilterGases))
{ {
FilterGases.Clear(); FilterGases.Clear();
foreach (var gas in data.FilterGases!) foreach (var gas in data.FilterGases)
FilterGases.Add(gas); FilterGases.Add(gas);
} }
} }

View File

@@ -59,7 +59,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
foreach (var entityUid in grid.GetLocal(coordinates)) foreach (var entityUid in grid.GetLocal(coordinates))
{ {
if (EntityManager.TryGetComponent<GasPortComponent>(entityUid, out port)) if (EntityManager.TryGetComponent(entityUid, out port))
{ {
return true; return true;
} }

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Atmos.Reactions
public sealed class GasReactionPrototype : IPrototype public sealed class GasReactionPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[IdDataFieldAttribute] [IdDataField]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>

View File

@@ -119,7 +119,7 @@ namespace Content.Server.Bed.Sleep
return; return;
} }
if (TryComp<SpamEmitSoundComponent>(uid, out var spam)) if (TryComp<SpamEmitSoundComponent>(uid, out var spam))
spam.Enabled = (args.NewMobState == MobState.Alive) ? true : false; spam.Enabled = args.NewMobState == MobState.Alive;
} }
private void AddWakeVerb(EntityUid uid, SleepingComponent component, GetVerbsEvent<AlternativeVerb> args) private void AddWakeVerb(EntityUid uid, SleepingComponent component, GetVerbsEvent<AlternativeVerb> args)

View File

@@ -179,7 +179,7 @@ public sealed class BloodstreamSystem : EntitySystem
SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default); SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default);
_popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid, _popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid,
uid, PopupType.Medium); uid, PopupType.Medium);
; } }
} }
private void OnHealthBeingExamined(EntityUid uid, BloodstreamComponent component, HealthBeingExaminedEvent args) private void OnHealthBeingExamined(EntityUid uid, BloodstreamComponent component, HealthBeingExaminedEvent args)

View File

@@ -198,8 +198,7 @@ public sealed class InternalsSystem : EntitySystem
{ {
return TryComp(component.BreathToolEntity, out BreathToolComponent? breathTool) && return TryComp(component.BreathToolEntity, out BreathToolComponent? breathTool) &&
breathTool.IsFunctional && breathTool.IsFunctional &&
TryComp(component.GasTankEntity, out GasTankComponent? gasTank) && TryComp(component.GasTankEntity, out GasTankComponent? _);
gasTank.Air != null;
} }
private short GetSeverity(InternalsComponent component) private short GetSeverity(InternalsComponent component)
@@ -207,8 +206,7 @@ public sealed class InternalsSystem : EntitySystem
if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2; if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2;
// If pressure in the tank is below low pressure threshhold, flash warning on internals UI // If pressure in the tank is below low pressure threshhold, flash warning on internals UI
if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank) if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank) && gasTank.IsLowPressure)
&& gasTank.IsLowPressure)
return 0; return 0;
return 1; return 1;

View File

@@ -7,14 +7,14 @@ public class MutationSystem : EntitySystem
[Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!;
/// <summary> /// <summary>
// Main idea: Simulate genetic mutation using random binary flips. Each /// Main idea: Simulate genetic mutation using random binary flips. Each
// seed attribute can be encoded with a variable number of bits, e.g. /// seed attribute can be encoded with a variable number of bits, e.g.
// NutrientConsumption is represented by 5 bits randomly distributed in the /// NutrientConsumption is represented by 5 bits randomly distributed in the
// plant's genome which thermometer code the floating value between 0.1 and /// plant's genome which thermometer code the floating value between 0.1 and
// 5. 1 unit of mutation flips one bit in the plant's genome, which changes /// 5. 1 unit of mutation flips one bit in the plant's genome, which changes
// NutrientConsumption if one of those 5 bits gets affected. /// NutrientConsumption if one of those 5 bits gets affected.
// ///
// You MUST clone() seed before mutating it! /// You MUST clone() seed before mutating it!
/// </summary> /// </summary>
public void MutateSeed(SeedData seed, float severity) public void MutateSeed(SeedData seed, float severity)
{ {

View File

@@ -288,7 +288,7 @@ public sealed partial class CargoSystem
var possibleNames = _protoMan.Index<DatasetPrototype>(prototype.NameDataset).Values; var possibleNames = _protoMan.Index<DatasetPrototype>(prototype.NameDataset).Values;
var name = _random.Pick(possibleNames); var name = _random.Pick(possibleNames);
if (!_map.TryLoad(CargoMap.Value, prototype.Path.ToString(), out var gridList) || gridList == null) if (!_map.TryLoad(CargoMap.Value, prototype.Path.ToString(), out var gridList))
{ {
_sawmill.Error($"Could not load the cargo shuttle!"); _sawmill.Error($"Could not load the cargo shuttle!");
return; return;
@@ -519,7 +519,7 @@ public sealed partial class CargoSystem
_popup.PopupEntity(Loc.GetString("cargo-shuttle-console-organics"), player.Value, player.Value); _popup.PopupEntity(Loc.GetString("cargo-shuttle-console-organics"), player.Value, player.Value);
_audio.PlayPvs(_audio.GetSound(component.DenySound), uid); _audio.PlayPvs(_audio.GetSound(component.DenySound), uid);
return; return;
}; }
SellPallets(shuttle, bank); SellPallets(shuttle, bank);
_console.RefreshShuttleConsoles(); _console.RefreshShuttleConsoles();

View File

@@ -241,13 +241,13 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
loader.BackgroundPrograms.Remove(cartridgeUid); loader.BackgroundPrograms.Remove(cartridgeUid);
} }
protected override void OnItemInserted(EntityUid uid, Shared.CartridgeLoader.CartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args) protected override void OnItemInserted(EntityUid uid, CartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args)
{ {
RaiseLocalEvent(args.Entity, new CartridgeAddedEvent(uid)); RaiseLocalEvent(args.Entity, new CartridgeAddedEvent(uid));
base.OnItemInserted(uid, loader, args); base.OnItemInserted(uid, loader, args);
} }
protected override void OnItemRemoved(EntityUid uid, Shared.CartridgeLoader.CartridgeLoaderComponent loader, EntRemovedFromContainerMessage args) protected override void OnItemRemoved(EntityUid uid, CartridgeLoaderComponent loader, EntRemovedFromContainerMessage args)
{ {
var deactivate = loader.BackgroundPrograms.Remove(args.Entity); var deactivate = loader.BackgroundPrograms.Remove(args.Entity);

View File

@@ -40,15 +40,14 @@ namespace Content.Server.Chat.Commands
{ {
// Prevent the player from returning to the body. // Prevent the player from returning to the body.
// Note that mind cannot be null because otherwise victim would be null. // Note that mind cannot be null because otherwise victim would be null.
gameTicker.OnGhostAttempt(mind!, false); gameTicker.OnGhostAttempt(mind, false);
return; return;
} }
if (gameTicker.OnGhostAttempt(mind, true)) if (gameTicker.OnGhostAttempt(mind, true))
return; return;
shell?.WriteLine("You can't ghost right now."); shell.WriteLine("You can't ghost right now.");
} }
} }
} }

View File

@@ -600,7 +600,7 @@ public sealed partial class ChatSystem : SharedChatSystem
/// This event is raised before chat messages are sent out to clients. This enables some systems to send the chat /// This event is raised before chat messages are sent out to clients. This enables some systems to send the chat
/// messages to otherwise out-of view entities (e.g. for multiple viewports from cameras). /// messages to otherwise out-of view entities (e.g. for multiple viewports from cameras).
/// </summary> /// </summary>
public record class ExpandICChatRecipientstEvent(EntityUid Source, float VoiceRange, Dictionary<ICommonSession, ChatSystem.ICChatRecipientData> Recipients) public record ExpandICChatRecipientstEvent(EntityUid Source, float VoiceRange, Dictionary<ICommonSession, ChatSystem.ICChatRecipientData> Recipients)
{ {
} }

View File

@@ -347,7 +347,7 @@ namespace Content.Server.Chemistry.EntitySystems
{ {
_solutionContainerSystem.TryGetSolution(pill, SharedChemMaster.PillSolutionName, out var solution); _solutionContainerSystem.TryGetSolution(pill, SharedChemMaster.PillSolutionName, out var solution);
var quantity = solution?.Volume ?? FixedPoint2.Zero; var quantity = solution?.Volume ?? FixedPoint2.Zero;
return ((string, FixedPoint2 quantity))(Name(pill), quantity:(FixedPoint2) quantity); return (Name(pill), quantity);
})).ToList(); })).ToList();
return pills is null return pills is null

View File

@@ -188,7 +188,7 @@ public sealed partial class ChemistrySystem
private void OnInjectorStartup(EntityUid uid, InjectorComponent component, ComponentStartup args) private void OnInjectorStartup(EntityUid uid, InjectorComponent component, ComponentStartup args)
{ {
/// ???? why ????? // ???? why ?????
Dirty(component); Dirty(component);
} }

View File

@@ -31,7 +31,7 @@ public sealed partial class ChemistrySystem
if (!_solutions.TryGetMixableSolution(args.Target.Value, out solution)) if (!_solutions.TryGetMixableSolution(args.Target.Value, out solution))
return; return;
_popup.PopupEntity(Loc.GetString(component.MixMessage, ("mixed", Identity.Entity(args.Target.Value, EntityManager)), ("mixer", Identity.Entity(uid, EntityManager))), args.User, args.User); ; _popup.PopupEntity(Loc.GetString(component.MixMessage, ("mixed", Identity.Entity(args.Target.Value, EntityManager)), ("mixer", Identity.Entity(uid, EntityManager))), args.User, args.User);
_solutions.UpdateChemicals(args.Target.Value, solution, true, component); _solutions.UpdateChemicals(args.Target.Value, solution, true, component);

View File

@@ -365,7 +365,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem
/// </summary> /// </summary>
/// <param name="uid">EntityUid to which to add solution</param> /// <param name="uid">EntityUid to which to add solution</param>
/// <param name="name">name for the solution</param> /// <param name="name">name for the solution</param>
/// <param name="minVol">Ensures that the solution's maximum volume is larger than this value./param> /// <param name="minVol">Ensures that the solution's maximum volume is larger than this value.</param>
/// <param name="solutionsMgr">solution components used in resolves</param> /// <param name="solutionsMgr">solution components used in resolves</param>
/// <returns>solution</returns> /// <returns>solution</returns>
public Solution EnsureSolution(EntityUid uid, string name, FixedPoint2 minVol, out bool existed, public Solution EnsureSolution(EntityUid uid, string name, FixedPoint2 minVol, out bool existed,

View File

@@ -130,7 +130,6 @@ namespace Content.Server.Chemistry.EntitySystems
("target", target))); ("target", target)));
args.Handled = true; args.Handled = true;
return;
} }
} }
} }

View File

@@ -1,9 +1,9 @@
namespace Content.Server.Cloning.Components namespace Content.Server.Cloning.Components;
{
[RegisterComponent]
/// <summary> /// <summary>
/// Shrimply a tracking component for pods that are cloning. /// Shrimply a tracking component for pods that are cloning.
/// </summary> /// </summary>
[RegisterComponent]
public sealed class ActiveCloningPodComponent : Component public sealed class ActiveCloningPodComponent : Component
{} {
} }

View File

@@ -11,8 +11,8 @@ namespace Content.Server.Contests
/// A contest is figuring out, based on data in components on two entities, /// A contest is figuring out, based on data in components on two entities,
/// which one has an advantage in a situation. The advantage is expressed by a multiplier. /// which one has an advantage in a situation. The advantage is expressed by a multiplier.
/// 1 = No advantage to either party. /// 1 = No advantage to either party.
/// >1 = Advantage to roller /// &gt;1 = Advantage to roller
/// <1 = Advantage to target /// &lt;1 = Advantage to target
/// Roller should be the entity with an advantage from being bigger/healthier/more skilled, etc. /// Roller should be the entity with an advantage from being bigger/healthier/more skilled, etc.
/// </summary> /// </summary>
/// ///
@@ -39,7 +39,7 @@ namespace Content.Server.Contests
/// After that, it runs the % towards crit through a converter that smooths out and makes /// After that, it runs the % towards crit through a converter that smooths out and makes
/// the the ratios less severe. /// the the ratios less severe.
/// Returns the roller's adjusted damage value divided by the target's. Higher is better for the roller. /// Returns the roller's adjusted damage value divided by the target's. Higher is better for the roller.
/// <summary> /// </summary>
public float DamageContest(EntityUid roller, EntityUid target, DamageableComponent? rollerDamage = null, DamageableComponent? targetDamage = null) public float DamageContest(EntityUid roller, EntityUid target, DamageableComponent? rollerDamage = null, DamageableComponent? targetDamage = null)
{ {
if (!Resolve(roller, ref rollerDamage, false) || !Resolve(target, ref targetDamage, false)) if (!Resolve(roller, ref rollerDamage, false) || !Resolve(target, ref targetDamage, false))
@@ -85,7 +85,7 @@ namespace Content.Server.Contests
/// Finds the % of each entity's stamina damage towards its stam crit threshold. /// Finds the % of each entity's stamina damage towards its stam crit threshold.
/// It then runs the % towards the converter to smooth/soften it. /// It then runs the % towards the converter to smooth/soften it.
/// Returns the roller's decimal % divided by the target's. Higher value is better for the roller. /// Returns the roller's decimal % divided by the target's. Higher value is better for the roller.
/// <summary> /// </summary>
public float StaminaContest(EntityUid roller, EntityUid target, StaminaComponent? rollerStamina = null, StaminaComponent? targetStamina = null) public float StaminaContest(EntityUid roller, EntityUid target, StaminaComponent? rollerStamina = null, StaminaComponent? targetStamina = null)
{ {
if (!Resolve(roller, ref rollerStamina, false) || !Resolve(target, ref targetStamina, false)) if (!Resolve(roller, ref rollerStamina, false) || !Resolve(target, ref targetStamina, false))
@@ -101,7 +101,7 @@ namespace Content.Server.Contests
/// This will compare the roller and target's damage, mass, and stamina. See the functions for what each one does. /// This will compare the roller and target's damage, mass, and stamina. See the functions for what each one does.
/// You can change the 'weighting' to make the tests weigh more or less than the other tests. /// You can change the 'weighting' to make the tests weigh more or less than the other tests.
/// Returns a weighted average of all 3 tests. /// Returns a weighted average of all 3 tests.
/// <summary> /// </summary>
public float OverallStrengthContest(EntityUid roller, EntityUid target, float damageWeight = 1f, float massWeight = 1f, float stamWeight = 1f) public float OverallStrengthContest(EntityUid roller, EntityUid target, float damageWeight = 1f, float massWeight = 1f, float stamWeight = 1f)
{ {
var weightTotal = damageWeight + massWeight + stamWeight; var weightTotal = damageWeight + massWeight + stamWeight;

View File

@@ -82,7 +82,6 @@ namespace Content.Server.Cuffs.Components
/// <summary> /// <summary>
/// Add a set of cuffs to an existing CuffedComponent. /// Add a set of cuffs to an existing CuffedComponent.
/// </summary> /// </summary>
/// <param name="prototype"></param>
public bool TryAddNewCuffs(EntityUid user, EntityUid handcuff) public bool TryAddNewCuffs(EntityUid user, EntityUid handcuff)
{ {
if (!_entMan.HasComponent<HandcuffComponent>(handcuff)) if (!_entMan.HasComponent<HandcuffComponent>(handcuff))
@@ -261,8 +260,6 @@ namespace Content.Server.Cuffs.Components
{ {
user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-fail-message")); user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-fail-message"));
} }
return;
} }
//Lord forgive me for putting this here //Lord forgive me for putting this here

View File

@@ -174,7 +174,7 @@ namespace Content.Server.DeviceNetwork.Systems
if (!Resolve(uid, ref device, false)) if (!Resolve(uid, ref device, false))
return; return;
if (device.Address == address && device.CustomAddress == true) return; if (device.Address == address && device.CustomAddress) return;
var deviceNet = GetNetwork(device.DeviceNetId); var deviceNet = GetNetwork(device.DeviceNetId);
deviceNet.Remove(device); deviceNet.Remove(device);

View File

@@ -4,10 +4,10 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Disease.Components namespace Content.Server.Disease.Components
{ {
[RegisterComponent]
/// <summary> /// <summary>
/// For shared behavior between both disease machines /// For shared behavior between both disease machines
/// </summary> /// </summary>
[RegisterComponent]
public sealed class DiseaseMachineComponent : Component public sealed class DiseaseMachineComponent : Component
{ {
[DataField("delay")] [DataField("delay")]

View File

@@ -2,7 +2,7 @@ namespace Content.Server.Disease.Components
{ {
/// <summary> /// <summary>
/// For EntityQuery to keep track of which machines are running /// For EntityQuery to keep track of which machines are running
/// <summary> /// </summary>
[RegisterComponent] [RegisterComponent]
public sealed class DiseaseMachineRunningComponent : Component public sealed class DiseaseMachineRunningComponent : Component
{} {}

View File

@@ -3,11 +3,11 @@ using Content.Shared.Disease;
namespace Content.Server.Disease.Components namespace Content.Server.Disease.Components
{ {
[RegisterComponent]
/// <summary> /// <summary>
/// For mouth swabs used to collect and process /// For mouth swabs used to collect and process
/// disease samples. /// disease samples.
/// </summary> /// </summary>
[RegisterComponent]
public sealed class DiseaseSwabComponent : Component public sealed class DiseaseSwabComponent : Component
{ {
/// <summary> /// <summary>

View File

@@ -30,17 +30,18 @@ namespace Content.Server.Disease.Effects
return; return;
var stream = bloodstream.ChemicalSolution; var stream = bloodstream.ChemicalSolution;
if (stream != null) if (stream == null)
{ return;
var solutionSys = args.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>(); var solutionSys = args.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>();
if (Reagent != null) if (Reagent == null)
{ return;
if (Amount < 0 && stream.ContainsReagent(Reagent)) if (Amount < 0 && stream.ContainsReagent(Reagent))
solutionSys.TryRemoveReagent(args.DiseasedEntity, stream, Reagent, -Amount); solutionSys.TryRemoveReagent(args.DiseasedEntity, stream, Reagent, -Amount);
if (Amount > 0) if (Amount > 0)
solutionSys.TryAddReagent(args.DiseasedEntity, stream, Reagent, Amount, out _); solutionSys.TryAddReagent(args.DiseasedEntity, stream, Reagent, Amount, out _);
} }
} }
} }
}
}

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