private void PlayerAttached(AlertsComponent clientAlertsComponent)
 {
     if (!CurControlled(clientAlertsComponent.Owner, _playerManager))
     {
         return;
     }
     SyncAlerts?.Invoke(this, clientAlertsComponent.Alerts);
 }
    protected override void AfterClearAlert(AlertsComponent alertsComponent)
    {
        if (!CurControlled(alertsComponent.Owner, _playerManager))
        {
            return;
        }

        SyncAlerts?.Invoke(this, alertsComponent.Alerts);
    }
Beispiel #3
0
    private void OnPlayerAttached(EntityUid uid, AlertsComponent component, PlayerAttachedEvent args)
    {
        if (_playerManager.LocalPlayer?.ControlledEntity != uid)
        {
            return;
        }

        SyncAlerts?.Invoke(this, component.Alerts);
    }
Beispiel #4
0
    protected override void AfterClearAlert(AlertsComponent alertsComponent)
    {
        if (_playerManager.LocalPlayer?.ControlledEntity != alertsComponent.Owner)
        {
            return;
        }

        SyncAlerts?.Invoke(this, alertsComponent.Alerts);
    }
    private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args)
    {
        var componentAlerts = (args.Current as AlertsComponentState)?.Alerts;

        if (componentAlerts == null)
        {
            return;
        }

        //TODO: Do we really want to send alerts for non-attached entity?
        component.Alerts = componentAlerts;
        if (!CurControlled(component.Owner, _playerManager))
        {
            return;
        }

        SyncAlerts?.Invoke(this, componentAlerts);
    }
Beispiel #6
0
    private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref ComponentHandleState args)
    {
        if (_playerManager.LocalPlayer?.ControlledEntity != uid)
        {
            return;
        }

        var componentAlerts = (args.Current as AlertsComponentState)?.Alerts;

        if (componentAlerts == null)
        {
            return;
        }

        component.Alerts = new(componentAlerts);

        SyncAlerts?.Invoke(this, componentAlerts);
    }