Un-revert IPlayerManager refactor (#21244)
This commit is contained in:
@@ -2,7 +2,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using Content.Shared.Actions;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.GameStates;
|
||||
@@ -41,8 +40,8 @@ namespace Content.Client.Actions
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ActionsComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<ActionsComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<ActionsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<ActionsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<ActionsComponent, ComponentHandleState>(HandleComponentState);
|
||||
|
||||
SubscribeLocalEvent<InstantActionComponent, ComponentHandleState>(OnInstantHandleState);
|
||||
@@ -196,12 +195,12 @@ namespace Content.Client.Actions
|
||||
return GetActions(user);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
LinkAllActions(component);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, ActionsComponent component, PlayerDetachedEvent? args = null)
|
||||
private void OnPlayerDetached(EntityUid uid, ActionsComponent component, LocalPlayerDetachedEvent? args = null)
|
||||
{
|
||||
UnlinkAllActions();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Client.Console;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Administration.Managers
|
||||
|
||||
@@ -5,7 +5,6 @@ using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Players;
|
||||
|
||||
namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Alert;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -22,8 +21,8 @@ public sealed class ClientAlertsSystem : AlertsSystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<AlertsComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<AlertsComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<AlertsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<AlertsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeLocalEvent<AlertsComponent, AfterAutoHandleStateEvent>(ClientAlertsHandleState);
|
||||
}
|
||||
@@ -69,7 +68,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
|
||||
SyncAlerts?.Invoke(this, component.Alerts);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, AlertsComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity != uid)
|
||||
return;
|
||||
@@ -87,7 +86,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
|
||||
ClearAlerts?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, AlertsComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, AlertsComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
ClearAlerts?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.CharacterInfo;
|
||||
using Content.Shared.Objectives;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
@@ -11,14 +10,11 @@ public sealed class CharacterInfoSystem : EntitySystem
|
||||
[Dependency] private readonly IPlayerManager _players = default!;
|
||||
|
||||
public event Action<CharacterData>? OnCharacterUpdate;
|
||||
public event Action? OnCharacterDetached;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PlayerAttachSysMessage>(OnPlayerAttached);
|
||||
|
||||
SubscribeNetworkEvent<CharacterInfoEvent>(OnCharacterInfoEvent);
|
||||
}
|
||||
|
||||
@@ -33,14 +29,6 @@ public sealed class CharacterInfoSystem : EntitySystem
|
||||
RaiseNetworkEvent(new RequestCharacterInfoEvent(GetNetEntity(entity.Value)));
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(PlayerAttachSysMessage msg)
|
||||
{
|
||||
if (msg.AttachedEntity == default)
|
||||
{
|
||||
OnCharacterDetached?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCharacterInfoEvent(CharacterInfoEvent msg, EntitySessionEventArgs args)
|
||||
{
|
||||
var entity = GetEntity(msg.NetEntity);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Content.Client.Construction
|
||||
base.Initialize();
|
||||
|
||||
UpdatesOutsidePrediction = true;
|
||||
SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
|
||||
SubscribeLocalEvent<LocalPlayerAttachedEvent>(HandlePlayerAttached);
|
||||
SubscribeNetworkEvent<AckStructureConstructionMessage>(HandleAckStructure);
|
||||
SubscribeNetworkEvent<ResponseConstructionGuide>(OnConstructionGuideReceived);
|
||||
|
||||
@@ -110,9 +110,9 @@ namespace Content.Client.Construction
|
||||
ClearGhost(msg.GhostId);
|
||||
}
|
||||
|
||||
private void HandlePlayerAttached(PlayerAttachSysMessage msg)
|
||||
private void HandlePlayerAttached(LocalPlayerAttachedEvent msg)
|
||||
{
|
||||
var available = IsCraftingAvailable(msg.AttachedEntity);
|
||||
var available = IsCraftingAvailable(msg.Entity);
|
||||
UpdateCraftingAvailability(available);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Shared.Drugs;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
|
||||
@@ -24,18 +23,18 @@ public sealed class DrugOverlaySystem : EntitySystem
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, ComponentShutdown>(OnShutdown);
|
||||
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<SeeingRainbowsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
_overlay = new();
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, SeeingRainbowsComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, SeeingRainbowsComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
_overlayMan.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, SeeingRainbowsComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, SeeingRainbowsComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
_overlay.Intoxication = 0;
|
||||
_overlayMan.RemoveOverlay(_overlay);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Shared.Drunk;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
|
||||
@@ -19,18 +18,18 @@ public sealed class DrunkSystem : SharedDrunkSystem
|
||||
SubscribeLocalEvent<DrunkComponent, ComponentInit>(OnDrunkInit);
|
||||
SubscribeLocalEvent<DrunkComponent, ComponentShutdown>(OnDrunkShutdown);
|
||||
|
||||
SubscribeLocalEvent<DrunkComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<DrunkComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<DrunkComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<DrunkComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
_overlay = new();
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, DrunkComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, DrunkComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
_overlayMan.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, DrunkComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, DrunkComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
_overlay.CurrentBoozePower = 0;
|
||||
_overlayMan.RemoveOverlay(_overlay);
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
|
||||
using Content.Shared.Eye.Blinding;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Events;
|
||||
using Content.Shared.Eye.Blinding.Components;
|
||||
using Content.Shared.GameTicking;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Client.Eye.Blinding;
|
||||
|
||||
@@ -31,20 +21,20 @@ public sealed class BlindingSystem : EntitySystem
|
||||
SubscribeLocalEvent<BlindableComponent, ComponentInit>(OnBlindInit);
|
||||
SubscribeLocalEvent<BlindableComponent, ComponentShutdown>(OnBlindShutdown);
|
||||
|
||||
SubscribeLocalEvent<BlindableComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<BlindableComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<BlindableComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<BlindableComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeNetworkEvent<RoundRestartCleanupEvent>(RoundRestartCleanup);
|
||||
|
||||
_overlay = new();
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, BlindableComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, BlindableComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
_overlayMan.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, BlindableComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, BlindableComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
_overlayMan.RemoveOverlay(_overlay);
|
||||
_lightManager.Enabled = true;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using Content.Shared.Eye.Blinding;
|
||||
using Content.Shared.Eye.Blinding.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Eye.Blinding;
|
||||
|
||||
@@ -20,18 +17,18 @@ public sealed class BlurryVisionSystem : EntitySystem
|
||||
SubscribeLocalEvent<BlurryVisionComponent, ComponentInit>(OnBlurryInit);
|
||||
SubscribeLocalEvent<BlurryVisionComponent, ComponentShutdown>(OnBlurryShutdown);
|
||||
|
||||
SubscribeLocalEvent<BlurryVisionComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<BlurryVisionComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<BlurryVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<BlurryVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
_overlay = new();
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, BlurryVisionComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, BlurryVisionComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
_overlayMan.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, BlurryVisionComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, BlurryVisionComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
_overlayMan.RemoveOverlay(_overlay);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public sealed class EyeLerpingSystem : EntitySystem
|
||||
SubscribeLocalEvent<EyeAttachedEvent>(OnAttached);
|
||||
|
||||
SubscribeLocalEvent<LerpingEyeComponent, EntParentChangedMessage>(HandleMapChange);
|
||||
SubscribeLocalEvent<LerpingEyeComponent, PlayerDetachedEvent>(OnDetached);
|
||||
SubscribeLocalEvent<LerpingEyeComponent, LocalPlayerDetachedEvent>(OnDetached);
|
||||
|
||||
UpdatesAfter.Add(typeof(TransformSystem));
|
||||
UpdatesAfter.Add(typeof(PhysicsSystem));
|
||||
@@ -94,7 +94,7 @@ public sealed class EyeLerpingSystem : EntitySystem
|
||||
AddEye(ev.Entity, ev.Component, true);
|
||||
}
|
||||
|
||||
private void OnDetached(EntityUid uid, LerpingEyeComponent component, PlayerDetachedEvent args)
|
||||
private void OnDetached(EntityUid uid, LerpingEyeComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
if (!component.ManuallyAdded)
|
||||
RemCompDeferred(uid, component);
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Client.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Fullscreen;
|
||||
public sealed class FullscreenHook
|
||||
|
||||
@@ -16,7 +16,7 @@ using Robust.Shared.Console;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Gameplay
|
||||
|
||||
@@ -58,10 +58,10 @@ namespace Content.Client.Ghost
|
||||
SubscribeLocalEvent<GhostComponent, ComponentRemove>(OnGhostRemove);
|
||||
SubscribeLocalEvent<GhostComponent, AfterAutoHandleStateEvent>(OnGhostState);
|
||||
|
||||
SubscribeLocalEvent<GhostComponent, PlayerAttachedEvent>(OnGhostPlayerAttach);
|
||||
SubscribeLocalEvent<GhostComponent, PlayerDetachedEvent>(OnGhostPlayerDetach);
|
||||
SubscribeLocalEvent<GhostComponent, LocalPlayerAttachedEvent>(OnGhostPlayerAttach);
|
||||
SubscribeLocalEvent<GhostComponent, LocalPlayerDetachedEvent>(OnGhostPlayerDetach);
|
||||
|
||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttach);
|
||||
SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttach);
|
||||
|
||||
SubscribeNetworkEvent<GhostWarpsResponseEvent>(OnGhostWarpsResponse);
|
||||
SubscribeNetworkEvent<GhostUpdateGhostRoleCountEvent>(OnUpdateGhostRoleCount);
|
||||
@@ -130,7 +130,7 @@ namespace Content.Client.Ghost
|
||||
PlayerRemoved?.Invoke(component);
|
||||
}
|
||||
|
||||
private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, PlayerAttachedEvent playerAttachedEvent)
|
||||
private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, LocalPlayerAttachedEvent localPlayerAttachedEvent)
|
||||
{
|
||||
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
|
||||
return;
|
||||
@@ -161,13 +161,13 @@ namespace Content.Client.Ghost
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnGhostPlayerDetach(EntityUid uid, GhostComponent component, PlayerDetachedEvent args)
|
||||
private void OnGhostPlayerDetach(EntityUid uid, GhostComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
if (PlayerDetach(uid))
|
||||
component.IsAttached = false;
|
||||
}
|
||||
|
||||
private void OnPlayerAttach(PlayerAttachedEvent ev)
|
||||
private void OnPlayerAttach(LocalPlayerAttachedEvent ev)
|
||||
{
|
||||
if (!HasComp<GhostComponent>(ev.Entity))
|
||||
PlayerDetach(ev.Entity);
|
||||
|
||||
@@ -42,8 +42,8 @@ namespace Content.Client.Hands.Systems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<HandsComponent, PlayerAttachedEvent>(HandlePlayerAttached);
|
||||
SubscribeLocalEvent<HandsComponent, PlayerDetachedEvent>(HandlePlayerDetached);
|
||||
SubscribeLocalEvent<HandsComponent, LocalPlayerAttachedEvent>(HandlePlayerAttached);
|
||||
SubscribeLocalEvent<HandsComponent, LocalPlayerDetachedEvent>(HandlePlayerDetached);
|
||||
SubscribeLocalEvent<HandsComponent, ComponentStartup>(OnHandsStartup);
|
||||
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
|
||||
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
|
||||
@@ -361,12 +361,12 @@ namespace Content.Client.Hands.Systems
|
||||
|
||||
#region Gui
|
||||
|
||||
private void HandlePlayerAttached(EntityUid uid, HandsComponent component, PlayerAttachedEvent args)
|
||||
private void HandlePlayerAttached(EntityUid uid, HandsComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
OnPlayerHandsAdded?.Invoke(component);
|
||||
}
|
||||
|
||||
private void HandlePlayerDetached(EntityUid uid, HandsComponent component, PlayerDetachedEvent args)
|
||||
private void HandlePlayerDetached(EntityUid uid, HandsComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
OnPlayerHandsRemoved?.Invoke();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ using Content.Shared.Damage;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
|
||||
namespace Content.Client.HealthOverlay
|
||||
{
|
||||
@@ -13,9 +13,9 @@ namespace Content.Client.HealthOverlay
|
||||
{
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
|
||||
private readonly Dictionary<EntityUid, HealthOverlayGui> _guis = new();
|
||||
private EntityUid? _attachedEntity;
|
||||
private bool _enabled;
|
||||
|
||||
public bool Enabled
|
||||
@@ -42,7 +42,6 @@ namespace Content.Client.HealthOverlay
|
||||
base.Initialize();
|
||||
|
||||
SubscribeNetworkEvent<RoundRestartCleanupEvent>(Reset);
|
||||
SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
|
||||
}
|
||||
|
||||
public void Reset(RoundRestartCleanupEvent ev)
|
||||
@@ -53,12 +52,6 @@ namespace Content.Client.HealthOverlay
|
||||
}
|
||||
|
||||
_guis.Clear();
|
||||
_attachedEntity = default;
|
||||
}
|
||||
|
||||
private void HandlePlayerAttached(PlayerAttachSysMessage message)
|
||||
{
|
||||
_attachedEntity = message.AttachedEntity;
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
@@ -70,7 +63,7 @@ namespace Content.Client.HealthOverlay
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attachedEntity is not {} ent || Deleted(ent))
|
||||
if (_player.LocalEntity is not {} ent || Deleted(ent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ using Content.Shared.Inventory;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Storage;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -43,8 +42,8 @@ namespace Content.Client.Inventory
|
||||
UpdatesOutsidePrediction = true;
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<InventorySlotsComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<InventorySlotsComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeLocalEvent<InventoryComponent, ComponentShutdown>(OnShutdown);
|
||||
|
||||
@@ -113,12 +112,12 @@ namespace Content.Client.Inventory
|
||||
OnUnlinkInventory?.Invoke();
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, InventorySlotsComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, InventorySlotsComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
OnUnlinkInventory?.Invoke();
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, InventorySlotsComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, InventorySlotsComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
if (TryGetSlots(uid, out var definitions))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
@@ -24,8 +23,8 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
|
||||
SubscribeLocalEvent<T, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<T, ComponentRemove>(OnRemove);
|
||||
|
||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeLocalEvent<T, GotEquippedEvent>(OnCompEquip);
|
||||
SubscribeLocalEvent<T, GotUnequippedEvent>(OnCompUnequip);
|
||||
@@ -65,12 +64,12 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
|
||||
RefreshOverlay(uid);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(LocalPlayerAttachedEvent args)
|
||||
{
|
||||
RefreshOverlay(args.Entity);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(LocalPlayerDetachedEvent args)
|
||||
{
|
||||
if (_player.LocalPlayer?.ControlledEntity == null)
|
||||
Deactivate();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Physics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Physics.Components;
|
||||
@@ -17,10 +16,10 @@ namespace Content.Client.Physics.Controllers
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<RelayInputMoverComponent, PlayerAttachedEvent>(OnRelayPlayerAttached);
|
||||
SubscribeLocalEvent<RelayInputMoverComponent, PlayerDetachedEvent>(OnRelayPlayerDetached);
|
||||
SubscribeLocalEvent<InputMoverComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<InputMoverComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<RelayInputMoverComponent, LocalPlayerAttachedEvent>(OnRelayPlayerAttached);
|
||||
SubscribeLocalEvent<RelayInputMoverComponent, LocalPlayerDetachedEvent>(OnRelayPlayerDetached);
|
||||
SubscribeLocalEvent<InputMoverComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<InputMoverComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeLocalEvent<InputMoverComponent, UpdateIsPredictedEvent>(OnUpdatePredicted);
|
||||
SubscribeLocalEvent<MovementRelayTargetComponent, UpdateIsPredictedEvent>(OnUpdateRelayTargetPredicted);
|
||||
@@ -54,7 +53,7 @@ namespace Content.Client.Physics.Controllers
|
||||
// What if the entity is being pulled by a vehicle controlled by the player?
|
||||
}
|
||||
|
||||
private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, PlayerAttachedEvent args)
|
||||
private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
Physics.UpdateIsPredicted(uid);
|
||||
Physics.UpdateIsPredicted(component.RelayEntity);
|
||||
@@ -62,7 +61,7 @@ namespace Content.Client.Physics.Controllers
|
||||
SetMoveInput(inputMover, MoveButtons.None);
|
||||
}
|
||||
|
||||
private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, PlayerDetachedEvent args)
|
||||
private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
Physics.UpdateIsPredicted(uid);
|
||||
Physics.UpdateIsPredicted(component.RelayEntity);
|
||||
@@ -70,12 +69,12 @@ namespace Content.Client.Physics.Controllers
|
||||
SetMoveInput(inputMover, MoveButtons.None);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, LocalPlayerAttachedEvent args)
|
||||
{
|
||||
SetMoveInput(component, MoveButtons.None);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
SetMoveInput(component, MoveButtons.None);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Content.Shared.Players;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Players;
|
||||
|
||||
public sealed class PlayerSystem : SharedPlayerSystem
|
||||
{
|
||||
public override PlayerData? ContentData(ICommonSession? session)
|
||||
public override ContentPlayerData? ContentData(ICommonSession? session)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Replay.Spectator;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Network;
|
||||
@@ -79,7 +79,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
public void SetSpectatorPosition(SpectatorData data)
|
||||
{
|
||||
if (_player.LocalPlayer == null)
|
||||
if (_player.LocalSession == null)
|
||||
return;
|
||||
|
||||
if (data.Controller != null
|
||||
@@ -87,13 +87,13 @@ public sealed partial class ReplaySpectatorSystem
|
||||
&& Exists(session.AttachedEntity)
|
||||
&& Transform(session.AttachedEntity.Value).MapID != MapId.Nullspace)
|
||||
{
|
||||
_player.LocalPlayer.AttachEntity(session.AttachedEntity.Value, EntityManager, _client);
|
||||
_player.SetAttachedEntity(_player.LocalSession, session.AttachedEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Exists(data.Entity) && Transform(data.Entity).MapID != MapId.Nullspace)
|
||||
{
|
||||
_player.LocalPlayer.AttachEntity(data.Entity, EntityManager, _client);
|
||||
_player.SetAttachedEntity(_player.LocalSession, data.Entity);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.Eye != null && TryComp(_player.LocalPlayer.ControlledEntity, out InputMoverComponent? newMover))
|
||||
if (data.Eye != null && TryComp(_player.LocalSession.AttachedEntity, out InputMoverComponent? newMover))
|
||||
{
|
||||
newMover.RelativeEntity = data.Eye.Value.Ent;
|
||||
newMover.TargetRelativeRotation = newMover.RelativeRotation = data.Eye.Value.Rot;
|
||||
@@ -177,7 +177,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
SetSpectatorPosition(default);
|
||||
}
|
||||
|
||||
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, PlayerDetachedEvent args)
|
||||
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
if (IsClientSide(uid))
|
||||
QueueDel(uid);
|
||||
|
||||
@@ -32,10 +32,10 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
public void SpectateEntity(EntityUid target)
|
||||
{
|
||||
if (_player.LocalPlayer == null)
|
||||
if (_player.LocalSession == null)
|
||||
return;
|
||||
|
||||
var old = _player.LocalPlayer.ControlledEntity;
|
||||
var old = _player.LocalSession.AttachedEntity;
|
||||
|
||||
if (old == target)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
return;
|
||||
}
|
||||
|
||||
_player.LocalPlayer.AttachEntity(target, EntityManager, _client);
|
||||
_player.SetAttachedEntity(_player.LocalSession, target);
|
||||
EnsureComp<ReplaySpectatorComponent>(target);
|
||||
|
||||
_stateMan.RequestStateChange<ReplaySpectateEntityState>();
|
||||
@@ -59,10 +59,10 @@ public sealed partial class ReplaySpectatorSystem
|
||||
|
||||
public TransformComponent SpawnSpectatorGhost(EntityCoordinates coords, bool gridAttach)
|
||||
{
|
||||
if (_player.LocalPlayer == null)
|
||||
if (_player.LocalSession == null)
|
||||
throw new InvalidOperationException();
|
||||
|
||||
var old = _player.LocalPlayer.ControlledEntity;
|
||||
var old = _player.LocalSession.AttachedEntity;
|
||||
|
||||
var ent = Spawn("ReplayObserver", coords);
|
||||
_eye.SetMaxZoom(ent, Vector2.One * 5);
|
||||
@@ -73,7 +73,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
if (gridAttach)
|
||||
_transform.AttachToGridOrMap(ent);
|
||||
|
||||
_player.LocalPlayer.AttachEntity(ent, EntityManager, _client);
|
||||
_player.SetAttachedEntity(_player.LocalSession, ent);
|
||||
|
||||
if (old != null)
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public sealed partial class ReplaySpectatorSystem
|
||||
{
|
||||
if (args.Length == 0)
|
||||
{
|
||||
if (_player.LocalPlayer?.ControlledEntity is { } current)
|
||||
if (_player.LocalSession?.AttachedEntity is { } current)
|
||||
SpawnSpectatorGhost(new EntityCoordinates(current, default), true);
|
||||
else
|
||||
SpawnSpectatorGhost(default, true);
|
||||
|
||||
@@ -6,7 +6,6 @@ using Robust.Client.Player;
|
||||
using Robust.Client.Replays.Playback;
|
||||
using Robust.Client.State;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
|
||||
namespace Content.Client.Replay.Spectator;
|
||||
@@ -40,7 +39,7 @@ public sealed partial class ReplaySpectatorSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<GetVerbsEvent<AlternativeVerb>>(OnGetAlternativeVerbs);
|
||||
SubscribeLocalEvent<ReplaySpectatorComponent, EntityTerminatingEvent>(OnTerminating);
|
||||
SubscribeLocalEvent<ReplaySpectatorComponent, PlayerDetachedEvent>(OnDetached);
|
||||
SubscribeLocalEvent<ReplaySpectatorComponent, LocalPlayerDetachedEvent>(OnDetached);
|
||||
SubscribeLocalEvent<ReplaySpectatorComponent, EntParentChangedMessage>(OnParentChanged);
|
||||
|
||||
InitializeBlockers();
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Client.Console;
|
||||
using Robust.Client.Placement;
|
||||
using Robust.Client.Placement.Modes;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Sandbox
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Traits.Assorted;
|
||||
using Content.Client.Camera;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -19,7 +17,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ParacusiaComponent, ComponentStartup>(OnComponentStartup);
|
||||
SubscribeLocalEvent<ParacusiaComponent, PlayerDetachedEvent>(OnPlayerDetach);
|
||||
SubscribeLocalEvent<ParacusiaComponent, LocalPlayerDetachedEvent>(OnPlayerDetach);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -40,7 +38,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
|
||||
component.NextIncidentTime = _timing.CurTime + TimeSpan.FromSeconds(_random.NextFloat(component.MinTimeBetweenIncidents, component.MaxTimeBetweenIncidents));
|
||||
}
|
||||
|
||||
private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
|
||||
{
|
||||
component.Stream?.Stop();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Client.UserInterface.Systems.Objectives.Controls;
|
||||
using Content.Shared.Input;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controllers;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -21,6 +22,7 @@ namespace Content.Client.UserInterface.Systems.Character;
|
||||
[UsedImplicitly]
|
||||
public sealed class CharacterUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>, IOnSystemChanged<CharacterInfoSystem>
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
[UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!;
|
||||
[UISystemDependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
@@ -56,13 +58,13 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
|
||||
public void OnSystemLoaded(CharacterInfoSystem system)
|
||||
{
|
||||
system.OnCharacterUpdate += CharacterUpdated;
|
||||
system.OnCharacterDetached += CharacterDetached;
|
||||
_player.LocalPlayerDetached += CharacterDetached;
|
||||
}
|
||||
|
||||
public void OnSystemUnloaded(CharacterInfoSystem system)
|
||||
{
|
||||
system.OnCharacterUpdate -= CharacterUpdated;
|
||||
system.OnCharacterDetached -= CharacterDetached;
|
||||
_player.LocalPlayerDetached -= CharacterDetached;
|
||||
}
|
||||
|
||||
public void UnloadButton()
|
||||
@@ -160,7 +162,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
|
||||
_window.RolePlaceholder.Visible = briefing == null && !controls.Any() && !objectives.Any();
|
||||
}
|
||||
|
||||
private void CharacterDetached()
|
||||
private void CharacterDetached(EntityUid uid)
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
@@ -162,7 +162,8 @@ public sealed class ChatUIController : UIController
|
||||
_sawmill = Logger.GetSawmill("chat");
|
||||
_sawmill.Level = LogLevel.Info;
|
||||
_admin.AdminStatusUpdated += UpdateChannelPermissions;
|
||||
_player.LocalPlayerChanged += OnLocalPlayerChanged;
|
||||
_player.LocalPlayerAttached += OnAttachedChanged;
|
||||
_player.LocalPlayerDetached += OnAttachedChanged;
|
||||
_state.OnStateChanged += StateChanged;
|
||||
_net.RegisterNetMessage<MsgChatMessage>(OnChatMessage);
|
||||
_net.RegisterNetMessage<MsgDeleteChatMessagesBy>(OnDeleteChatMessagesBy);
|
||||
@@ -170,7 +171,7 @@ public sealed class ChatUIController : UIController
|
||||
|
||||
_speechBubbleRoot = new LayoutContainer();
|
||||
|
||||
OnLocalPlayerChanged(new LocalPlayerChangedEventArgs(null, _player.LocalPlayer));
|
||||
UpdateChannelPermissions();
|
||||
|
||||
_input.SetInputCommand(ContentKeyFunctions.FocusChat,
|
||||
InputCmdHandler.FromDelegate(_ => FocusChat()));
|
||||
@@ -363,29 +364,7 @@ public sealed class ChatUIController : UIController
|
||||
_speechBubbleRoot.SetPositionLast();
|
||||
}
|
||||
|
||||
private void OnLocalPlayerChanged(LocalPlayerChangedEventArgs obj)
|
||||
{
|
||||
if (obj.OldPlayer != null)
|
||||
{
|
||||
obj.OldPlayer.EntityAttached -= OnLocalPlayerEntityAttached;
|
||||
obj.OldPlayer.EntityDetached -= OnLocalPlayerEntityDetached;
|
||||
}
|
||||
|
||||
if (obj.NewPlayer != null)
|
||||
{
|
||||
obj.NewPlayer.EntityAttached += OnLocalPlayerEntityAttached;
|
||||
obj.NewPlayer.EntityDetached += OnLocalPlayerEntityDetached;
|
||||
}
|
||||
|
||||
UpdateChannelPermissions();
|
||||
}
|
||||
|
||||
private void OnLocalPlayerEntityAttached(EntityAttachedEventArgs obj)
|
||||
{
|
||||
UpdateChannelPermissions();
|
||||
}
|
||||
|
||||
private void OnLocalPlayerEntityDetached(EntityDetachedEventArgs obj)
|
||||
private void OnAttachedChanged(EntityUid uid)
|
||||
{
|
||||
UpdateChannelPermissions();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using Content.Client.Alerts;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
@@ -25,13 +23,13 @@ public sealed class DamageOverlayUiController : UIController
|
||||
public override void Initialize()
|
||||
{
|
||||
_overlay = new Overlays.DamageOverlay();
|
||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttach);
|
||||
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttach);
|
||||
SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<MobThresholdChecked>(OnThresholdCheck);
|
||||
}
|
||||
|
||||
private void OnPlayerAttach(PlayerAttachedEvent args)
|
||||
private void OnPlayerAttach(LocalPlayerAttachedEvent args)
|
||||
{
|
||||
ClearOverlay();
|
||||
if (!EntityManager.TryGetComponent<MobStateComponent>(args.Entity, out var mobState))
|
||||
@@ -41,7 +39,7 @@ public sealed class DamageOverlayUiController : UIController
|
||||
_overlayManager.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(LocalPlayerDetachedEvent args)
|
||||
{
|
||||
_overlayManager.RemoveOverlay(_overlay);
|
||||
ClearOverlay();
|
||||
|
||||
@@ -17,7 +17,7 @@ using Robust.Client.UserInterface.Controllers;
|
||||
using Robust.Client.UserInterface.Controllers.Implementations;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
using static Robust.Client.UserInterface.Controls.BaseButton;
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ using Robust.Client.State;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Weapons.Melee;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user