Random spontaneous cleanup PR (#25131)
* Use new Subs.CVar helper Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe. This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown. * Fix a bunch of warnings * More warning fixes * Use new DateTime serializer to get rid of ISerializationHooks in changelog code. * Get rid of some more ISerializationHooks for enums * And a little more * Apply suggestions from code review Co-authored-by: 0x6273 <0x40@keemail.me> --------- Co-authored-by: 0x6273 <0x40@keemail.me>
This commit is contained in:
committed by
GitHub
parent
d0c174388c
commit
68ce53ae17
@@ -101,7 +101,7 @@ namespace Content.Client.Actions
|
||||
component.ItemIconStyle = state.ItemIconStyle;
|
||||
component.Sound = state.Sound;
|
||||
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity == component.AttachedEntity)
|
||||
if (_playerManager.LocalEntity == component.AttachedEntity)
|
||||
ActionsUpdated?.Invoke();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Content.Client.Actions
|
||||
return;
|
||||
|
||||
base.UpdateAction(actionId, action);
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity)
|
||||
if (_playerManager.LocalEntity != action.AttachedEntity)
|
||||
return;
|
||||
|
||||
ActionsUpdated?.Invoke();
|
||||
@@ -144,7 +144,7 @@ namespace Content.Client.Actions
|
||||
_added.Add((actionId, action));
|
||||
}
|
||||
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity != uid)
|
||||
if (_playerManager.LocalEntity != uid)
|
||||
return;
|
||||
|
||||
foreach (var action in _removed)
|
||||
@@ -177,7 +177,7 @@ namespace Content.Client.Actions
|
||||
protected override void ActionAdded(EntityUid performer, EntityUid actionId, ActionsComponent comp,
|
||||
BaseActionComponent action)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
|
||||
if (_playerManager.LocalEntity != performer)
|
||||
return;
|
||||
|
||||
OnActionAdded?.Invoke(actionId);
|
||||
@@ -185,7 +185,7 @@ namespace Content.Client.Actions
|
||||
|
||||
protected override void ActionRemoved(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
|
||||
if (_playerManager.LocalEntity != performer)
|
||||
return;
|
||||
|
||||
OnActionRemoved?.Invoke(actionId);
|
||||
@@ -193,7 +193,7 @@ namespace Content.Client.Actions
|
||||
|
||||
public IEnumerable<(EntityUid Id, BaseActionComponent Comp)> GetClientActions()
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
|
||||
if (_playerManager.LocalEntity is not { } user)
|
||||
return Enumerable.Empty<(EntityUid, BaseActionComponent)>();
|
||||
|
||||
return GetActions(user);
|
||||
@@ -216,7 +216,7 @@ namespace Content.Client.Actions
|
||||
|
||||
public void LinkAllActions(ActionsComponent? actions = null)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
|
||||
if (_playerManager.LocalEntity is not { } user ||
|
||||
!Resolve(user, ref actions, false))
|
||||
{
|
||||
return;
|
||||
@@ -233,7 +233,7 @@ namespace Content.Client.Actions
|
||||
|
||||
public void TriggerAction(EntityUid actionId, BaseActionComponent action)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
|
||||
if (_playerManager.LocalEntity is not { } user ||
|
||||
!TryComp(user, out ActionsComponent? actions))
|
||||
{
|
||||
return;
|
||||
@@ -261,7 +261,7 @@ namespace Content.Client.Actions
|
||||
/// </summary>
|
||||
public void LoadActionAssignments(string path, bool userData)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
|
||||
if (_playerManager.LocalEntity is not { } user)
|
||||
return;
|
||||
|
||||
var file = new ResPath(path).ToRootedPath();
|
||||
|
||||
Reference in New Issue
Block a user