]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup warnings: CS0067, CS8509, CS8073 (#39770)
authorB_Kirill <153602297+B-Kirill@users.noreply.github.com>
Tue, 23 Sep 2025 03:11:29 +0000 (13:11 +1000)
committerGitHub <noreply@github.com>
Tue, 23 Sep 2025 03:11:29 +0000 (15:11 +1200)
* Cleanup

* Bonus

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
Content.Client/Actions/ActionsSystem.cs
Content.Client/UserInterface/Controls/MainViewport.cs
Content.Shared/Actions/SharedActionsSystem.cs
Content.Shared/Clothing/MagbootsSystem.cs
Content.Shared/Throwing/ThrowingSystem.cs

index 8efe0b2367f8d32feb2b789da7bb00de9de6fc9e..49d90dedaf5eaf34a8f158c93f004390d50c17e5 100644 (file)
@@ -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<EntityUid>? OnActionAdded;
         public event Action<EntityUid>? OnActionRemoved;
@@ -286,8 +287,27 @@ namespace Content.Client.Actions
                     continue;
                 }
 
+                if (assignmentNode is SequenceDataNode sequenceAssignments)
+                {
+                    try
+                    {
+                        var nodeAssignments = _serialization.Read<List<(byte Hotbar, byte Slot)>>(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<WorldTargetActionComponent> 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<EntityTargetActionComponent>(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)
index 0e947da7cf8bfdd85f77ea2f43f069148f7437b5..5fed4379cff98fc2c7d240b60eee275bfb26e5b1 100644 (file)
@@ -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;
 
index a8201cbede14c93baa8dcefafc51de648fc86d8e..a2a17825530c9eb0e185f5f6c6225fcadcc7a9de 100644 (file)
@@ -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;
index d00211fa656073785fda06a1de9e67b74c1f3395..225ba3655f966756c059addbf17df32559a805ca 100644 (file)
@@ -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!;
index db68c3517cee380fc4377cfbf3c20830eb06f210..6b121baf58a697517be05e5d5649776bcefec947 100644 (file)
@@ -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!;