From 754960df2e69e3f938d2f9ab85d491946cf355b7 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Thu, 13 Oct 2022 20:10:47 +0200 Subject: [PATCH] Fix actions bar and window not updating (#11899) --- .../Systems/Actions/ActionUIController.cs | 133 ++++++++++++++---- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs b/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs index b0fa714ce6..52b6c64b36 100644 --- a/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs +++ b/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs @@ -39,9 +39,9 @@ public sealed class ActionUIController : UIController, IOnStateChanged action.Enabled, - Filters.Item => action.Provider != null && action.Provider != _actionsSystem.PlayerActions?.Owner, - Filters.Innate => action.Provider == null || action.Provider == _actionsSystem.PlayerActions?.Owner, + Filters.Item => action.Provider != null && action.Provider != _actionsSystem?.PlayerActions?.Owner, + Filters.Innate => action.Provider == null || action.Provider == _actionsSystem?.PlayerActions?.Owner, Filters.Instant => action is InstantAction, Filters.Targeted => action is TargetedAction, _ => throw new ArgumentOutOfRangeException(nameof(filter), filter, null) @@ -326,7 +409,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged? actions = _actionsSystem.PlayerActions?.Actions; + IEnumerable? actions = _actionsSystem?.PlayerActions?.Actions; actions ??= Array.Empty(); if (filters.Count == 0 && string.IsNullOrWhiteSpace(search)) @@ -346,7 +429,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged(action.Provider.Value).EntityName; @@ -477,7 +560,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged @@ -701,8 +784,8 @@ public sealed class ActionUIController : UIController, IOnStateChanged(out var handOverlay) || handOverlay == null) return;