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();
streamBytesLeft -= bytesInBuffer;
bool flush = streamBytesLeft == 0 ? true : false;
bool flush = streamBytesLeft == 0;
bool completed = false;

View File

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

View File

@@ -104,12 +104,12 @@ public sealed class ExplosionDebugOverlay : Overlay
var screenCenter = _eyeManager.WorldToScreen(worldCenter);
if (Intensity![i] > 9)
if (Intensity[i] > 9)
screenCenter += (-12, -8);
else
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 worldCenter = transform.Transform(((Vector2) epicenter + 0.5f) * tileSize);
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);
}
}
@@ -159,7 +159,7 @@ public sealed class ExplosionDebugOverlay : Overlay
{
for (var i = 0; i < Intensity.Count; i++)
{
var color = ColorMap(Intensity![i]);
var color = ColorMap(Intensity[i]);
var colorTransparent = color;
colorTransparent.A = 0.2f;
@@ -183,7 +183,7 @@ public sealed class ExplosionDebugOverlay : Overlay
private Color ColorMap(float intensity)
{
var frac = 1 - intensity / Intensity![0];
var frac = 1 - intensity / Intensity[0];
Color result;
if (frac < 0.5f)
result = Color.InterpolateBetween(Color.Red, Color.Orange, frac * 2);

View File

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

View File

@@ -32,7 +32,7 @@ public sealed partial class ObjectsTab : Control
foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection)))
{
_selections.Add((ObjectsTabSelection)type!);
ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type!)!);
ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type)!);
}
RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]);
@@ -43,9 +43,9 @@ public sealed partial class ObjectsTab : Control
var entities = selection switch
{
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(),
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null)
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null),
};
foreach (var control in _objects)

View File

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

View File

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

View File

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

View File

@@ -40,7 +40,7 @@ namespace Content.Client.Atmos.Overlays
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)
{

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:Content.Client.Stylesheets"
MinSize="200 120" Title="Volume Pump">
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" SeparationOverride="10">
<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
if (row.MainButton.ToolTip != null)
description.AddText(row.MainButton.ToolTip);
_orderMenu.Description.SetMessage(description);
_orderMenu.Description.SetMessage(description);
_product = row.Product;
_orderMenu.ProductName.Text = row.ProductName.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>
private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
{
BufferTransferButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Transfer;
BufferDiscardButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Discard;
BufferTransferButton.Pressed = state.Mode == ChemMasterMode.Transfer;
BufferDiscardButton.Pressed = state.Mode == ChemMasterMode.Discard;
BuildContainerUI(InputContainerInfo, state.InputContainerInfo, true);
BuildContainerUI(OutputContainerInfo, state.OutputContainerInfo, false);

View File

@@ -53,7 +53,7 @@ namespace Content.Client.Clickable
var pathStr = obj.Path.ToString();
foreach (var path in IgnoreTexturePaths)
{
if (pathStr.StartsWith(path))
if (pathStr.StartsWith(path, StringComparison.Ordinal))
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.
// This **can** differ from the dir defined before, but can also just be the same.
if (sprite.EnableDirectionOverride)
dir = sprite.DirectionOverride.Convert(rsiState.Directions);;
dir = sprite.DirectionOverride.Convert(rsiState.Directions);
dir = dir.OffsetRsiDir(layer.DirOffset);
if (_clickMapManager.IsOccluding(layer.ActualRsi!, layer.State, dir, layer.AnimationFrame, layerImagePos))

View File

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

View File

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

View File

@@ -52,7 +52,7 @@ namespace Content.Client.Computer
}
/// <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.
/// </summary>
[Virtual]

View File

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

View File

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

View File

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

View File

@@ -45,57 +45,36 @@ namespace Content.Client.Fluids
return;
}
if (args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale)
&& args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume)
&& args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor)
&& args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating))
if (!args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale)
|| !args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume)
|| !args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor)
|| !args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating))
{
// 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);
return;
}
Color newColor;
if (component.Recolor)
{
newColor = solutionColor.WithAlpha(cappedScale);
}
else
{
newColor = args.Sprite.Color.WithAlpha(cappedScale);
}
// 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);
args.Sprite.LayerSetColor(0, newColor);
var newColor = component.Recolor ? solutionColor.WithAlpha(cappedScale) : args.Sprite.Color.WithAlpha(cappedScale);
if (component.CustomPuddleSprite) //Don't consider wet floor effects if we're using a custom sprite.
{
return;
}
args.Sprite.LayerSetColor(0, newColor);
bool wetFloorEffectNeeded;
// Don't consider wet floor effects if we're using a custom sprite.
if (component.CustomPuddleSprite)
return;
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
{
StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha);
}
}
else
{
if (args.Sprite.LayerGetState(0) == "sparkles") // If we have the effect but don't need it - end it
EndWetFloorEffect(args.Sprite, component.OriginalRsi);
}
if (isEvaporating && currentVolume <= component.WetFloorEffectThreshold)
{
// If we need the effect but don't already have it - start it
if (args.Sprite.LayerGetState(0) != "sparkles")
StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha);
}
else
{
return;
// If we have the effect but don't need it - end it
if (args.Sprite.LayerGetState(0) == "sparkles")
EndWetFloorEffect(args.Sprite, component.OriginalRsi);
}
}

View File

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

View File

@@ -205,7 +205,7 @@ public sealed class GuidebookSystem : EntitySystem
bool includeChildren = true,
string? selected = null)
{
Dictionary<string, GuideEntry>? guides = new();
Dictionary<string, GuideEntry> guides = new();
foreach (var guideId in guideList)
{
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");
/// Status Effects / Components
// Status Effects / Components
if (entities.HasComponent<DiseasedComponent>(msg.TargetEntity))
{
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");
}
/// Damage
// Damage
text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n");
HashSet<string> shownTypes = new();

View File

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

View File

@@ -150,13 +150,6 @@ public sealed class InstrumentSystem : SharedInstrumentSystem
var tick = instrument.Renderer.SequencerTick-1;
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;
}

View File

@@ -1,7 +1,5 @@
<DefaultWindow
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'}"
MinSize="300 450"
SetSize="300 450">

View File

@@ -1,6 +1,5 @@
<DefaultWindow
xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'lathe-queue-menu-title'}"
MinSize="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;
// ReSharper disable once ConstantNullCoalescingCondition
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract (what is resharper smoking?)
var job = protoMan.Index<JobPrototype>(highPriorityJob ?? SharedGameTicker.FallbackOverflowJob);
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.UserInterface;
using Robust.Client.UserInterface.Controls;
@@ -111,11 +112,11 @@ namespace Content.Client.Options.UI.Tabs
ApplyButton.Disabled = isEverythingSame;
ResetButton.Disabled = isEverythingSame;
NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString();
NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString();
NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString();
NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString();
NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString();
NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(CultureInfo.InvariantCulture);
NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(CultureInfo.InvariantCulture);
// 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

View File

@@ -9,16 +9,16 @@ namespace Content.Client.PDA.Ringer
[GenerateTypedNameReferences]
public sealed partial class RingtoneMenu : DefaultWindow
{
public string[] PreviousNoteInputs = new string[] { "A", "A", "A", "A"};
public LineEdit[] RingerNoteInputs = default!;
public string[] PreviousNoteInputs = new[] { "A", "A", "A", "A" };
public LineEdit[] RingerNoteInputs = default!;
public RingtoneMenu()
{
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++)
{
var input = RingerNoteInputs[i];
int index = i;

View File

@@ -1,7 +1,5 @@
<paper:PaperWindow xmlns="https://spacestation14.io"
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"
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>();
/// Initialize the background:
// Initialize the background:
PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate;
var backgroundImage = visuals.BackgroundImagePath != null? resCache.GetResource<TextureResource>(visuals.BackgroundImagePath) : 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.
// Ideally, would like to be able to allow resizing only one direction.
ScrollingContents.MinSize = Vector2.Zero;
ScrollingContents.MinSize = (Vector2)(a);
ScrollingContents.MinSize = a;
if (a.X > 0.0f)
{

View File

@@ -1,14 +1,8 @@
<paper:StampWidget xmlns="https://spacestation14.io"
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:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
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">
<PanelContainer>

View File

@@ -76,7 +76,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource
catch (Exception ex)
{
Logger.ErrorS("parallax", $"Couldn't retrieve parallax cached texture: {ex}");
// The show must go on.
try
{
// 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)
{
// The show must go on.
}
return Texture.Transparent;
}

View File

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

View File

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

View File

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

View File

@@ -56,7 +56,7 @@ public sealed partial class SurveillanceCameraSetupWindow : DefaultWindow
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)
{

View File

@@ -1,17 +1,7 @@
<targeting:TargetingDoll xmlns="https://spacestation14.io"
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"
Orientation="Vertical"
>
Orientation="Vertical">
<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 = "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 readonly BoxContainer _root;
private readonly TextureRect _buttonIcon;
private readonly Label _buttonLabel;
private readonly TextureRect? _buttonIcon;
private readonly Label? _buttonLabel;
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
{
@@ -38,7 +38,7 @@ public sealed class MenuButton : ContainerButton
set
{
_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)
{
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function);
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
}
private void OnKeyBindingChanged()
{
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function);
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
}
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
/// targeting with the specified slot.
/// </summary>
/// <param name="slot"></param>
public void ToggleTargeting(TargetedAction action)
{
if (SelectingTargetFor == action)
@@ -952,7 +951,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
_targetOutline?.Disable();
_interactionOutline?.SetEnabled(true);
if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay) || handOverlay == null)
if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay))
return;
handOverlay.IconOverride = null;

View File

@@ -1,7 +1,6 @@
<widgets:ActionsBar
xmlns="https://spacestation14.io"
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:controls="clr-namespace:Content.Client.UserInterface.Systems.Actions.Controls"
VerticalExpand="False"

View File

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

View File

@@ -1,6 +1,5 @@
<controls:CharacterObjectiveControl
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Systems.Character.Controls"
Orientation="Vertical"
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 ColorHovered = Color.FromHex("#9699bb");
private static readonly Color ColorPressed = Color.FromHex("#789B8C");
private readonly TextureRect _textureRect;
private readonly TextureRect? _textureRect;
public readonly ChannelFilterPopup ChatFilterPopup;
private readonly ChatUIController _chatUIController;
private const int FilterDropdownOffset = 120;

View File

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

View File

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

View File

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

View File

@@ -159,13 +159,13 @@ public sealed class SolutionSystemTests
Assert.That(containerSystem
.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("Oil", out var oilMix);
Assert.That(waterMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1))));
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("Oil", out var oilOverFlow);
Assert.That(waterOverflow, Is.EqualTo(waterQuantity - waterMix));

View File

@@ -32,7 +32,7 @@ namespace Content.IntegrationTests.Tests.Commands
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);
Assert.That(gameTicker.RunLevel, Is.EqualTo(GameRunLevel.InRound));

View File

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

View File

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

View File

@@ -8,13 +8,12 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
/// <summary>
/// Materials and stacks have some odd relationships to entities,
/// so we need some test coverage for them.
/// </summary>
namespace Content.IntegrationTests.Tests.Materials
{
/// <summary>
/// Materials and stacks have some odd relationships to entities,
/// so we need some test coverage for them.
/// </summary>
[TestFixture]
[TestOf(typeof(StackSystem))]
[TestOf(typeof(MaterialPrototype))]
@@ -61,7 +60,7 @@ namespace Content.IntegrationTests.Tests.Materials
Assert.That(proto.StackEntity, Is.EqualTo(stackProto.Spawn));
}
});
mapManager.DeleteMap(testMap.MapId);
});
}

View File

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

View File

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

View File

@@ -40,7 +40,7 @@ namespace Content.Server.Access.Systems
// if really unlucky, burn card
if (randomPick <= 0.15f)
{
TryComp<TransformComponent>(uid, out TransformComponent? transformComponent);
TryComp(uid, out TransformComponent? transformComponent);
if (transformComponent != null)
{
_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 MetaDataSystem _metaSystem = default!;
public override void Initialize()
{
base.Initialize();
}
protected override bool PerformBasicActions(EntityUid user, ActionType action, bool 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))
return null;
return roleBans
.Where(ban => ban.Role.StartsWith(JobPrefix))
.Where(ban => ban.Role.StartsWith(JobPrefix, StringComparison.Ordinal))
.Select(ban => ban.Role[JobPrefix.Length..])
.ToHashSet();
}

View File

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

View File

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

View File

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

View File

@@ -40,7 +40,7 @@ namespace Content.Server.AirlockPainter
{
ev.Component.IsSpraying = false;
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);
appearance.SetData(DoorVisuals.BaseRSI, ev.Sprite);

View File

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

View File

@@ -50,11 +50,12 @@ public sealed class PyroclasticAnomalySystem : EntitySystem
foreach (var ind in _atmosphere.GetAdjacentTiles(grid.Value, indices))
{
var mix = _atmosphere.GetTileMixture(grid, map, indices, true);
if (mix is not {})
if (mix is not { })
continue;
mix.AdjustMoles(component.SupercriticalGas, component.SupercriticalMoleAmount);
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);

View File

@@ -80,8 +80,6 @@ namespace Content.Server.Armor
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"));
return;
}
private static FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers)

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Atmos.EntitySystems
/// <summary>
/// List of gas reactions ordered by priority.
/// </summary>
public IEnumerable<GasReactionPrototype> GasReactions => _gasReactions!;
public IEnumerable<GasReactionPrototype> GasReactions => _gasReactions;
/// <summary>
/// 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.
// 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.
var curTile = tile!;
var curTile = tile;
for (var i = 0; i < 3; i++)
{
if (curTile.PressureDirection == AtmosDirection.Invalid

View File

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

View File

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

View File

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

View File

@@ -2,11 +2,11 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Atmos.Miasma
{
[RegisterComponent]
/// <summary>
/// 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.
/// </summary>
[RegisterComponent]
public sealed class PerishableComponent : Component
{
/// <summary>

View File

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

View File

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

View File

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

View File

@@ -119,7 +119,7 @@ namespace Content.Server.Bed.Sleep
return;
}
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)

View File

@@ -179,7 +179,7 @@ public sealed class BloodstreamSystem : EntitySystem
SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default);
_popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid,
uid, PopupType.Medium);
; }
}
}
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) &&
breathTool.IsFunctional &&
TryComp(component.GasTankEntity, out GasTankComponent? gasTank) &&
gasTank.Air != null;
TryComp(component.GasTankEntity, out GasTankComponent? _);
}
private short GetSeverity(InternalsComponent component)
@@ -207,9 +206,8 @@ public sealed class InternalsSystem : EntitySystem
if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2;
// If pressure in the tank is below low pressure threshhold, flash warning on internals UI
if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank)
&& gasTank.IsLowPressure)
return 0;
if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank) && gasTank.IsLowPressure)
return 0;
return 1;
}

View File

@@ -7,14 +7,14 @@ public class MutationSystem : EntitySystem
[Dependency] private readonly IRobustRandom _robustRandom = default!;
/// <summary>
// Main idea: Simulate genetic mutation using random binary flips. Each
// seed attribute can be encoded with a variable number of bits, e.g.
// NutrientConsumption is represented by 5 bits randomly distributed in the
// 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
// NutrientConsumption if one of those 5 bits gets affected.
//
// You MUST clone() seed before mutating it!
/// Main idea: Simulate genetic mutation using random binary flips. Each
/// seed attribute can be encoded with a variable number of bits, e.g.
/// NutrientConsumption is represented by 5 bits randomly distributed in the
/// 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
/// NutrientConsumption if one of those 5 bits gets affected.
///
/// You MUST clone() seed before mutating it!
/// </summary>
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 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!");
return;
@@ -519,7 +519,7 @@ public sealed partial class CargoSystem
_popup.PopupEntity(Loc.GetString("cargo-shuttle-console-organics"), player.Value, player.Value);
_audio.PlayPvs(_audio.GetSound(component.DenySound), uid);
return;
};
}
SellPallets(shuttle, bank);
_console.RefreshShuttleConsoles();

View File

@@ -241,13 +241,13 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
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));
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);

View File

@@ -40,15 +40,14 @@ namespace Content.Server.Chat.Commands
{
// Prevent the player from returning to the body.
// Note that mind cannot be null because otherwise victim would be null.
gameTicker.OnGhostAttempt(mind!, false);
gameTicker.OnGhostAttempt(mind, false);
return;
}
if (gameTicker.OnGhostAttempt(mind, true))
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
/// messages to otherwise out-of view entities (e.g. for multiple viewports from cameras).
/// </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);
var quantity = solution?.Volume ?? FixedPoint2.Zero;
return ((string, FixedPoint2 quantity))(Name(pill), quantity:(FixedPoint2) quantity);
return (Name(pill), quantity);
})).ToList();
return pills is null

View File

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

View File

@@ -31,7 +31,7 @@ public sealed partial class ChemistrySystem
if (!_solutions.TryGetMixableSolution(args.Target.Value, out solution))
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);

View File

@@ -365,7 +365,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem
/// </summary>
/// <param name="uid">EntityUid to which to add 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>
/// <returns>solution</returns>
public Solution EnsureSolution(EntityUid uid, string name, FixedPoint2 minVol, out bool existed,
@@ -397,7 +397,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem
{
if (!Resolve(uid, ref solutionsMgr, false))
solutionsMgr = EntityManager.EnsureComponent<SolutionContainerManagerComponent>(uid);
if (!solutionsMgr.Solutions.TryGetValue(name, out var existing))
{
var newSolution = new Solution(reagents, setMaxVol);

View File

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

View File

@@ -1,9 +1,9 @@
namespace Content.Server.Cloning.Components
namespace Content.Server.Cloning.Components;
/// <summary>
/// Shrimply a tracking component for pods that are cloning.
/// </summary>
[RegisterComponent]
public sealed class ActiveCloningPodComponent : Component
{
[RegisterComponent]
/// <summary>
/// Shrimply a tracking component for pods that are cloning.
/// </summary>
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,
/// which one has an advantage in a situation. The advantage is expressed by a multiplier.
/// 1 = No advantage to either party.
/// >1 = Advantage to roller
/// <1 = Advantage to target
/// &gt;1 = Advantage to roller
/// &lt;1 = Advantage to target
/// Roller should be the entity with an advantage from being bigger/healthier/more skilled, etc.
/// </summary>
///
@@ -39,7 +39,7 @@ namespace Content.Server.Contests
/// After that, it runs the % towards crit through a converter that smooths out and makes
/// the the ratios less severe.
/// 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)
{
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.
/// 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.
/// <summary>
/// </summary>
public float StaminaContest(EntityUid roller, EntityUid target, StaminaComponent? rollerStamina = null, StaminaComponent? targetStamina = null)
{
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.
/// 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.
/// <summary>
/// </summary>
public float OverallStrengthContest(EntityUid roller, EntityUid target, float damageWeight = 1f, float massWeight = 1f, float stamWeight = 1f)
{
var weightTotal = damageWeight + massWeight + stamWeight;

View File

@@ -82,7 +82,6 @@ namespace Content.Server.Cuffs.Components
/// <summary>
/// Add a set of cuffs to an existing CuffedComponent.
/// </summary>
/// <param name="prototype"></param>
public bool TryAddNewCuffs(EntityUid user, EntityUid 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"));
}
return;
}
//Lord forgive me for putting this here

View File

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

View File

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

View File

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

View File

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

View File

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

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