Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 39 non-obsolete warnings #33794

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Content.Client/DoAfter/DoAfterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public override void Shutdown()
_overlay.RemoveOverlay<DoAfterOverlay>();
}

#pragma warning disable RA0028 // No base call in overriden function
public override void Update(float frameTime)
#pragma warning restore RA0028 // No base call in overriden function
{
// Currently this only predicts do afters initiated by the player.

Expand Down
2 changes: 2 additions & 0 deletions Content.Client/GameTicking/Managers/ClientGameTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public sealed class ClientGameTicker : SharedGameTicker

public override void Initialize()
{
base.Initialize();
SpaceManiac marked this conversation as resolved.
Show resolved Hide resolved

SubscribeNetworkEvent<TickerJoinLobbyEvent>(JoinLobby);
SubscribeNetworkEvent<TickerJoinGameEvent>(JoinGame);
SubscribeNetworkEvent<TickerConnectionStatusEvent>(ConnectionStatus);
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Shared.Instruments.UI;
using Content.Shared.Interaction;
using Robust.Client.Audio.Midi;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface;

Expand All @@ -13,7 +12,6 @@ public sealed class InstrumentBoundUserInterface : BoundUserInterface
public IEntityManager Entities => EntMan;
[Dependency] public readonly IMidiManager MidiManager = default!;
[Dependency] public readonly IFileDialogManager FileDialogManager = default!;
[Dependency] public readonly IPlayerManager PlayerManager = default!;
[Dependency] public readonly ILocalizationManager Loc = default!;

public readonly InstrumentSystem Instruments;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
[UISystemDependency] private readonly StationSpawningSystem _spawn = default!;
[UISystemDependency] private readonly GuidebookSystem _guide = default!;
[UISystemDependency] private readonly LoadoutSystem _loadouts = default!;

private CharacterSetupGui? _characterSetup;
private HumanoidProfileEditor? _profileEditor;
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace Content.Client.Pinpointer.UI;
[GenerateTypedNameReferences]
public sealed partial class StationMapBeaconControl : Control, IComparable<StationMapBeaconControl>
{
[Dependency] private readonly IEntityManager _entMan = default!;

public readonly EntityCoordinates BeaconPosition;
public Action<EntityCoordinates>? OnPressed;
public string? Label => BeaconNameLabel.Text;
Expand Down
10 changes: 7 additions & 3 deletions Content.Client/Power/Visualizers/CableVisualizerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

namespace Content.Client.Power.Visualizers;

public sealed class CableVisualizerSystem : VisualizerSystem<CableVisualizerComponent>
public sealed class CableVisualizerSystem : EntitySystem
{
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<CableVisualizerComponent, AppearanceChangeEvent>(OnAppearanceChange, after: new[] { typeof(SubFloorHideSystem) });
}

protected override void OnAppearanceChange(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args)
private void OnAppearanceChange(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
Expand All @@ -23,7 +27,7 @@ protected override void OnAppearanceChange(EntityUid uid, CableVisualizerCompone
return;
}

if (!AppearanceSystem.TryGetData<WireVisDirFlags>(uid, WireVisVisuals.ConnectedMask, out var mask, args.Component))
if (!_appearanceSystem.TryGetData<WireVisDirFlags>(uid, WireVisVisuals.ConnectedMask, out var mask, args.Component))
mask = WireVisDirFlags.None;

args.Sprite.LayerSetState(0, $"{component.StatePrefix}{(int) mask}");
Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Shuttles/UI/DockObject.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
using System.Text;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Systems;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map;

namespace Content.Client.Shuttles.UI;

[GenerateTypedNameReferences]
public sealed partial class DockObject : PanelContainer
{
[PublicAPI]
public event Action? UndockPressed;

[PublicAPI]
public event Action? ViewPressed;

public BoxContainer ContentsContainer => Contents;

public DockObject()
Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Shuttles/UI/DockingScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,6 @@ private void BuildDocks(EntityUid? shuttle)
}

dockContainer.AddDock(dock, DockingControl);

dockContainer.ViewPressed += () =>
{
OnDockPress(dock);
};

dockContainer.UndockPressed += () =>
{
UndockRequest?.Invoke(dock.Entity);
};
}
}

Expand Down
25 changes: 17 additions & 8 deletions Content.Client/Sprite/ContentSpriteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
using System.Threading;
using System.Threading.Tasks;
using Content.Client.Administration.Managers;
using Content.Shared.Database;
using Content.Shared.Verbs;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Shared.ContentPack;
using Robust.Shared.Exceptions;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using SixLabors.ImageSharp;
Expand All @@ -24,6 +24,7 @@ public sealed class ContentSpriteSystem : EntitySystem
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IResourceManager _resManager = default!;
[Dependency] private readonly IUserInterfaceManager _ui = default!;
[Dependency] private readonly IRuntimeLog _runtimeLog = default!;

private ContentSpriteControl _control = new();

Expand All @@ -42,12 +43,12 @@ public override void Shutdown()
{
base.Shutdown();

foreach (var queued in _control._queuedTextures)
foreach (var queued in _control.QueuedTextures)
{
queued.Tcs.SetCanceled();
}

_control._queuedTextures.Clear();
_control.QueuedTextures.Clear();

_ui.RootControl.RemoveChild(_control);
}
Expand Down Expand Up @@ -103,7 +104,7 @@ public async Task Export(EntityUid entity, Direction direction, bool includeId =
var texture = _clyde.CreateRenderTarget(new Vector2i(size.X, size.Y), new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "export");
var tcs = new TaskCompletionSource(cancelToken);

_control._queuedTextures.Enqueue((texture, direction, entity, includeId, tcs));
_control.QueuedTextures.Enqueue((texture, direction, entity, includeId, tcs));

await tcs.Task;
}
Expand All @@ -113,13 +114,21 @@ private void GetVerbs(GetVerbsEvent<Verb> ev)
if (!_adminManager.IsAdmin())
return;

var target = ev.Target;
Verb verb = new()
{
Text = Loc.GetString("export-entity-verb-get-data-text"),
Category = VerbCategory.Debug,
Act = () =>
Act = async () =>
{
Export(ev.Target);
try
{
await Export(target);
}
catch (Exception e)
{
_runtimeLog.LogException(e, $"{nameof(ContentSpriteSystem)}.{nameof(Export)}");
}
},
};

Expand All @@ -141,7 +150,7 @@ private sealed class ContentSpriteControl : Control
Direction Direction,
EntityUid Entity,
bool IncludeId,
TaskCompletionSource Tcs)> _queuedTextures = new();
TaskCompletionSource Tcs)> QueuedTextures = new();

private ISawmill _sawmill;

Expand All @@ -155,7 +164,7 @@ protected override void Draw(DrawingHandleScreen handle)
{
base.Draw(handle);

while (_queuedTextures.TryDequeue(out var queued))
while (QueuedTextures.TryDequeue(out var queued))
{
if (queued.Tcs.Task.IsCanceled)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

Expand Down Expand Up @@ -96,7 +95,6 @@ public FancyTree()
private void LoadIcons()
{
IconColor = TryGetStyleProperty(StylePropertyIconColor, out Color color) ? color : Color.White;
string? path;

if (!TryGetStyleProperty(StylePropertyIconExpanded, out IconExpanded))
IconExpanded = _resCache.GetTexture(DefaultIconExpanded);
Expand Down
4 changes: 0 additions & 4 deletions Content.Client/Voting/VotingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using Content.Client.Ghost;
using Content.Shared.Voting;

namespace Content.Client.Voting;

public sealed class VotingSystem : EntitySystem
{

public event Action<VotePlayerListResponseEvent>? VotePlayerListResponse; //Provides a list of players elligble for vote actions

[Dependency] private readonly GhostSystem _ghostSystem = default!;

public override void Initialize()
{
base.Initialize();
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Content.Server.Jittering;
using Content.Server.Mind;
using Content.Server.Stunnable;
using Content.Shared.Actions;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects;
Expand All @@ -24,8 +23,6 @@ public sealed class InnerBodyAnomalySystem : SharedInnerBodyAnomalySystem
{
[Dependency] private readonly IAdminLogManager _adminLog = default!;
[Dependency] private readonly AnomalySystem _anomaly = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly BodySystem _body = default!;
[Dependency] private readonly IChatManager _chat = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
using Content.Shared.Atmos.Monitor.Components;
using Content.Shared.DeviceNetwork.Components;
using Content.Shared.Pinpointer;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
using Robust.Shared.Map.Components;
using Robust.Shared.Timing;
using System.Diagnostics.CodeAnalysis;
using System.Linq;

Expand All @@ -25,11 +23,9 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
[Dependency] private readonly AirAlarmSystem _airAlarmSystem = default!;
[Dependency] private readonly AtmosDeviceNetworkSystem _atmosDevNet = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly NavMapSystem _navMapSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly DeviceListSystem _deviceListSystem = default!;

private const float UpdateTime = 1.0f;
Expand All @@ -54,7 +50,7 @@ public override void Initialize()
SubscribeLocalEvent<AtmosAlertsDeviceComponent, AnchorStateChangedEvent>(OnDeviceAnchorChanged);
}

#region Event handling
#region Event handling

private void OnConsoleInit(EntityUid uid, AtmosAlertsComputerComponent component, ComponentInit args)
{
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Botany/Systems/BotanySystem.Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Content.Shared.Random.Helpers;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using System.Diagnostics.CodeAnalysis;
Expand All @@ -25,10 +24,8 @@ public sealed partial class BotanySystem : EntitySystem
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly RandomHelperSystem _randomHelper = default!;

public override void Initialize()
Expand Down
4 changes: 0 additions & 4 deletions Content.Server/Chemistry/EntitySystems/HypospraySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
using Content.Shared.Mobs.Components;
using Content.Shared.Timing;
using Content.Shared.Weapons.Melee.Events;
using Content.Server.Interaction;
using Content.Server.Body.Components;
using Robust.Shared.GameStates;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Robust.Server.Audio;

Expand All @@ -24,7 +21,6 @@ namespace Content.Server.Chemistry.EntitySystems;
public sealed class HypospraySystem : SharedHypospraySystem
{
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly InteractionSystem _interaction = default!;

public override void Initialize()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Events;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Collections;
using Robust.Shared.Timing;

namespace Content.Server.Chemistry.EntitySystems;
Expand All @@ -19,16 +11,11 @@ namespace Content.Server.Chemistry.EntitySystems;
public sealed class SolutionInjectWhileEmbeddedSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TagSystem _tag = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SolutionInjectWhileEmbeddedComponent, MapInitEvent>(OnMapInit);
}

Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Discord/WebhookMessages/VoteWebhooks.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
using Content.Server.GameTicking;
using Content.Server.Voting;
using Robust.Server;
using Robust.Shared.Configuration;
using Robust.Shared.Utility;
using System.Diagnostics;
using System.Text.Json;
using System.Text.Json.Nodes;

namespace Content.Server.Discord.WebhookMessages;

public sealed class VoteWebhooks : IPostInjectInit
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IEntitySystemManager _entSys = default!;
[Dependency] private readonly DiscordWebhook _discord = default!;
[Dependency] private readonly IBaseServer _baseServer = default!;
Expand Down
Loading
Loading