Merge pull request #764 from space-syndicate/upstream-sync

Upstream sync
This commit is contained in:
Morb
2023-01-22 04:11:43 +03:00
committed by GitHub
639 changed files with 58947 additions and 51162 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

@@ -1,10 +1,12 @@
using System.Text;
using System.Linq;
using System.Text;
using System.Threading;
using Content.Client.Administration.Managers;
using Content.Client.Administration.UI.CustomControls;
using Content.Client.Administration.UI.Tabs.AdminTab;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Bwoink;
using Content.Client.UserInterface.Systems.Chat.Controls;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
@@ -106,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 += _ =>
@@ -171,13 +173,23 @@ namespace Content.Client.Administration.UI.Bwoink
ChannelSelector.PopulateList();
}
public void SelectChannel(NetUserId channel)
{
if (!ChannelSelector.PlayerInfo.TryFirstOrDefault(
i => i.SessionId == channel, out var info))
return;
// clear filter if we're trying to select a channel for a player that isn't currently filtered
// i.e. through the message verb.
var data = new PlayerListData(info);
if (!ChannelSelector.PlayerListContainer.Data.Contains(data))
{
ChannelSelector.StopFiltering();
}
ChannelSelector.PopulateList();
ChannelSelector.PlayerListContainer.Select(new PlayerListData(info));
ChannelSelector.PlayerListContainer.Select(data);
}
private void FixButtons()

View File

@@ -62,6 +62,11 @@ namespace Content.Client.Administration.UI.CustomControls
}
}
public void StopFiltering()
{
FilterLineEdit.Text = string.Empty;
}
private void FilterList()
{
_sortedPlayerList.Clear();

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

@@ -5,9 +5,9 @@
MinSize="50 50">
<GridContainer
Columns="4" >
<cc:CommandButton Command="restart" Text="{Loc server-reboot}" />
<cc:CommandButton Command="shutdown" Text="{Loc server-shutdown}" />
<cc:CommandButton Name="SetOocButton" Command="setooc" Text="{Loc server-ooc-toggle}" ToggleMode="True" />
<cc:CommandButton Name="SetLoocButton" Command="setlooc" Text="{Loc server-looc-toggle}" ToggleMode="True" />
<cc:CommandButton Name="SetPanicbunkerButton" Command="panicbunker" Text="{Loc server-panicbunker-toggle}" ToggleMode="True" />
</GridContainer>
</Control>

View File

@@ -18,6 +18,7 @@ namespace Content.Client.Administration.UI.Tabs
_config.OnValueChanged(CCVars.OocEnabled, OocEnabledChanged, true);
_config.OnValueChanged(CCVars.LoocEnabled, LoocEnabledChanged, true);
_config.OnValueChanged(CCVars.PanicBunkerEnabled, BunkerEnabledChanged, true);
}
private void OocEnabledChanged(bool value)
@@ -30,6 +31,11 @@ namespace Content.Client.Administration.UI.Tabs
SetLoocButton.Pressed = value;
}
private void BunkerEnabledChanged(bool value)
{
SetPanicbunkerButton.Pressed = value;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
@@ -38,6 +44,7 @@ namespace Content.Client.Administration.UI.Tabs
{
_config.UnsubValueChanged(CCVars.OocEnabled, OocEnabledChanged);
_config.UnsubValueChanged(CCVars.LoocEnabled, LoocEnabledChanged);
_config.UnsubValueChanged(CCVars.PanicBunkerEnabled, BunkerEnabledChanged);
}
}
}

View File

@@ -25,7 +25,7 @@ public sealed class AnomalySystem : SharedAnomalySystem
if (!Appearance.TryGetData(uid, AnomalyVisuals.IsPulsing, out bool pulsing, args.Component))
pulsing = false;
if (Appearance.TryGetData(uid, AnomalyVisuals.IsPulsing, out bool super, args.Component) && super)
if (Appearance.TryGetData(uid, AnomalyVisuals.Supercritical, out bool super, args.Component) && super)
pulsing = super;
if (HasComp<AnomalySupercriticalComponent>(uid))

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

@@ -109,11 +109,12 @@ namespace Content.Client.Body.UI
_bodyPartsList.Clear();
var bodySystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<SharedBodySystem>();
var factory = IoCManager.Resolve<IComponentFactory>();
var i = 0;
foreach (var part in bodySystem.GetBodyChildren(_currentEntity))
{
_bodyPartsList[i++] = part.Component.ParentSlot!;
BodyPartList.AddItem(Loc.GetString(part.Component.Name));
BodyPartList.AddItem(Loc.GetString(factory.GetComponentName(part.Component.GetType())));
}
}

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

@@ -260,6 +260,8 @@ namespace Content.Client.ContextMenu.UI
{
var subElement = new EntityMenuElement(entity);
subElement.SubMenu = new ContextMenuPopup(_context, subElement);
subElement.SubMenu.OnPopupOpen += () => _verb.OpenVerbMenu(group[0], popup: subElement.SubMenu);
subElement.SubMenu.OnPopupHide += subElement.SubMenu.MenuBody.DisposeAllChildren;
_context.AddElement(subMenu, subElement);
Elements.TryAdd(entity, subElement);
}

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

@@ -0,0 +1,21 @@
using Content.Shared.Dice;
using Robust.Client.GameObjects;
namespace Content.Client.Dice;
public sealed class DiceSystem : SharedDiceSystem
{
protected override void UpdateVisuals(EntityUid uid, DiceComponent? die = null)
{
if (!Resolve(uid, ref die) || !TryComp(uid, out SpriteComponent? sprite))
return;
// TODO maybe just move each diue to its own RSI?
var state = sprite.LayerGetState(0).Name;
if (state == null)
return;
var prefix = state.Substring(0, state.IndexOf('_'));
sprite.LayerSetState(0, $"{prefix}_{die.CurrentValue}");
}
}

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

@@ -0,0 +1,61 @@
using Content.Shared.Gravity;
using Robust.Client.GameObjects;
using Robust.Client.Animations;
using Robust.Shared.Animations;
namespace Content.Client.Gravity;
/// <inheritdoc/>
public sealed class FloatingVisualizerSystem : SharedFloatingVisualizerSystem
{
[Dependency] private readonly AnimationPlayerSystem AnimationSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<FloatingVisualsComponent, AnimationCompletedEvent>(OnAnimationCompleted);
}
/// <inheritdoc/>
public override void FloatAnimation(EntityUid uid, Vector2 offset, string animationKey, float animationTime, bool stop = false)
{
if (stop)
{
AnimationSystem.Stop(uid, animationKey);
return;
}
var animation = new Animation
{
// We multiply by the number of extra keyframes to make time for them
Length = TimeSpan.FromSeconds(animationTime*2),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Offset),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0f),
new AnimationTrackProperty.KeyFrame(offset, animationTime),
new AnimationTrackProperty.KeyFrame(Vector2.Zero, animationTime),
}
}
}
};
if (!AnimationSystem.HasRunningAnimation(uid, animationKey))
AnimationSystem.Play(uid, animation, animationKey);
}
private void OnAnimationCompleted(EntityUid uid, FloatingVisualsComponent component, AnimationCompletedEvent args)
{
if (args.Key != component.AnimationKey)
return;
FloatAnimation(uid, component.Offset, component.AnimationKey, component.AnimationTime, !component.CanFloat);
}
}

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

@@ -294,6 +294,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.Linq;
using Content.Client.UserInterface.Controls;
using Content.Shared.Medical.SuitSensor;
using Robust.Client.AutoGenerated;
@@ -38,7 +39,7 @@ namespace Content.Client.Medical.CrewMonitoring
// TODO make each row a xaml-control. Get rid of some of this c# control creation.
// add a row for each sensor
foreach (var sensor in stSensors)
foreach (var sensor in stSensors.OrderBy(a => a.Name))
{
// add users name and job
// format: UserName (Job)

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,22 @@
using Content.Shared.Pointing.Components;
namespace Content.Client.Pointing.Components
namespace Content.Client.Pointing.Components;
[RegisterComponent]
public sealed class PointingArrowComponent : SharedPointingArrowComponent
{
[RegisterComponent]
public sealed class PointingArrowComponent : SharedPointingArrowComponent {}
/// <summary>
/// How long it takes to go from the bottom of the animation to the top.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("animationTime")]
public readonly float AnimationTime = 0.5f;
/// <summary>
/// How far it goes in any direction.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("offset")]
public readonly Vector2 Offset = (0, 0.25f);
public readonly string AnimationKey = "pointingarrow";
}

View File

@@ -1,53 +1,17 @@
using Content.Client.Pointing.Components;
using Content.Client.Gravity;
using Content.Shared.Mobs.Systems;
using Content.Shared.Pointing;
using Content.Shared.Verbs;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Pointing;
public sealed class PointingSystem : SharedPointingSystem
{
[Dependency] private readonly AnimationPlayerSystem _player = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
private const string AnimationKey = "pointingarrow";
/// <summary>
/// How far it goes in any direction.
/// </summary>
private const float Offset = 0.25f;
/// <summary>
/// How long it takes to go from the bottom of the animation to the top.
/// </summary>
private const float UpTime = 0.5f;
/// <summary>
/// Starts at the bottom then goes up and comes back down. Seems to look nicer than starting in the middle.
/// </summary>
private static readonly Animation PointingAnimation = new Animation()
{
Length = TimeSpan.FromSeconds(2 * UpTime),
AnimationTracks =
{
new AnimationTrackComponentProperty()
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Offset),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0f),
new AnimationTrackProperty.KeyFrame(new Vector2(0f, Offset), UpTime),
new AnimationTrackProperty.KeyFrame(Vector2.Zero, UpTime),
}
}
}
};
[Dependency] private readonly FloatingVisualizerSystem _floatingSystem = default!;
public override void Initialize()
{
@@ -61,7 +25,7 @@ public sealed class PointingSystem : SharedPointingSystem
private void OnArrowAnimation(EntityUid uid, PointingArrowComponent component, AnimationCompletedEvent args)
{
_player.Play(uid, PointingAnimation, AnimationKey);
_floatingSystem.FloatAnimation(uid, component.Offset, component.AnimationKey, component.AnimationTime);
}
private void AddPointingVerb(GetVerbsEvent<Verb> args)
@@ -98,19 +62,19 @@ public sealed class PointingSystem : SharedPointingSystem
args.Verbs.Add(verb);
}
private void OnArrowStartup(EntityUid uid, PointingArrowComponent arrow, ComponentStartup args)
private void OnArrowStartup(EntityUid uid, PointingArrowComponent component, ComponentStartup args)
{
if (EntityManager.TryGetComponent(uid, out SpriteComponent? sprite))
if (TryComp<SpriteComponent>(uid, out var sprite))
{
sprite.DrawDepth = (int) DrawDepth.Overlays;
}
_player.Play(uid, PointingAnimation, AnimationKey);
_floatingSystem.FloatAnimation(uid, component.Offset, component.AnimationKey, component.AnimationTime);
}
private void OnRogueArrowStartup(EntityUid uid, RoguePointingArrowComponent arrow, ComponentStartup args)
{
if (EntityManager.TryGetComponent(uid, out SpriteComponent? sprite))
if (TryComp<SpriteComponent>(uid, out var sprite))
{
sprite.DrawDepth = (int) DrawDepth.Overlays;
sprite.NoRotation = false;

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

@@ -45,7 +45,6 @@ public sealed class RotationVisualizerSystem : VisualizerSystem<RotationVisualsC
{
AnimationSystem.Stop(animationComp, animationKey);
}
spriteComp.Rotation = rotation;
var animation = new Animation
{

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

@@ -1,4 +1,4 @@
using Content.Client.Alerts;
using Content.Client.Alerts;
using Content.Client.Gameplay;
using Content.Client.UserInterface.Systems.Alerts.Widgets;
using Content.Shared.Alert;
@@ -26,7 +26,17 @@ public sealed class AlertsUIController : UIController, IOnStateEntered<GameplayS
private void SystemOnSyncAlerts(object? sender, IReadOnlyDictionary<AlertKey, AlertState> e)
{
if (sender is ClientAlertsSystem system)
{
UI?.SyncControls(system, system.AlertOrder, e);
}
// The UI can change underneath us if the user switches between HUD layouts
// So ensure we're subscribed to the AlertPressed callback.
if (UI != null)
{
UI.AlertPressed -= OnAlertPressed; // Ensure we don't hook into the callback twice
UI.AlertPressed += OnAlertPressed;
}
}
public void OnSystemLoaded(ClientAlertsSystem system)

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

@@ -1,9 +1,11 @@
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.AME.Components;
using Content.Server.Power.Components;
using Content.Server.Hands.Components;
using Content.Server.Popups;
using Content.Server.Tools;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Robust.Shared.Map;
@@ -19,6 +21,7 @@ namespace Content.Server.AME
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ToolSystem _toolSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
private float _accumulatedFrameTime;
private const float UpdateCooldown = 10f;
@@ -104,6 +107,8 @@ namespace Content.Server.AME
var ent = EntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos));
_adminLogger.Add(LogType.Construction, LogImpact.Low, $"{ToPrettyString(args.User):player} unpacked {ToPrettyString(ent)} at {Transform(ent).Coordinates} from {ToPrettyString(uid)}");
SoundSystem.Play(component.UnwrapSound.GetSound(), Filter.Pvs(uid), uid);
EntityManager.QueueDeleteEntity(uid);

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

@@ -5,76 +5,36 @@ using Content.Shared.Wires;
namespace Content.Server.Access;
[DataDefinition]
public sealed class AccessWireAction : BaseWireAction
public sealed class AccessWireAction : ComponentWireAction<AccessReaderComponent>
{
[DataField("color")]
private Color _statusColor = Color.Green;
[DataField("name")]
private string _text = "ACC";
protected override string Text
{
get => _text;
set => _text = value;
}
public override Color Color { get; set; } = Color.Green;
public override string Name { get; set; } = "wire-name-access";
[DataField("pulseTimeout")]
private int _pulseTimeout = 30;
public override StatusLightData? GetStatusLightData(Wire wire)
{
StatusLightState lightState = StatusLightState.Off;
if (IsPowered(wire.Owner)
&& EntityManager.TryGetComponent<AccessReaderComponent>(wire.Owner, out var access))
{
if (access.Enabled)
{
lightState = StatusLightState.On;
}
}
return new StatusLightData(
_statusColor,
lightState,
_text);
}
public override StatusLightState? GetLightState(Wire wire, AccessReaderComponent comp)
=> comp.Enabled ? StatusLightState.On : StatusLightState.Off;
public override object StatusKey { get; } = AccessWireActionKey.Status;
public override bool Cut(EntityUid user, Wire wire)
public override bool Cut(EntityUid user, Wire wire, AccessReaderComponent comp)
{
base.Cut(user, wire);
if (EntityManager.TryGetComponent<AccessReaderComponent>(wire.Owner, out var access))
{
WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
access.Enabled = false;
}
WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
comp.Enabled = false;
return true;
}
public override bool Mend(EntityUid user, Wire wire)
public override bool Mend(EntityUid user, Wire wire, AccessReaderComponent comp)
{
base.Mend(user, wire);
if (EntityManager.TryGetComponent<AccessReaderComponent>(wire.Owner, out var access))
{
access.Enabled = true;
}
comp.Enabled = true;
return true;
}
public override bool Pulse(EntityUid user, Wire wire)
public override void Pulse(EntityUid user, Wire wire, AccessReaderComponent comp)
{
base.Pulse(user, wire);
if (EntityManager.TryGetComponent<AccessReaderComponent>(wire.Owner, out var access))
{
access.Enabled = false;
WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitPulseCancel, wire));
}
return true;
comp.Enabled = false;
WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitPulseCancel, wire));
}
public override void Update(Wire wire)

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

@@ -12,21 +12,30 @@ public sealed class PanicBunkerCommand : IConsoleCommand
public string Command => "panicbunker";
public string Description => "Enables or disables the panic bunker functionality.";
public string Help => "panicbunker <enabled>";
public string Help => "panicbunker";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
if (args.Length > 1)
{
shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
shell.WriteError(Loc.GetString("shell-need-between-arguments",("lower", 0), ("upper", 1)));
return;
}
if (!bool.TryParse(args[0], out var enabled))
var enabled = _cfg.GetCVar(CCVars.PanicBunkerEnabled);
if (args.Length == 0)
{
shell.WriteError(Loc.GetString("shell-invalid-bool"));
enabled = !enabled;
}
if (args.Length == 1 && !bool.TryParse(args[0], out enabled))
{
shell.WriteError(Loc.GetString("shell-argument-must-be-boolean"));
return;
}
_cfg.SetCVar(CCVars.PanicBunkerEnabled, enabled);
shell.WriteLine(Loc.GetString(enabled ? "panicbunker-command-enabled" : "panicbunker-command-disabled"));
}
}

View File

@@ -15,6 +15,7 @@ namespace Content.Server.Administration.Commands
var id = args.Length == 0 ? null : string.Join(" ", args);
var entityManager = IoCManager.Resolve<IEntityManager>();
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var fac = IoCManager.Resolve<IComponentFactory>();
EntityPrototype? prototype = null;
var checkPrototype = !string.IsNullOrEmpty(id);
@@ -40,7 +41,7 @@ namespace Content.Server.Administration.Commands
foreach (var component in entityManager.GetComponents(entity))
{
if (metaData.EntityPrototype.Components.ContainsKey(component.Name))
if (metaData.EntityPrototype.Components.ContainsKey(fac.GetComponentName(component.GetType())))
continue;
entityManager.RemoveComponent(entity, component);

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

@@ -2,6 +2,7 @@
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Anomaly;
using Content.Shared.CCVar;
using Content.Shared.Materials;
using Robust.Shared.Map.Components;
@@ -14,15 +15,6 @@ namespace Content.Server.Anomaly;
/// </summary>
public sealed partial class AnomalySystem
{
/// <summary>
/// A multiplier applied to the grid bounds
/// to make the likelihood of it spawning outside
/// of the main station less likely.
///
/// tl;dr anomalies only generate on the inner __% of the station.
/// </summary>
public const float GridBoundsMultiplier = 0.6f;
private void InitializeGenerator()
{
SubscribeLocalEvent<AnomalyGeneratorComponent, BoundUIOpenedEvent>(OnGeneratorBUIOpened);
@@ -82,7 +74,7 @@ public sealed partial class AnomalySystem
UpdateGeneratorUi(uid, component);
}
private void SpawnOnRandomGridLocation(EntityUid grid, string toSpawn)
public void SpawnOnRandomGridLocation(EntityUid grid, string toSpawn)
{
if (!TryComp<MapGridComponent>(grid, out var gridComp))
return;
@@ -90,16 +82,16 @@ public sealed partial class AnomalySystem
var xform = Transform(grid);
var targetCoords = xform.Coordinates;
var (gridPos, _, gridMatrix) = _transform.GetWorldPositionRotationMatrix(xform);
var gridBounds = gridMatrix.TransformBox(gridComp.LocalAABB);
var gridBounds = gridComp.LocalAABB;
gridBounds.Scale(_configuration.GetCVar(CCVars.AnomalyGenerationGridBoundsScale));
for (var i = 0; i < 25; i++)
{
var randomX = Random.Next((int) (gridBounds.Left * GridBoundsMultiplier), (int) (gridBounds.Right * GridBoundsMultiplier));
var randomY = Random.Next((int) (gridBounds.Bottom * GridBoundsMultiplier), (int) (gridBounds.Top * GridBoundsMultiplier));
var randomX = Random.Next((int) gridBounds.Left, (int) gridBounds.Right);
var randomY = Random.Next((int) gridBounds.Bottom, (int)gridBounds.Top);
var tile = new Vector2i(randomX - (int) gridPos.X, randomY - (int) gridPos.Y);
if (_atmosphere.IsTileSpace(grid, Transform(grid).MapUid, tile,
var tile = new Vector2i(randomX, randomY);
if (_atmosphere.IsTileSpace(grid, xform.MapUid, tile,
mapGridComp: gridComp) || _atmosphere.IsTileAirBlocked(grid, tile, mapGridComp: gridComp))
{
continue;

View File

@@ -95,7 +95,7 @@ public sealed partial class AnomalySystem
component.TokenSource = null;
Audio.PlayPvs(component.CompleteSound, uid);
_popup.PopupEntity(Loc.GetString("anomaly-scanner-component-scan-complete"), uid);
Popup.PopupEntity(Loc.GetString("anomaly-scanner-component-scan-complete"), uid);
UpdateScannerWithNewAnomaly(uid, args.Anomaly, component);
if (TryComp<ActorComponent>(args.User, out var actor))

View File

@@ -21,6 +21,7 @@ public sealed partial class AnomalySystem
SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
SubscribeLocalEvent<AnomalyVesselComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
@@ -59,11 +60,16 @@ public sealed partial class AnomalySystem
component.PointMultiplier = MathF.Pow(component.PartRatingPointModifier, modifierRating);
}
private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier);
}
private void OnVesselInteractUsing(EntityUid uid, AnomalyVesselComponent component, InteractUsingEvent args)
{
if (component.Anomaly != null ||
!TryComp<AnomalyScannerComponent>(args.Used, out var scanner) ||
scanner.ScannedAnomaly is not {} anomaly)
scanner.ScannedAnomaly is not { } anomaly)
{
return;
}
@@ -74,7 +80,7 @@ public sealed partial class AnomalySystem
component.Anomaly = scanner.ScannedAnomaly;
anomalyComponent.ConnectedVessel = uid;
UpdateVesselAppearance(uid, component);
_popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid);
Popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid);
}
private void OnVesselGetPointsPerSecond(EntityUid uid, AnomalyVesselComponent component, ref ResearchServerGetPointsPerSecondEvent args)

View File

@@ -4,10 +4,10 @@ using Content.Server.Audio;
using Content.Server.DoAfter;
using Content.Server.Explosion.EntitySystems;
using Content.Server.Materials;
using Content.Server.Popups;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Events;
using Robust.Shared.Random;
namespace Content.Server.Anomaly;
@@ -17,12 +17,12 @@ namespace Content.Server.Anomaly;
/// </summary>
public sealed partial class AnomalySystem : SharedAnomalySystem
{
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly DoAfterSystem _doAfter = default!;
[Dependency] private readonly ExplosionSystem _explosion = default!;
[Dependency] private readonly MaterialStorageSystem _material = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
@@ -99,9 +99,9 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
var multiplier = 1f;
if (component.Stability > component.GrowthThreshold)
multiplier = 1.25f; //more points for unstable
multiplier = component.GrowingPointMultiplier; //more points for unstable
else if (component.Stability < component.DecayThreshold)
multiplier = 0.75f; //less points if it's dying
multiplier = component.DecayingPointMultiplier; //less points if it's dying
//penalty of up to 50% based on health
multiplier *= MathF.Pow(1.5f, component.Health) - 0.5f;

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

@@ -5,16 +5,11 @@ using Content.Shared.Wires;
namespace Content.Server.Arcade;
[DataDefinition]
public sealed class ArcadePlayerInvincibleWireAction : BaseToggleWireAction
{
private string _text = "MNGR";
protected override string Text
{
get => _text;
set => _text = value;
}
private Color _color = Color.Purple;
public override string Name { get; set; } = "wire-name-arcade-invincible";
public override Color Color { get; set; } = Color.Purple;
public override object? StatusKey { get; } = SharedSpaceVillainArcadeComponent.Indicators.HealthManager;
@@ -32,27 +27,24 @@ public sealed class ArcadePlayerInvincibleWireAction : BaseToggleWireAction
&& !arcade.PlayerInvincibilityFlag;
}
public override StatusLightData? GetStatusLightData(Wire wire)
public override StatusLightState? GetLightState(Wire wire)
{
var lightState = StatusLightState.Off;
if (IsPowered(wire.Owner) && EntityManager.TryGetComponent<SpaceVillainArcadeComponent>(wire.Owner, out var arcade))
if (EntityManager.TryGetComponent<SpaceVillainArcadeComponent>(wire.Owner, out var arcade))
{
lightState = arcade.PlayerInvincibilityFlag || arcade.EnemyInvincibilityFlag
return arcade.PlayerInvincibilityFlag || arcade.EnemyInvincibilityFlag
? StatusLightState.BlinkingSlow
: StatusLightState.On;
}
return new StatusLightData(
_color,
lightState,
_text);
return StatusLightState.Off;
}
}
[DataDefinition]
public sealed class ArcadeEnemyInvincibleWireAction : BaseToggleWireAction
{
public override string Name { get; set; } = "wire-name-player-invincible";
public override Color Color { get; set; } = Color.Purple;
public override object? StatusKey { get; } = null;
public override void ToggleValue(EntityUid owner, bool setting)

View File

@@ -5,17 +5,11 @@ using Content.Shared.Wires;
namespace Content.Server.Arcade;
[DataDefinition]
public sealed class ArcadeOverflowWireAction : BaseToggleWireAction
{
private Color _color = Color.Red;
private string _text = "LMTR";
protected override string Text
{
get => _text;
set => _text = value;
}
public override Color Color { get; set; } = Color.Red;
public override string Name { get; set; } = "wire-name-arcade-overflow";
public override object? StatusKey { get; } = SharedSpaceVillainArcadeComponent.Indicators.HealthLimiter;
public override void ToggleValue(EntityUid owner, bool setting)
@@ -32,20 +26,15 @@ public sealed class ArcadeOverflowWireAction : BaseToggleWireAction
&& !arcade.OverflowFlag;
}
public override StatusLightData? GetStatusLightData(Wire wire)
public override StatusLightState? GetLightState(Wire wire)
{
var lightState = StatusLightState.Off;
if (IsPowered(wire.Owner) && EntityManager.HasComponent<SpaceVillainArcadeComponent>(wire.Owner))
if (EntityManager.HasComponent<SpaceVillainArcadeComponent>(wire.Owner))
{
lightState = !GetValue(wire.Owner)
return !GetValue(wire.Owner)
? StatusLightState.BlinkingSlow
: StatusLightState.On;
}
return new StatusLightData(
_color,
lightState,
_text);
return StatusLightState.Off;
}
}

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

@@ -74,7 +74,7 @@ public sealed class FireAlarmSystem : EntitySystem
}
}
private void OnEmagged(EntityUid uid, FireAlarmComponent component, GotEmaggedEvent args)
private void OnEmagged(EntityUid uid, FireAlarmComponent component, ref GotEmaggedEvent args)
{
if (TryComp<AtmosAlarmableComponent>(uid, out var alarmable))
{

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