コード例 #1
0
 private void PlayerAttached(AlertsComponent clientAlertsComponent)
 {
     if (!CurControlled(clientAlertsComponent.Owner, _playerManager))
     {
         return;
     }
     SyncAlerts?.Invoke(this, clientAlertsComponent.Alerts);
 }
コード例 #2
0
    protected override void AfterClearAlert(AlertsComponent alertsComponent)
    {
        if (!CurControlled(alertsComponent.Owner, _playerManager))
        {
            return;
        }

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

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

        SyncAlerts?.Invoke(this, alertsComponent.Alerts);
    }
コード例 #5
0
    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);
    }
コード例 #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);
    }