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
@@ -33,7 +33,6 @@ namespace Content.Client.Examine
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly VerbSystem _verbSystem = default!;
|
||||
[Dependency] private readonly IBaseClient _client = default!;
|
||||
|
||||
public const string StyleClassEntityTooltip = "entity-tooltip";
|
||||
|
||||
@@ -66,12 +65,10 @@ namespace Content.Client.Examine
|
||||
{
|
||||
if (!args.User.Valid)
|
||||
return;
|
||||
if (_playerManager.LocalPlayer == null)
|
||||
return;
|
||||
if (_examineTooltipOpen == null)
|
||||
return;
|
||||
|
||||
if (item == _examinedEntity && args.User == _playerManager.LocalPlayer.ControlledEntity)
|
||||
if (item == _examinedEntity && args.User == _playerManager.LocalEntity)
|
||||
CloseTooltip();
|
||||
}
|
||||
|
||||
@@ -118,7 +115,7 @@ namespace Content.Client.Examine
|
||||
return false;
|
||||
}
|
||||
|
||||
_playerEntity = _playerManager.LocalPlayer?.ControlledEntity ?? default;
|
||||
_playerEntity = _playerManager.LocalEntity ?? default;
|
||||
|
||||
if (_playerEntity == default || !CanExamine(_playerEntity, entity))
|
||||
{
|
||||
@@ -149,7 +146,7 @@ namespace Content.Client.Examine
|
||||
|
||||
private void OnExamineInfoResponse(ExamineSystemMessages.ExamineInfoResponseMessage ev)
|
||||
{
|
||||
var player = _playerManager.LocalPlayer?.ControlledEntity;
|
||||
var player = _playerManager.LocalEntity;
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
@@ -356,7 +353,7 @@ namespace Content.Client.Examine
|
||||
|
||||
public void DoExamine(EntityUid entity, bool centeredOnCursor = true, EntityUid? userOverride = null)
|
||||
{
|
||||
var playerEnt = userOverride ?? _playerManager.LocalPlayer?.ControlledEntity;
|
||||
var playerEnt = userOverride ?? _playerManager.LocalEntity;
|
||||
if (playerEnt == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user