From fd40888b0e9e9c6529afd82330c9026f6f476c75 Mon Sep 17 00:00:00 2001 From: B_Kirill <153602297+B-Kirill@users.noreply.github.com> Date: Tue, 23 Sep 2025 13:11:29 +1000 Subject: [PATCH] Cleanup warnings: CS0067, CS8509, CS8073 (#39770) * Cleanup * Bonus --------- Co-authored-by: ElectroJr --- Content.Client/Actions/ActionsSystem.cs | 26 ++++++++++++++++--- .../UserInterface/Controls/MainViewport.cs | 3 ++- Content.Shared/Actions/SharedActionsSystem.cs | 2 +- Content.Shared/Clothing/MagbootsSystem.cs | 1 - Content.Shared/Throwing/ThrowingSystem.cs | 2 -- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 8efe0b2367..49d90dedaf 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -33,6 +33,7 @@ namespace Content.Client.Actions [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly IResourceManager _resources = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; + [Dependency] private readonly ISerializationManager _serialization = default!; public event Action? OnActionAdded; public event Action? OnActionRemoved; @@ -286,8 +287,27 @@ namespace Content.Client.Actions continue; } + if (assignmentNode is SequenceDataNode sequenceAssignments) + { + try + { + var nodeAssignments = _serialization.Read>(sequenceAssignments, notNullableOverride: true); + + foreach (var index in nodeAssignments) + { + assignments.Add(new SlotAssignment(index.Hotbar, index.Slot, actionId)); + } + } + catch (Exception ex) + { + Log.Error($"Failed to parse action assignments: {ex}"); + } + } + AddActionDirect((user, actions), actionId); } + + AssignSlot?.Invoke(assignments); } private void OnWorldTargetAttempt(Entity ent, ref ActionTargetAttemptEvent args) @@ -309,10 +329,10 @@ namespace Content.Client.Actions // this is the actual entity-world targeting magic EntityUid? targetEnt = null; if (TryComp(ent, out var entity) && - args.Input.EntityUid != null && - ValidateEntityTarget(user, args.Input.EntityUid, (uid, entity))) + args.Input.EntityUid is { Valid: true } entityUid && + ValidateEntityTarget(user, entityUid, (uid, entity))) { - targetEnt = args.Input.EntityUid; + targetEnt = entityUid; } if (action.ClientExclusive) diff --git a/Content.Client/UserInterface/Controls/MainViewport.cs b/Content.Client/UserInterface/Controls/MainViewport.cs index 0e947da7cf..5fed4379cf 100644 --- a/Content.Client/UserInterface/Controls/MainViewport.cs +++ b/Content.Client/UserInterface/Controls/MainViewport.cs @@ -66,7 +66,8 @@ namespace Content.Client.UserInterface.Controls Viewport.StretchMode = filterMode switch { "nearest" => ScalingViewportStretchMode.Nearest, - "bilinear" => ScalingViewportStretchMode.Bilinear + "bilinear" => ScalingViewportStretchMode.Bilinear, + _ => ScalingViewportStretchMode.Nearest }; Viewport.IgnoreDimension = verticalFit ? ScalingViewportIgnoreDimension.Horizontal : ScalingViewportIgnoreDimension.None; diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index a8201cbede..a2a1782553 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -840,7 +840,7 @@ public abstract partial class SharedActionsSystem : EntitySystem if (!_actionsQuery.Resolve(performer, ref performer.Comp, false)) { - DebugTools.Assert(performer == null || TerminatingOrDeleted(performer)); + DebugTools.Assert(TerminatingOrDeleted(performer)); ent.Comp.AttachedEntity = null; // TODO: should this delete the action since it's now orphaned? return; diff --git a/Content.Shared/Clothing/MagbootsSystem.cs b/Content.Shared/Clothing/MagbootsSystem.cs index d00211fa65..225ba3655f 100644 --- a/Content.Shared/Clothing/MagbootsSystem.cs +++ b/Content.Shared/Clothing/MagbootsSystem.cs @@ -14,7 +14,6 @@ namespace Content.Shared.Clothing; public sealed class SharedMagbootsSystem : EntitySystem { [Dependency] private readonly AlertsSystem _alerts = default!; - [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly ItemToggleSystem _toggle = default!; [Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly SharedGravitySystem _gravity = default!; diff --git a/Content.Shared/Throwing/ThrowingSystem.cs b/Content.Shared/Throwing/ThrowingSystem.cs index db68c3517c..6b121baf58 100644 --- a/Content.Shared/Throwing/ThrowingSystem.cs +++ b/Content.Shared/Throwing/ThrowingSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.CCVar; using Content.Shared.Construction.Components; using Content.Shared.Database; using Content.Shared.Friction; -using Content.Shared.Gravity; using Content.Shared.Projectiles; using Robust.Shared.Configuration; using Robust.Shared.Map; @@ -30,7 +29,6 @@ public sealed class ThrowingSystem : EntitySystem private float _airDamping; [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly SharedGravitySystem _gravity = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ThrownItemSystem _thrownSystem = default!;