mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Pulling rework v2 (#24936)
* Pulling rework
Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame.
* More pulling cleanup
* stats
* More cleanup
* First draft
* More pulling
* weh
* Fix puller
* Pulling working
* Fix merge
* Dunked
* Self-merge time
* Fix hotkey
* Fix container changes
* oop
* Fix multi-pulling
* Move alerts cleanup.
* pulling fixes
(cherry picked from commit c584f6444a)
This commit is contained in:
@@ -4,6 +4,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Alerts;
|
||||
|
||||
@@ -12,6 +13,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
|
||||
{
|
||||
public AlertOrderPrototype? AlertOrder { get; set; }
|
||||
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
@@ -49,24 +51,23 @@ public sealed class ClientAlertsSystem : AlertsSystem
|
||||
|
||||
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
|
||||
{
|
||||
if (_playerManager.LocalEntity != alerts.Owner)
|
||||
return;
|
||||
|
||||
SyncAlerts?.Invoke(this, alerts.Comp.Alerts);
|
||||
UpdateHud(alerts);
|
||||
}
|
||||
|
||||
protected override void AfterClearAlert(Entity<AlertsComponent> alertsComponent)
|
||||
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
|
||||
{
|
||||
if (_playerManager.LocalEntity != alertsComponent.Owner)
|
||||
return;
|
||||
|
||||
SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts);
|
||||
UpdateHud(alerts);
|
||||
}
|
||||
|
||||
private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args)
|
||||
private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if (_playerManager.LocalEntity == uid)
|
||||
SyncAlerts?.Invoke(this, component.Alerts);
|
||||
UpdateHud(alerts);
|
||||
}
|
||||
|
||||
private void UpdateHud(Entity<AlertsComponent> entity)
|
||||
{
|
||||
if (_playerManager.LocalEntity == entity.Owner)
|
||||
SyncAlerts?.Invoke(this, entity.Comp.Alerts);
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user